diff --git a/DM_Weight/Models/AccountBookG2.cs b/DM_Weight/Models/AccountBookG2.cs index 2511025..74ede11 100644 --- a/DM_Weight/Models/AccountBookG2.cs +++ b/DM_Weight/Models/AccountBookG2.cs @@ -20,7 +20,7 @@ namespace DM_Weight.Models /// 药品id /// [SugarColumn(ColumnName = "drug_id")] - public int DrugId { get; set; } + public string DrugId { get; set; } /// /// 1领入2发出3日结4总结5转结 diff --git a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs index 32a3189..3386a2d 100644 --- a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs +++ b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs @@ -644,7 +644,7 @@ namespace DM_Weight.ViewModels int iInsertResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 1, Department = dept, OrderNo = SelectDrugPleaseClaim.PleaseNo, @@ -663,7 +663,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); @@ -676,7 +676,7 @@ namespace DM_Weight.ViewModels { //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type=3, ManuNo=it.ManuNo, EffDate=it.EffDate, @@ -699,7 +699,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -711,7 +711,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.AddQuantity, diff --git a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs index d341030..6bdcd5b 100644 --- a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs @@ -241,7 +241,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 1, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -259,7 +259,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -272,7 +272,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -294,7 +294,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -306,7 +306,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.AddQuantity, diff --git a/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs b/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs index 5ca8645..194d18f 100644 --- a/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs @@ -240,7 +240,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 2, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -258,7 +258,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -271,7 +271,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -293,7 +293,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -305,7 +305,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.TakeQuantity, diff --git a/DM_Weight/ViewModels/HomeWindowViewModel.cs b/DM_Weight/ViewModels/HomeWindowViewModel.cs index 394e605..ff05062 100644 --- a/DM_Weight/ViewModels/HomeWindowViewModel.cs +++ b/DM_Weight/ViewModels/HomeWindowViewModel.cs @@ -82,87 +82,87 @@ namespace DM_Weight.ViewModels get { return _selectedChildMenu; } set { - if (!_portUtil.Operate) - { - if (value != null) - { - if (value.PremissionPath.Equals("TakeRecordWindow")) - { - //定义传参变量 - NavigationParameters keys = new NavigationParameters(); + //if (!_portUtil.Operate) + //{ + // if (value != null) + // { + // if (value.PremissionPath.Equals("TakeRecordWindow")) + // { + // //定义传参变量 + // NavigationParameters keys = new NavigationParameters(); - //添加参数,键值对格式 - keys.Add("Type", 2); - _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); - } - else if (value.PremissionPath.Equals("AddRecordWindow")) - { - //定义传参变量 - NavigationParameters keys = new NavigationParameters(); + // //添加参数,键值对格式 + // keys.Add("Type", 2); + // _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + // } + // else if (value.PremissionPath.Equals("AddRecordWindow")) + // { + // //定义传参变量 + // NavigationParameters keys = new NavigationParameters(); - //添加参数,键值对格式 - keys.Add("Type", 1); - _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); - } - else if (value.PremissionPath.Equals("ReturnRecordWindow")) - { - //定义传参变量 - NavigationParameters keys = new NavigationParameters(); + // //添加参数,键值对格式 + // keys.Add("Type", 1); + // _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + // } + // else if (value.PremissionPath.Equals("ReturnRecordWindow")) + // { + // //定义传参变量 + // NavigationParameters keys = new NavigationParameters(); - //添加参数,键值对格式 - keys.Add("Type", 3); - _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); - } - else if (value.PremissionPath.Equals("RetrunEmptyRecordWindow")) - { - //定义传参变量 - NavigationParameters keys = new NavigationParameters(); + // //添加参数,键值对格式 + // keys.Add("Type", 3); + // _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + // } + // else if (value.PremissionPath.Equals("RetrunEmptyRecordWindow")) + // { + // //定义传参变量 + // NavigationParameters keys = new NavigationParameters(); - //添加参数,键值对格式 - keys.Add("Type", 3); - _regionManager.RequestNavigate("ContentRegion", value.PremissionPath, keys); - } - else if (value.PremissionPath.Equals("CheckRecordWindow")) - { - //定义传参变量 - NavigationParameters keys = new NavigationParameters(); + // //添加参数,键值对格式 + // keys.Add("Type", 3); + // _regionManager.RequestNavigate("ContentRegion", value.PremissionPath, keys); + // } + // else if (value.PremissionPath.Equals("CheckRecordWindow")) + // { + // //定义传参变量 + // NavigationParameters keys = new NavigationParameters(); - //添加参数,键值对格式 - keys.Add("Type", 4); - _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); - } - else - { - if (value.PremissionPath.Equals("ReturnDrugWindow") || value.PremissionPath.Equals("ReturnDrugWindow2")) - { - if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1")) - { - _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2"); - } - else - { - _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow"); - } - } - else if (value.PremissionPath.Equals("SettingMainWindow") || value.PremissionPath.Equals("SettingWindow")) - { - if (Convert.ToInt32(ConfigurationManager.AppSettings["hasFridge"])>0) - { - _regionManager.RequestNavigate("ContentRegion", "SettingMainWindow"); - } - else - { - _regionManager.RequestNavigate("ContentRegion", "SettingWindow"); - } - } - else - { - _regionManager.RequestNavigate("ContentRegion", value.PremissionPath); - } - } - } + // //添加参数,键值对格式 + // keys.Add("Type", 4); + // _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + // } + // else + // { + // if (value.PremissionPath.Equals("ReturnDrugWindow") || value.PremissionPath.Equals("ReturnDrugWindow2")) + // { + // if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1")) + // { + // _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2"); + // } + // else + // { + // _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow"); + // } + // } + // else if (value.PremissionPath.Equals("SettingMainWindow") || value.PremissionPath.Equals("SettingWindow")) + // { + // if (Convert.ToInt32(ConfigurationManager.AppSettings["hasFridge"])>0) + // { + // _regionManager.RequestNavigate("ContentRegion", "SettingMainWindow"); + // } + // else + // { + // _regionManager.RequestNavigate("ContentRegion", "SettingWindow"); + // } + // } + // else + // { + // _regionManager.RequestNavigate("ContentRegion", value.PremissionPath); + // } + // } + // } SetProperty(ref _selectedChildMenu, value); - } + //} } } @@ -196,39 +196,133 @@ namespace DM_Weight.ViewModels } } - private DelegateCommand _selectionCommon; - public DelegateCommand SelectionCommon + //private DelegateCommand _selectionCommon; + //public DelegateCommand SelectionCommon + //{ + // get => _selectionCommon ?? (_selectionCommon = new DelegateCommand(SelectionMethod)); + //} + private DelegateCommand _selectionCommon; + public DelegateCommand SelectionCommon { - get => _selectionCommon ?? (_selectionCommon = new DelegateCommand(SelectionMethod)); + get => _selectionCommon ?? (_selectionCommon = new DelegateCommand(SelectionMethod)); } - private void SelectionMethod(ListBox viewName) + private void SelectionMethod() { - SelectedMenu = viewName.SelectedItem as PremissionDm; - if (SelectedMenu.PremissionName == "退出") + logger.Info("开始进入父菜单"); + if (SelectedMenu != null && SelectedMenu.PremissionName == "退出") { - if (!_portUtil.Operate) - { - _chkFunction.HIKStopDVRRecord(); - logger.Info($"用户【{Operator?.Nickname}】退出登录"); - Operator = null; - Reviewer = null; - _regionManager.RequestNavigate("MainRegion", "LoginWindow"); - } - else - { - logger.Info($"未关闭抽屉操作退出"); - SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c")); - SnackbarMessageQueue.Enqueue("请关闭抽屉后再退出"); - return; - } + logger.Info($"用户【{Operator?.Nickname}】退出登录"); + Operator = null; + Reviewer = null; + _regionManager.RequestNavigate("MainRegion", "LoginWindow"); + _regionManager.RequestNavigate("MainRegion", "BeforeLogin"); } else { //SelectedMenu.Children = SelectedMenu.Children; SelectedChildMenu = SelectedMenu.Children[0]; + if (!_portUtil.Operate) + { + _regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath); + } + } + logger.Info("结束父菜单"); + } + #region + private DelegateCommand _selectionChildCommon; + public DelegateCommand SelectionChildCommon + { + get => _selectionChildCommon ?? (_selectionChildCommon = new DelegateCommand(SelectionChildMethod)); + } + private void SelectionChildMethod() + { + SelectChildNavigate(SelectedChildMenu); + } + private void SelectChildNavigate(PremissionDm SelectedChildMenu) + { + if (!_portUtil.Operate) + { + if (SelectedChildMenu != null) + { + if (SelectedChildMenu.PremissionPath.Equals("TakeRecordWindow")) + { + //定义传参变量 + NavigationParameters keys = new NavigationParameters(); + + //添加参数,键值对格式 + keys.Add("Type", 2); + _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + } + else if (SelectedChildMenu.PremissionPath.Equals("AddRecordWindow")) + { + //定义传参变量 + NavigationParameters keys = new NavigationParameters(); + + //添加参数,键值对格式 + keys.Add("Type", 1); + _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + } + else if (SelectedChildMenu.PremissionPath.Equals("ReturnRecordWindow")) + { + //定义传参变量 + NavigationParameters keys = new NavigationParameters(); + + //添加参数,键值对格式 + keys.Add("Type", 3); + _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + } + else if (SelectedChildMenu.PremissionPath.Equals("RetrunEmptyRecordWindow")) + { + //定义传参变量 + NavigationParameters keys = new NavigationParameters(); + + //添加参数,键值对格式 + keys.Add("Type", 3); + _regionManager.RequestNavigate("ContentRegion", SelectedChildMenu.PremissionPath, keys); + } + else if (SelectedChildMenu.PremissionPath.Equals("CheckRecordWindow")) + { + //定义传参变量 + NavigationParameters keys = new NavigationParameters(); + + //添加参数,键值对格式 + keys.Add("Type", 4); + _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys); + } + else + { + if (SelectedChildMenu.PremissionPath.Equals("ReturnDrugWindow") || SelectedChildMenu.PremissionPath.Equals("ReturnDrugWindow2")) + { + if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1")) + { + _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2"); + } + else + { + _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow"); + } + } + else if (SelectedChildMenu.PremissionPath.Equals("SettingMainWindow") || SelectedChildMenu.PremissionPath.Equals("SettingWindow")) + { + //if (Convert.ToInt32(ConfigurationManager.AppSettings["hasFridge"])>0) + //{ + // _regionManager.RequestNavigate("ContentRegion", "SettingMainWindow"); + //} + //else + { + _regionManager.RequestNavigate("ContentRegion", "SettingWindow"); + } + } + else + { + _regionManager.RequestNavigate("ContentRegion", SelectedChildMenu.PremissionPath); + } + } + } } } + #endregion public List PremissionDmList { get { return _premissionDmList; } set { SetProperty(ref _premissionDmList, value); } } public UserList UserList { get { return _userList; } set { SetProperty(ref _userList, value); } } @@ -438,6 +532,7 @@ namespace DM_Weight.ViewModels PremissionDmList = premissions; SelectedMenu = premissions[0]; SelectedChildMenu = premissions[0].Children[0]; + _regionManager.RequestNavigate("ContentRegion", premissions[0].Children[0].PremissionPath); FindDrawerCount(); int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0"); diff --git a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs index 328017b..db5b13d 100644 --- a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs @@ -283,7 +283,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 1, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -301,7 +301,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -314,7 +314,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -336,7 +336,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -348,7 +348,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.AddQuantity, diff --git a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs index d24ff07..5c32dbd 100644 --- a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs @@ -346,7 +346,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 2, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -364,7 +364,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -377,7 +377,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -399,7 +399,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -411,7 +411,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.TakeQuantity, diff --git a/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs b/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs index 03b8acc..22e2bdc 100644 --- a/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs +++ b/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs @@ -341,7 +341,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 1, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -359,7 +359,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -372,7 +372,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -394,7 +394,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -406,7 +406,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.ReturnQuantity, diff --git a/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs b/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs index 53f23c2..fdb3a11 100644 --- a/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs @@ -363,7 +363,7 @@ namespace DM_Weight.ViewModels //保存账册 int iInsertResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 2, Department = OrderInfo.DeptName, OrderNo = OrderInfo.OrderNo, @@ -382,7 +382,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -395,7 +395,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -417,7 +417,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -429,7 +429,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.TakeQuantity, diff --git a/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs b/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs index 4ddea6c..f629786 100644 --- a/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs +++ b/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs @@ -272,7 +272,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(ChannelStock.DrugId), + DrugId = ChannelStock.DrugId, Type = 1, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -290,7 +290,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(ChannelStock.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(ChannelStock.DrugId)) + .Where(ab => ab.DrugId == ChannelStock.DrugId) .Where(ab => ab.ManuNo == ChannelStock.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -303,7 +303,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(ChannelStock.DrugId), + DrugId = ChannelStock.DrugId, Type = 3, ManuNo = ChannelStock.ManuNo, EffDate = ChannelStock.EffDate, @@ -325,7 +325,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(ChannelStock.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(ChannelStock.DrugId)) + .Where(ab => ab.DrugId == ChannelStock.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -337,7 +337,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(ChannelStock.DrugId), + DrugId = ChannelStock.DrugId, Type = 4, YQuantity = 0, ManuStock = ChannelStock.ReturnQuantity, diff --git a/DM_Weight/ViewModels/SelfAddDialogViewModel.cs b/DM_Weight/ViewModels/SelfAddDialogViewModel.cs index 53b7f78..4f78978 100644 --- a/DM_Weight/ViewModels/SelfAddDialogViewModel.cs +++ b/DM_Weight/ViewModels/SelfAddDialogViewModel.cs @@ -272,7 +272,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 1, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -290,7 +290,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -303,7 +303,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -325,7 +325,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -338,7 +338,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.AddQuantity, diff --git a/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs b/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs index 3e474a5..05584f2 100644 --- a/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs @@ -249,7 +249,7 @@ namespace DM_Weight.ViewModels //保存账册 SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 2, Department = ConfigurationManager.AppSettings["department"].ToString(), InvoiceNo = InvoiceId, @@ -267,7 +267,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 3) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.ManuNo == it.ManuNo) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Day != null) @@ -280,7 +280,7 @@ namespace DM_Weight.ViewModels //生成日结存时可能没有该库位的绑定信息,需要写入日结存 int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 3, ManuNo = it.ManuNo, EffDate = it.EffDate, @@ -302,7 +302,7 @@ namespace DM_Weight.ViewModels AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() .Where(ab => ab.MachineId.Equals(it.MachineId)) .Where(ab => ab.Type == 4) - .Where(ab => ab.DrugId == Convert.ToInt32(it.DrugId)) + .Where(ab => ab.DrugId == it.DrugId) .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); if (accountBookG2Total != null) { @@ -314,7 +314,7 @@ namespace DM_Weight.ViewModels //生成总结存时可能没有该库位的绑定信息,需要写入总结存 int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() { - DrugId = Convert.ToInt32(it.DrugId), + DrugId = it.DrugId, Type = 4, YQuantity = 0, ManuStock = it.TakeQuantity, diff --git a/DM_Weight/Views/HomeWindow.xaml b/DM_Weight/Views/HomeWindow.xaml index 9dd3b52..5005b78 100644 --- a/DM_Weight/Views/HomeWindow.xaml +++ b/DM_Weight/Views/HomeWindow.xaml @@ -26,7 +26,7 @@ - + @@ -55,7 +55,11 @@ - + + + + +