diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3a2238d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,245 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+[Xx]64/
+[Xx]86/
+[Bb]uild/
+bld/
+[Bb]in/
+[Oo]bj/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+
+# TODO: Un-comment the next line if you do not want to checkin
+# your web deploy settings because they may include unencrypted
+# passwords
+#*.pubxml
+*.publishproj
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Microsoft Azure ApplicationInsights config file
+ApplicationInsights.config
+
+# Windows Store app package directory
+AppPackages/
+BundleArtifacts/
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# LightSwitch generated files
+GeneratedArtifacts/
+ModelManifest.xml
+
+# Paket dependency manager
+.paket/paket.exe
+
+# FAKE - F# Make
+.fake/
\ No newline at end of file
diff --git a/converter/converter.sln b/converter/converter.sln
new file mode 100644
index 0000000..17a7ffc
--- /dev/null
+++ b/converter/converter.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "converter", "converter\converter.csproj", "{332FE3F6-1355-4CCE-B4AA-C18EACB7C00F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {332FE3F6-1355-4CCE-B4AA-C18EACB7C00F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {332FE3F6-1355-4CCE-B4AA-C18EACB7C00F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {332FE3F6-1355-4CCE-B4AA-C18EACB7C00F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {332FE3F6-1355-4CCE-B4AA-C18EACB7C00F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/converter/converter/App.config b/converter/converter/App.config
new file mode 100644
index 0000000..88fa402
--- /dev/null
+++ b/converter/converter/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/converter/converter/App.xaml b/converter/converter/App.xaml
new file mode 100644
index 0000000..382bbbe
--- /dev/null
+++ b/converter/converter/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/converter/converter/App.xaml.cs b/converter/converter/App.xaml.cs
new file mode 100644
index 0000000..10c79e1
--- /dev/null
+++ b/converter/converter/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace converter
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/converter/converter/Model/DataRate.cs b/converter/converter/Model/DataRate.cs
new file mode 100644
index 0000000..ab92318
--- /dev/null
+++ b/converter/converter/Model/DataRate.cs
@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Practices.Prism.Commands;
+using Microsoft.Practices.Prism.Mvvm;
+using System.Runtime.CompilerServices;
+
+namespace converter.Model
+{
+ class DataRate : BindableBase
+ {
+ private string rubtorub;
+ private string rubtoeur;
+ private string rubtousd;
+ private string usdtousd;
+ private string usdtoeur;
+ private string usdtorub;
+ private string eurtoeur;
+ private string eurtousd;
+ private string eurtorub;
+ private string currentday;
+ public string RUBtoRUB
+ {
+ get
+ { return rubtorub; }
+ set
+ {
+ SetProperty(ref rubtorub, value); ;
+ }
+ }
+ public string RUBtoEUR
+ {
+ get
+ { return rubtoeur; }
+ set
+ {
+ SetProperty(ref rubtoeur, value); ;
+ }
+ }
+ public string RUBtoUSD
+ {
+ get
+ { return rubtousd; }
+ set
+ {
+ SetProperty(ref rubtousd, value); ;
+ }
+ }
+ public string USDtoUSD
+ {
+ get
+ { return usdtousd; }
+ set
+ {
+ SetProperty(ref usdtousd, value); ;
+ }
+ }
+ public string USDtoEUR
+ {
+ get
+ { return usdtoeur; }
+ set
+ {
+ SetProperty(ref usdtoeur, value); ;
+ }
+ }
+ public string USDtoRUB
+ {
+ get
+ { return usdtorub; }
+ set
+ {
+ SetProperty(ref usdtorub, value); ;
+ }
+ }
+ public string EURtoEUR
+ {
+ get
+ { return eurtoeur; }
+ set
+ {
+ SetProperty(ref eurtoeur, value); ;
+ }
+ }
+ public string EURtoUSD
+ {
+ get
+ { return eurtousd; }
+ set
+ {
+ SetProperty(ref eurtousd, value); ;
+ }
+ }
+ public string EURtoRUB
+ {
+ get
+ { return eurtorub; }
+ set
+ {
+ SetProperty(ref eurtorub, value);
+ }
+ }
+ public string CurrentDay
+ {
+ get
+ { return currentday; }
+ set
+ {
+ SetProperty(ref currentday, value);
+ }
+ }
+ }
+}
diff --git a/converter/converter/Properties/AssemblyInfo.cs b/converter/converter/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..68f9765
--- /dev/null
+++ b/converter/converter/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("converter")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("converter")]
+[assembly: AssemblyCopyright("Copyright © 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/converter/converter/Properties/Resources.Designer.cs b/converter/converter/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..c2bcc03
--- /dev/null
+++ b/converter/converter/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace converter.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("converter.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/converter/converter/Properties/Resources.resx b/converter/converter/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/converter/converter/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/converter/converter/Properties/Settings.Designer.cs b/converter/converter/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..335516a
--- /dev/null
+++ b/converter/converter/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace converter.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/converter/converter/Properties/Settings.settings b/converter/converter/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/converter/converter/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/converter/converter/SqlDataBase/SqlDataBase.cs b/converter/converter/SqlDataBase/SqlDataBase.cs
new file mode 100644
index 0000000..7617ba0
--- /dev/null
+++ b/converter/converter/SqlDataBase/SqlDataBase.cs
@@ -0,0 +1,476 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Data;
+using System.Windows;
+using System.Threading;
+using System.Windows.Data;
+using System.Data.SqlClient;
+
+
+namespace converter.SqlDataBase
+{
+ public class DataBase
+ {
+ private string _ConStr;
+
+ public DataBase(string ConStr)
+ {
+ _ConStr = ConStr;
+ }
+ public bool IsDataBaseExist()
+ {
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ {
+ try
+ {
+ conn.Open();
+
+ }
+ catch (SqlException se)
+ {
+ if (se.Number == 4060)
+ return false;
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database connect error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ return false;
+ }
+ return true;
+ }
+ }
+
+
+ public bool CreateDataBase(string createdbname)
+ {
+ if (!IsDataBaseExist())
+ {
+ using (SqlConnection conn = new SqlConnection(@"Data Source=(local)\SQLEXPRESS;
+ Integrated Security=True"))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(string.Format(string.Concat("CREATE DATABASE ", createdbname)), conn))
+ {
+ conn.Open();
+
+ try
+ {
+ cmdSQLCommand.ExecuteNonQuery();
+ System.Windows.MessageBox.Show("DataBase is Created Successfully", "Ok", MessageBoxButton.OK, MessageBoxImage.Information);
+ Thread.Sleep(5000);
+ return true;
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+
+ }
+
+ }
+ return false;
+ }
+
+ public bool DropDataBase(string dropdbname)
+ {
+ if (IsDataBaseExist())
+ {
+ using (SqlConnection conn = new SqlConnection(@"Data Source=(local)\SQLEXPRESS;
+ Integrated Security=True"))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(string.Format(string.Concat("ALTER DATABASE ", dropdbname, " SET SINGLE_USER WITH ROLLBACK IMMEDIATE;", "DROP DATABASE ", dropdbname)), conn))
+ {
+ conn.Open();
+
+ try
+ {
+ //conn.ChangeDatabase(dropdbname);
+ cmdSQLCommand.ExecuteNonQuery();
+ System.Windows.MessageBox.Show("DataBase drop Successfully", "Ok", MessageBoxButton.OK, MessageBoxImage.Information);
+ Thread.Sleep(5000);
+ return true;
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database drop error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ }
+ return false;
+ }
+
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + column2 + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Fill DataBase Error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ return false;
+ }
+
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2, string column3)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + column2 + column3 + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ //System.Environment.Exit(0);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Fill DataBase Error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ return false;
+ }
+
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2, string column3, string column4)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + column2 + column3 + column4 + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ //System.Environment.Exit(0);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Fill DataBase Error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ return false;
+ }
+
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2, string column3, string column4, string column5, string column6)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + ", " + column2 + ", " + column3 + ", " + column4 + ", " + column5 + ", " + column6 + ", " + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ catch (System.Exception ex)
+
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ return false;
+ }
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2, string column3, string column4, string column5, string column6, string column7)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + "," + column2 + "," + column3 + "," + column4 + "," + column5 + "," + column6 + "," + column7 + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ //System.Environment.Exit(0);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ return false;
+ }
+
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2, string column3, string column4, string column5, string column6, string column7, string column8)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + "," + column2 + "," + column3 + "," + column4 + "," + column5 + "," + column6 + "," + column7 + "," + column8 + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ //System.Environment.Exit(0);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ return false;
+ }
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2, string column3, string column4, string column5, string column6, string column7, string column8, string column9)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + "," + column2 + "," + column3 + "," + column4 + "," + column5 + "," + column6 + "," + column7 + "," + column8 + "," + column9 + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ //System.Environment.Exit(0);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+ return false;
+ }
+
+
+ public bool CreateTableIsNotExist(string dbname, string tablename, string column1, string column2, string column3, string column4, string column5, string column6, string column7, string column8, string column9, string column10, string column11)
+ {
+ string SQLstring = "IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + tablename + "')" +
+ " CREATE TABLE " + tablename + "(" + column1 + "," + column2 + "," + column3 + "," + column4 + "," + column5 + "," + column6 + "," + column7 + "," + column8 + "," + column9 + "," + column10 + "," + column11 + ")";
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ //System.Environment.Exit(0);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database table create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+
+
+ return false;
+ }
+
+ public bool InsertRowDataBase(string DataBaseTableName, string CommandString)
+ {
+
+ string SQLstring = "Insert Into " + DataBaseTableName + CommandString;
+
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlCommand cmdSQLCommand = new SqlCommand(SQLstring, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmdSQLCommand.ExecuteNonQuery();
+ return true;
+ }
+ catch (SqlException ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Database create error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Fill DataBase Error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ return false;
+ }
+
+ public bool FillDataTableDataBase(DataSet myDataSet, string DataBaseTableName, string DataSetTableName)
+ {
+ int iResult;
+ Object thisLock = new Object();
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlDataAdapter dAdapt = new SqlDataAdapter("Select * From " + DataBaseTableName, _ConStr))
+ using (SqlCommandBuilder builder = new SqlCommandBuilder(dAdapt))
+ {
+ try
+ {
+ conn.Open();
+ Task FillDT = new Task(() => { lock (thisLock) { iResult = dAdapt.Fill(myDataSet, DataSetTableName); } });
+
+ FillDT.Start();
+ FillDT.Wait();
+ FillDT.Dispose();
+ return true;
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Fill DataBase Error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+ return false;
+ }
+ public bool FillDataTableDataBaseSelect(DataSet myDataSet, string DataBaseTableName, string DataSetTableName, string selectstring)
+ {
+ int iResult;
+ Object thisLock = new Object();
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlDataAdapter dAdapt = new SqlDataAdapter("Select * From " + DataBaseTableName, _ConStr))
+ using (SqlCommandBuilder builder = new SqlCommandBuilder(dAdapt))
+ {
+ try
+ {
+ conn.Open();
+ dAdapt.SelectCommand = new SqlCommand(selectstring, conn);
+ Task FillDT = new Task(() => { lock (thisLock) { iResult = dAdapt.Fill(myDataSet, DataSetTableName); } });
+
+ FillDT.Start();
+ FillDT.Wait();
+ FillDT.Dispose();
+ return true;
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Fill DataBase Error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+ return false;
+ }
+
+ public bool UpdateDataTableDataBase(DataSet myDataSet, string DataBaseTableName, string DataSetTableName)
+ {
+ int iResult;
+ Object thisLock = new Object();
+ using (SqlConnection conn = new SqlConnection(_ConStr))
+ using (SqlDataAdapter dAdapt = new SqlDataAdapter("Select * From " + DataBaseTableName, _ConStr))
+ using (SqlCommandBuilder builder = new SqlCommandBuilder(dAdapt))
+ {
+ try
+ {
+ conn.Open();
+ Task FillDT = new Task(() => { lock (thisLock) { iResult = dAdapt.Update(myDataSet, DataSetTableName); } });
+
+ FillDT.Start();
+ FillDT.Wait();
+ FillDT.Dispose();
+ return true;
+ }
+ catch (System.Exception ex)
+ {
+ if (ex.Source != null)
+ System.Windows.MessageBox.Show(ex.ToString(), "Update DataBase Error!Try again!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+ return false;
+ }
+
+ //public SqlDbType GetSQLType(Type CLRType)
+ //{
+ // if (CLRType.Equals(typeof(string)))
+ // return SqlDbType.Char;
+ // else if (CLRType.Equals(typeof(Int32)))
+ // return SqlDbType.Int;
+ // else return SqlDbType.Variant;
+ //}
+
+ //public bool TestGetSQLType()
+ //{
+ // int test = 10;
+ // System.Windows.Forms.MessageBox.Show(GetSQLType(test.GetType()).ToString());
+ // return true;
+
+ //}
+
+ }
+}
diff --git a/converter/converter/View/MainWindow.xaml b/converter/converter/View/MainWindow.xaml
new file mode 100644
index 0000000..d781692
--- /dev/null
+++ b/converter/converter/View/MainWindow.xaml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/converter/converter/View/MainWindow.xaml.cs b/converter/converter/View/MainWindow.xaml.cs
new file mode 100644
index 0000000..520cf92
--- /dev/null
+++ b/converter/converter/View/MainWindow.xaml.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Net;
+using System.IO;
+using System.Xml;
+using Microsoft.Practices.Prism.Mvvm;
+using converter.ViewModel;
+
+
+namespace converter.View
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+
+ try
+ {
+ MainWindowViewModel mainWindowViewModel = new MainWindowViewModel();
+ this.DataContext = mainWindowViewModel;
+ }
+ catch (ConstructorAbortedException)
+ {
+ System.Environment.Exit(0);
+ }
+ }
+ }
+}
diff --git a/converter/converter/ViewModel/DataRateViewModel.cs b/converter/converter/ViewModel/DataRateViewModel.cs
new file mode 100644
index 0000000..c2e25a4
--- /dev/null
+++ b/converter/converter/ViewModel/DataRateViewModel.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Practices.Prism.Mvvm;
+using converter.Model;
+using System.Runtime.CompilerServices;
+
+
+namespace converter.ViewModel
+{
+ class DataRateViewModel : BindableBase
+ {
+ private DataRate dataRate;
+ public DataRateViewModel()
+ {
+ this.DataRate = new DataRate();
+ }
+ public DataRate DataRate
+ {
+ get { return this.dataRate; }
+ set
+ {
+ SetProperty(ref this.dataRate, value);
+ }
+ }
+
+
+ //protected override bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null)
+ //{
+ // if (object.Equals(storage, value)) return false;
+
+ // storage = value;
+ // this.OnPropertyChanged(propertyName);
+
+ // return true;
+ //}
+ }
+}
diff --git a/converter/converter/ViewModel/MainWindowViewModel.cs b/converter/converter/ViewModel/MainWindowViewModel.cs
new file mode 100644
index 0000000..f3ac86d
--- /dev/null
+++ b/converter/converter/ViewModel/MainWindowViewModel.cs
@@ -0,0 +1,308 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Practices.Prism.Commands;
+using System.Windows.Input;
+using converter.Model;
+using System.Windows.Data;
+using System.Net;
+using System.IO;
+using System.Xml;
+using System.Data;
+using System.Text.RegularExpressions;
+using converter.SqlDataBase;
+
+namespace converter.ViewModel
+{
+ class ConstructorAbortedException : Exception { }
+ class MainWindowViewModel
+ {
+ string connStr = @"Data Source=(local)\SQLEXPRESS;
+ Initial Catalog=Temp;
+ Integrated Security=True";
+ bool iResult;
+ Random rnd;
+
+ private DataBase CalculateBase;
+
+ Dictionary exchangerate = new Dictionary
+ {
+ {"RUB_RUB", "http://free.currencyconverterapi.com/api/v5/convert?q=RUB_RUB&compact=y"},
+ {"RUB_EUR", "http://free.currencyconverterapi.com/api/v5/convert?q=RUB_EUR&compact=y"},
+ {"RUB_USD", "http://free.currencyconverterapi.com/api/v5/convert?q=RUB_USD&compact=y"},
+ {"EUR_EUR", "http://free.currencyconverterapi.com/api/v5/convert?q=EUR_EUR&compact=y"},
+ {"EUR_RUB", "http://free.currencyconverterapi.com/api/v5/convert?q=EUR_RUB&compact=y"},
+ {"EUR_USD", "http://free.currencyconverterapi.com/api/v5/convert?q=EUR_USD&compact=y"},
+ {"USD_USD", "http://free.currencyconverterapi.com/api/v5/convert?q=USD_USD&compact=y"},
+ {"USD_RUB", "http://free.currencyconverterapi.com/api/v5/convert?q=USD_RUB&compact=y"},
+ {"USD_EUR", "http://free.currencyconverterapi.com/api/v5/convert?q=USD_EUR&compact=y"}
+ };
+ public MainWindowViewModel()
+ {
+ this.LoadCommand = new DelegateCommand