37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
|
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<ISecurityManager, SecurityManager>();
|
|||
|
DependencyManager.InitDependency();
|
|||
|
var logic = DependencyManager.Instance.Resolve<IOrderSyncHistoryLogic>();
|
|||
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|