added Language methods

parent 7b057aad
......@@ -35,6 +35,7 @@
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
......@@ -45,10 +46,12 @@
</ItemGroup>
<ItemGroup>
<Compile Include="JsonTranslator.cs" />
<Compile Include="Languages.cs" />
<Compile Include="Traductor.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<add name="connectionStringSomee"
connectionString="
metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;data source=languagesDat.mssql.somee.com;initial catalog=list;packet size=4096;persist security info=False;user id=torgaiv3_SQLLogin_1;pwd=nz53hhpc22;MultipleActiveResultSets=True&quot;"
providerName="System.Data.EntityClient" />
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
namespace Api.Business
{
public static class Languages
{
public static Dictionary<string, string> getAllLanguages()
{
Dictionary<string, string> response = null;
string connectionString = "Server = languagesDat.mssql.somee.com; Database = languagesDat; User ID = torgaiv3_SQLLogin_1; Password = nz53hhpc22; Trusted_Connection = False;";
using (SqlConnection cn = new SqlConnection(connectionString))
{
cn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM list", cn);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
response = new Dictionary<string, string>();
while (dr.Read())
{
response.Add(
Convert.ToString(dr["id"]),
Convert.ToString(dr["value"])
);
}
}
}
return response;
}
}
}
using System;
using System.Collections.Generic;
using System.Net.Http;
namespace Api.Business
......@@ -13,7 +14,7 @@ namespace Api.Business
string TrimValue = @"<div dir=""ltr"" class=""t0"">";
int getTranslatedString = Aresult.IndexOf(TrimValue) + TrimValue.Length;
string getTranslatedFullString = Aresult.Substring(getTranslatedString);
if (getTranslatedFullString.Contains("\\"))
{
if (getTranslatedFullString.Contains("\\x26#39;"))
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28922.388
# Visual Studio 15
VisualStudioVersion = 15.0.28307.572
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Api.Traductor", "Api.Traductor\Api.Traductor.csproj", "{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}"
EndProject
......@@ -10,17 +10,57 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|ARM.ActiveCfg = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|ARM.Build.0 = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|ARM64.Build.0 = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|x64.ActiveCfg = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|x64.Build.0 = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|x86.ActiveCfg = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Debug|x86.Build.0 = Debug|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|Any CPU.Build.0 = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|ARM.ActiveCfg = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|ARM.Build.0 = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|ARM64.ActiveCfg = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|ARM64.Build.0 = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|x64.ActiveCfg = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|x64.Build.0 = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|x86.ActiveCfg = Release|Any CPU
{13A0F83E-E73A-41EA-BB01-57D4C80EC9C5}.Release|x86.Build.0 = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|ARM.ActiveCfg = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|ARM.Build.0 = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|ARM64.Build.0 = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|x64.ActiveCfg = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|x64.Build.0 = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|x86.ActiveCfg = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Debug|x86.Build.0 = Debug|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|Any CPU.Build.0 = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|ARM.ActiveCfg = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|ARM.Build.0 = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|ARM64.ActiveCfg = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|ARM64.Build.0 = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|x64.ActiveCfg = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|x64.Build.0 = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|x86.ActiveCfg = Release|Any CPU
{5BE36FE7-FD73-4448-8451-5C91D01A8691}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment