From 9df61f850db84235a6559254b626aaef4e00e509 Mon Sep 17 00:00:00 2001 From: kotcheshir73 Date: Sun, 20 Mar 2022 21:23:42 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B2=D0=B8=D1=81=20=D1=81?= =?UTF-8?q?=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BF=D1=80=D0=B8=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2=20?= =?UTF-8?q?=D1=81=D1=82=D1=83=D0=B4=D0=B5=D0=BD=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DepartmentPortal/DepartmentPortal.sln | 13 ++++++- .../WindowServiceSyncStudentOrders/Program.cs | 37 +++++++++++++++++++ .../WindowServiceSyncStudentOrders.csproj | 14 +++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/Program.cs create mode 100644 DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/WindowServiceSyncStudentOrders.csproj diff --git a/DepartmentPortal/DepartmentPortal.sln b/DepartmentPortal/DepartmentPortal.sln index 7df049d..2ed5003 100644 --- a/DepartmentPortal/DepartmentPortal.sln +++ b/DepartmentPortal/DepartmentPortal.sln @@ -31,9 +31,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToolsDesktop", "Common\Tool EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreDatabase", "Common\CoreDatabase\CoreDatabase.csproj", "{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityContract", "Security\SecurityContract\SecurityContract.csproj", "{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityContract", "Security\SecurityContract\SecurityContract.csproj", "{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DepartmentContract", "Department\DepartmentContract\DepartmentContract.csproj", "{5AA4DBD9-FD82-46D6-8A62-78DB269296B3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DepartmentContract", "Department\DepartmentContract\DepartmentContract.csproj", "{5AA4DBD9-FD82-46D6-8A62-78DB269296B3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WindowServices", "WindowServices", "{045965BC-9297-45DF-96E1-6986C286A81B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowServiceSyncStudentOrders", "WindowServices\WindowServiceSyncStudentOrders\WindowServiceSyncStudentOrders.csproj", "{4A68AC9F-07F9-43C3-83E6-359A9CFBC80E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -93,6 +97,10 @@ Global {5AA4DBD9-FD82-46D6-8A62-78DB269296B3}.Debug|Any CPU.Build.0 = Debug|Any CPU {5AA4DBD9-FD82-46D6-8A62-78DB269296B3}.Release|Any CPU.ActiveCfg = Release|Any CPU {5AA4DBD9-FD82-46D6-8A62-78DB269296B3}.Release|Any CPU.Build.0 = Release|Any CPU + {4A68AC9F-07F9-43C3-83E6-359A9CFBC80E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A68AC9F-07F9-43C3-83E6-359A9CFBC80E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A68AC9F-07F9-43C3-83E6-359A9CFBC80E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A68AC9F-07F9-43C3-83E6-359A9CFBC80E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -110,6 +118,7 @@ Global {C2AADB97-4122-48AB-9E48-6C2A9C33BFE4} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} {E9F9B0D8-18F3-40C3-843F-53D2F8B2293E} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A} {5AA4DBD9-FD82-46D6-8A62-78DB269296B3} = {A19E7709-6AD8-4E9B-B3AB-4339C67D9F39} + {4A68AC9F-07F9-43C3-83E6-359A9CFBC80E} = {045965BC-9297-45DF-96E1-6986C286A81B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FBA0CB49-EF2D-4538-9D00-FCEDA24879A9} diff --git a/DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/Program.cs b/DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/Program.cs new file mode 100644 index 0000000..07ed8f2 --- /dev/null +++ b/DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/Program.cs @@ -0,0 +1,37 @@ +using CoreDatabase; +using DepartmentContract.Logics.IGenericEntityLogic; +using System; +using System.Threading.Tasks; +using ToolsModule.ManagmentDependency; +using ToolsModule.ManagmentSecurity; + +namespace WindowServiceSyncStudentOrders +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Start sync student orders"); + try + { + DependencyManager.Instance.RegisterType(); + DependencyManager.InitDependency(); + var logic = DependencyManager.Instance.Resolve(); + var task = Task.Run(() => logic.SyncOrders()); + Task.WaitAll(new Task[] { task }); + if (task.Result) + { + Console.WriteLine("Student orders sync success"); + } + else + { + Console.WriteLine("Student orders sync fail"); + } + } + catch(Exception ex) + { + Console.WriteLine(ex.Message); + } + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/WindowServiceSyncStudentOrders.csproj b/DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/WindowServiceSyncStudentOrders.csproj new file mode 100644 index 0000000..80e3a18 --- /dev/null +++ b/DepartmentPortal/WindowServices/WindowServiceSyncStudentOrders/WindowServiceSyncStudentOrders.csproj @@ -0,0 +1,14 @@ + + + + Exe + net5.0 + + + + + + + + +