account_book_g2账册表中drug_id为字符型,优化菜单

This commit is contained in:
maqiao 2024-11-28 13:54:02 +08:00
parent 6d9955cfe5
commit 190e04b07b
13 changed files with 248 additions and 149 deletions

View File

@ -20,7 +20,7 @@ namespace DM_Weight.Models
/// 药品id
/// </summary>
[SugarColumn(ColumnName = "drug_id")]
public int DrugId { get; set; }
public string DrugId { get; set; }
/// <summary>
/// 1领入2发出3日结4总结5转结

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<ListBox> _selectionCommon;
public DelegateCommand<ListBox> SelectionCommon
//private DelegateCommand<ListBox> _selectionCommon;
//public DelegateCommand<ListBox> SelectionCommon
//{
// get => _selectionCommon ?? (_selectionCommon = new DelegateCommand<ListBox>(SelectionMethod));
//}
private DelegateCommand _selectionCommon;
public DelegateCommand SelectionCommon
{
get => _selectionCommon ?? (_selectionCommon = new DelegateCommand<ListBox>(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<PremissionDm> 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");

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -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<AccountBookG2>()
.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<AccountBookG2>()
.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,

View File

@ -26,7 +26,7 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Source="/Images/logo.png" />
<ListBox Name="ListBoxName" Grid.Column="1" ItemsSource="{Binding PremissionDmList}" HorizontalAlignment="Right" Cursor="Hand">
<ListBox Name="ListBoxName" Grid.Column="1" SelectedItem="{Binding SelectedMenu}" ItemsSource="{Binding PremissionDmList}" HorizontalAlignment="Right" Cursor="Hand">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SelectionCommon}" CommandParameter="{Binding ElementName=ListBoxName}"/>
@ -55,7 +55,11 @@
<materialDesign:Card Grid.Row="0">
<ListBox ItemsSource="{Binding SelectedMenu.Children}" SelectedItem="{ Binding SelectedChildMenu }" HorizontalAlignment="left" Cursor="Hand">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SelectionChildCommon}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" IsItemsHost="True"/>