diff --git a/BO/Utils/AfterLoginUtil.cs b/BO/Utils/AfterLoginUtil.cs index 00b76e1..a944f39 100644 --- a/BO/Utils/AfterLoginUtil.cs +++ b/BO/Utils/AfterLoginUtil.cs @@ -19,13 +19,13 @@ namespace BO.Utils public static class AfterLoginUtil { - static List> roleToAssemblies = new List>(){new Tuple("排宰员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"), - new Tuple("过磅员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"), - new Tuple("验质员",@"C:\BwpB3Project\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),new Tuple("定级员",@"C:\BwpB3Project\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),new Tuple("窒晕员",@"C:\BwpB3Project\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm")}; + // static List> roleToAssemblies = new List>(){new Tuple("排宰员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"), + //new Tuple("过磅员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"), + // new Tuple("验质员",@"C:\BwpB3Project\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),new Tuple("定级员",@"C:\BwpB3Project\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),new Tuple("窒晕员",@"C:\BwpB3Project\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm")}; - //static List> roleToAssemblies = new List>(){new Tuple("排宰员",@"ButcherOrder"), - //new Tuple("过磅员",@"ButcherWeight"), - // new Tuple("验质员",@"QualityAndOrder"),new Tuple("定级员",@"WeighAndGrading"),new Tuple("窒晕员",@"OrderConfirm")}; + static List> roleToAssemblies = new List>(){new Tuple("排宰员",@"ButcherOrder"), + new Tuple("过磅员",@"ButcherWeight"), + new Tuple("验质员",@"QualityAndOrder"),new Tuple("定级员",@"WeighAndGrading"),new Tuple("窒晕员",@"OrderConfirm")}; public static Form CreateForm(string role) @@ -34,10 +34,10 @@ namespace BO.Utils if (first == null) throw new Exception("未注册的角色"); //#if debug - var filePath = string.Format("{0}.dll", first.Item2); + //var filePath = string.Format("{0}.dll", first.Item2); //#endif //#if !debug - //var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", first.Item2)); + var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", first.Item2)); //#endif if (!File.Exists(filePath)) throw new Exception("相关模块不存在"); diff --git a/ButcherManageClient/Login.cs b/ButcherManageClient/Login.cs index 9dc978a..522c6b2 100644 --- a/ButcherManageClient/Login.cs +++ b/ButcherManageClient/Login.cs @@ -140,7 +140,7 @@ namespace ButcherManageClient private void Login_Load(object sender, EventArgs e) { - //AutoUpdate(); + AutoUpdate(); } } } diff --git a/ButcherWeight/WeightContext.cs b/ButcherWeight/WeightContext.cs index a86a7dc..f062bd3 100644 --- a/ButcherWeight/WeightContext.cs +++ b/ButcherWeight/WeightContext.cs @@ -11,12 +11,7 @@ namespace ButcherWeight { public static class WeightContext { -//#if debug - //private static string loginConfigPath = @"C:\BwpB3Project\src\B3ButcherManageClient\ButcherManageClient\bin\Debug\WeightSetting.xml"; -//#endif -//#if !debug private static string loginConfigPath = Application.StartupPath + "\\WeightSetting.xml"; -//#endif private static WeightSetting _config; public static WeightSetting Config { diff --git a/Setup/Release/Setup.msi b/Setup/Release/Setup.msi index d076dbb..b15d026 100644 Binary files a/Setup/Release/Setup.msi and b/Setup/Release/Setup.msi differ diff --git a/WeighAndGrading/GradeContext.cs b/WeighAndGrading/GradeContext.cs index 5702877..f5aec70 100644 --- a/WeighAndGrading/GradeContext.cs +++ b/WeighAndGrading/GradeContext.cs @@ -11,12 +11,7 @@ namespace WeighAndGrading { public static class GradeContext { - //#if debug - //private static string loginConfigPath = @"C:\BwpB3Project\src\B3ButcherManageClient\ButcherManageClient\bin\Debug\GradeConfig.xml"; - //#endif - //#if !debug private static string loginConfigPath = Application.StartupPath + "\\GradeConfig.xml"; - //#endif private static GradeConfig _config; public static GradeConfig Config { diff --git a/WeighAndGrading/GradeFrom.cs b/WeighAndGrading/GradeFrom.cs index ab4d1f0..4b6cf0f 100644 --- a/WeighAndGrading/GradeFrom.cs +++ b/WeighAndGrading/GradeFrom.cs @@ -49,6 +49,7 @@ namespace WeighAndGrading List localTang, localMao; string maoFilePath, tangFilePath; + string discontPath = Path.Combine(DATA_PATH, "Disconts.xml"); bool connection = false; @@ -834,17 +835,16 @@ namespace WeighAndGrading Button disBtn = null; void BuildDiscontPanel(bool firstLoad) { - var fileName = Path.Combine(DATA_PATH, "Disconts.xml"); var disconts = new List(); if (!firstLoad) VerifyConnection(); if (connection) { disconts = GradeAndWeightRpc.GetBodyDiscontItem(); - XmlUtil.SerializerObjToFile(disconts, fileName); + XmlUtil.SerializerObjToFile(disconts, discontPath); } else - disconts = XmlUtil.DeserializeFromFile>(fileName); + disconts = XmlUtil.DeserializeFromFile>(discontPath); disconts = disconts.Where(x => x.Discont > 0).OrderBy(x => x.ID).ToList(); discontPanel.Controls.Clear(); @@ -974,7 +974,6 @@ namespace WeighAndGrading SaveEntityToLocal(tang); } - bool? last = null; void VerifyConnection() { @@ -1010,6 +1009,7 @@ namespace WeighAndGrading { SyncLocalMainFinish(ref localTang, true); SyncLocalMainFinish(ref localMao, false); + SyncDiscontToSever(); LocalGradeAndWeightBL.Sync(); } catch(Exception ex) { @@ -1020,5 +1020,20 @@ namespace WeighAndGrading Thread.Sleep(2000); } } + + void SyncDiscontToSever() + { + var changeFlagPath = Path.Combine(GradeFrom.DATA_PATH, "DiscontsChanged.txt"); + bool existFile = File.Exists(changeFlagPath); + if (existFile) + { + var list = XmlUtil.DeserializeFromFile>(discontPath); + var changes = new List>(); + foreach (var item in list) + changes.Add(new CTuple(item.ID, item.Discont)); + GradeAndWeightRpc.SaveBodyDiscontItem(changes); + File.Delete(changeFlagPath); + } + } } }