This commit is contained in:
parent
0ae94e65ef
commit
5451dd490a
|
@ -3,7 +3,7 @@
|
|||
<connectionStrings>
|
||||
<!-- 数据库连接字符串 -->
|
||||
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
|
||||
<add name="database" connectionString="server=127.0.0.1;port=3306;database=hunanxianchang_db;userid=root;password=root;Pooling=false; ConnectionLifeTime=0;" />
|
||||
<add name="database" connectionString="server=127.0.0.1;port=3306;database=hunanxianchang_db;userid=root;password=root;SslMode=none;Command Timeout=61;" />
|
||||
</connectionStrings>
|
||||
<!--<runtime>
|
||||
--><!--配置之后,Appdomain.CurrentDomain.UnhandledException 事件的 IsTerminating 就变成了 false 啦!也就是说,程序并不会因为这次的异常而崩溃退出。--><!--
|
||||
|
|
|
@ -90,10 +90,10 @@ namespace DM_Weight
|
|||
foreach (Exception item in e.Exception.InnerExceptions)
|
||||
{
|
||||
logger.Error($"异常类型:{item.StackTrace};{item.GetType()}{Environment.NewLine}来自:{item.Source}{Environment.NewLine}异常内容:{item.Message}");
|
||||
if (item.GetType() == typeof(SqlSugar.SqlSugarException))
|
||||
{
|
||||
UserList userList = new UserService().CheckUserByFingerPrinter(1);
|
||||
}
|
||||
//if (item.GetType() == typeof(SqlSugar.SqlSugarException))
|
||||
//{
|
||||
// UserList userList = new UserService().CheckUserByFingerPrinter(1);
|
||||
//}
|
||||
}
|
||||
|
||||
//将异常标识为已经观察到
|
||||
|
|
|
@ -71,11 +71,9 @@
|
|||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2365.46" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
|
||||
<PackageReference Include="MySql.Data" Version="8.3.0" />
|
||||
<PackageReference Include="MySqlConnector" Version="2.3.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="Prism.Unity" Version="8.1.97" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.151" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.152" />
|
||||
<PackageReference Include="SuperSimpleTcp" Version="3.0.10" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||
<PackageReference Include="System.IO.Ports" Version="7.0.0" />
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace DM_Weight.Finger
|
|||
{
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(FingerprintUtil));
|
||||
public zkemkeeper.CZKEMClass axCZKEM1;// = new zkemkeeper.CZKEMClass();
|
||||
public zkemkeeper.CZKEMClass axCZKEM1= new zkemkeeper.CZKEMClass();
|
||||
public bool bIsConnected = false;
|
||||
|
||||
private string fingerIp = ConfigurationManager.AppSettings["fingerIp"]?.ToString() ?? "";
|
||||
|
@ -42,7 +42,7 @@ namespace DM_Weight.Finger
|
|||
{
|
||||
try
|
||||
{
|
||||
axCZKEM1 = new CZKEMClass();
|
||||
//axCZKEM1 = new CZKEMClass();
|
||||
bIsConnected = axCZKEM1.Connect_Net(fingerIp, fingerPort);
|
||||
logger.Info($"连接指纹机,IP:{fingerIp},端口:{fingerPort},机器号:{machineNumber},连接结果:{bIsConnected}");
|
||||
if (bIsConnected)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using DM_Weight.Models;
|
||||
using log4net;
|
||||
using log4net.Repository.Hierarchy;
|
||||
using MySql.Data.MySqlClient;
|
||||
//using MySql.Data.MySqlClient;
|
||||
//using MySql.Data.MySqlClient;
|
||||
//using MySqlConnector;
|
||||
using Newtonsoft.Json;
|
||||
|
@ -17,86 +17,86 @@ namespace DM_Weight.Services
|
|||
{
|
||||
public class UserService
|
||||
{
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(UserService));
|
||||
//public static string connStr = ConfigurationManager.AppSettings["database"].ToString();
|
||||
public static string connStr = ConfigurationManager.ConnectionStrings["database"].ToString();
|
||||
public UserList CheckUserByFingerPrinter(int fingerPrinterId)
|
||||
{
|
||||
UserList? user = null;
|
||||
//private readonly ILog logger = LogManager.GetLogger(typeof(UserService));
|
||||
////public static string connStr = ConfigurationManager.AppSettings["database"].ToString();
|
||||
//public static string connStr = ConfigurationManager.ConnectionStrings["database"].ToString();
|
||||
//public UserList CheckUserByFingerPrinter(int fingerPrinterId)
|
||||
//{
|
||||
// UserList? user = null;
|
||||
|
||||
using (MySqlConnection con = new MySqlConnection(connStr))
|
||||
{
|
||||
logger.Info($"connStr:{connStr}");
|
||||
try
|
||||
{
|
||||
con.Open();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
con.Close();
|
||||
logger.Info($"Open失败:{ex.ToString()};连接状态:{con.State}");
|
||||
logger.Info("再次Open");
|
||||
con.Open();
|
||||
}
|
||||
//connOpen(con);
|
||||
//Thread.Sleep(10);
|
||||
//while (con.State != System.Data.ConnectionState.Open)
|
||||
//{
|
||||
// logger.Info($"再次Open:{con.State}");
|
||||
// connOpen(con);
|
||||
// Thread.Sleep(10);
|
||||
//}
|
||||
// //using (MySqlConnection con = new MySqlConnection(connStr))
|
||||
// //{
|
||||
// // logger.Info($"connStr:{connStr}");
|
||||
// // try
|
||||
// // {
|
||||
// // con.Open();
|
||||
// // }
|
||||
// // catch (Exception ex)
|
||||
// // {
|
||||
// // con.Close();
|
||||
// // logger.Info($"Open失败:{ex.ToString()};连接状态:{con.State}");
|
||||
// // logger.Info("再次Open");
|
||||
// // con.Open();
|
||||
// // }
|
||||
// //connOpen(con);
|
||||
// //Thread.Sleep(10);
|
||||
// //while (con.State != System.Data.ConnectionState.Open)
|
||||
// //{
|
||||
// // logger.Info($"再次Open:{con.State}");
|
||||
// // connOpen(con);
|
||||
// // Thread.Sleep(10);
|
||||
// //}
|
||||
|
||||
logger.Info($"数据库连接状态{con.State}");
|
||||
//string sql = @"select ul.id as id,ul.User_name as userName,r.id,r.role_name,r.permissions,r.machine_id from user_list ul
|
||||
// INNER JOIN role r on ul.machine_role_id=r.id where ul.Id=@ID and ul.machine_id=@machine_id and r.machine_id=@machine_id;";
|
||||
//MySqlCommand cmd = new MySqlCommand(sql, con);
|
||||
//cmd.Parameters.Clear();
|
||||
//MySqlParameter[] mySqlParameter = new MySqlParameter[] { new MySqlParameter("ID", fingerPrinterId), new MySqlParameter("machine_id", (ConfigurationManager.AppSettings["machineId"] ?? "DM1")) };
|
||||
//cmd.Parameters.AddRange(mySqlParameter);
|
||||
////执行语句
|
||||
//MySqlDataReader reader = cmd.ExecuteReader();
|
||||
//logger.Info("MySqlDataReader读数据");
|
||||
//while (reader.Read())
|
||||
//{
|
||||
// user = new UserList();
|
||||
// user.Id = reader.GetInt32("id");
|
||||
// user.UserName = reader["userName"] is DBNull ? "" : reader.GetString("userName");
|
||||
// //user.UserName = reader["id"] is DBNull ? "" : reader.GetString("id");
|
||||
// user.Nickname = reader["userName"] is DBNull ? "" : reader.GetString("userName");
|
||||
// user.MachineId = reader["machine_id"] is DBNull ? "" : reader.GetString("machine_id");
|
||||
// RoleDm role = new RoleDm();
|
||||
// role.Id = reader.GetInt32("id");
|
||||
// //role.Permissions = reader["permissions"] is DBNull ? "" : reader.GetString("permissions");
|
||||
// role.RoleName = reader["role_name"] is DBNull ? "" : reader.GetString("role_name");
|
||||
// role.Permissions = JsonConvert.DeserializeObject<List<PremissionDm>>(reader["permissions"] is DBNull ? "" : reader.GetString("permissions")); // JsonConvert.SerializeObject(reader.GetString("permissions")).ToList();
|
||||
// user.Role = role;
|
||||
//}
|
||||
// //logger.Info($"数据库连接状态{con.State}");
|
||||
// //string sql = @"select ul.id as id,ul.User_name as userName,r.id,r.role_name,r.permissions,r.machine_id from user_list ul
|
||||
// // INNER JOIN role r on ul.machine_role_id=r.id where ul.Id=@ID and ul.machine_id=@machine_id and r.machine_id=@machine_id;";
|
||||
// //MySqlCommand cmd = new MySqlCommand(sql, con);
|
||||
// //cmd.Parameters.Clear();
|
||||
// //MySqlParameter[] mySqlParameter = new MySqlParameter[] { new MySqlParameter("ID", fingerPrinterId), new MySqlParameter("machine_id", (ConfigurationManager.AppSettings["machineId"] ?? "DM1")) };
|
||||
// //cmd.Parameters.AddRange(mySqlParameter);
|
||||
// ////执行语句
|
||||
// //MySqlDataReader reader = cmd.ExecuteReader();
|
||||
// //logger.Info("MySqlDataReader读数据");
|
||||
// //while (reader.Read())
|
||||
// //{
|
||||
// // user = new UserList();
|
||||
// // user.Id = reader.GetInt32("id");
|
||||
// // user.UserName = reader["userName"] is DBNull ? "" : reader.GetString("userName");
|
||||
// // //user.UserName = reader["id"] is DBNull ? "" : reader.GetString("id");
|
||||
// // user.Nickname = reader["userName"] is DBNull ? "" : reader.GetString("userName");
|
||||
// // user.MachineId = reader["machine_id"] is DBNull ? "" : reader.GetString("machine_id");
|
||||
// // RoleDm role = new RoleDm();
|
||||
// // role.Id = reader.GetInt32("id");
|
||||
// // //role.Permissions = reader["permissions"] is DBNull ? "" : reader.GetString("permissions");
|
||||
// // role.RoleName = reader["role_name"] is DBNull ? "" : reader.GetString("role_name");
|
||||
// // role.Permissions = JsonConvert.DeserializeObject<List<PremissionDm>>(reader["permissions"] is DBNull ? "" : reader.GetString("permissions")); // JsonConvert.SerializeObject(reader.GetString("permissions")).ToList();
|
||||
// // user.Role = role;
|
||||
// //}
|
||||
|
||||
//reader.Close();
|
||||
//logger.Info($"sql:{sql}");
|
||||
return user;
|
||||
}
|
||||
// //reader.Close();
|
||||
// //logger.Info($"sql:{sql}");
|
||||
// return user;
|
||||
// }
|
||||
|
||||
}
|
||||
private Task connOpen(MySqlConnection con)
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
if (con.State != System.Data.ConnectionState.Closed)
|
||||
{
|
||||
con.Close();
|
||||
}
|
||||
try
|
||||
{
|
||||
con.Open();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Info($"Open失败:{ex.Message}");
|
||||
}
|
||||
});
|
||||
}
|
||||
//}
|
||||
//private Task connOpen(MySqlConnection con)
|
||||
//{
|
||||
// return Task.Run(() =>
|
||||
// {
|
||||
// if (con.State != System.Data.ConnectionState.Closed)
|
||||
// {
|
||||
// con.Close();
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
// con.Open();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// logger.Info($"Open失败:{ex.Message}");
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -252,11 +252,13 @@ namespace DM_Weight.ViewModels
|
|||
Id = it.Id,
|
||||
DrugId= it.DrugId,
|
||||
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate,it.DrugId }).ExecuteCommand();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//如果批号重复则不让添加
|
||||
List<ChannelStock> csCount = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerNo == it.DrawerNo && cs.ManuNo == it.ManuNo && cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList();
|
||||
|
||||
if (csCount.Count > 0)
|
||||
{
|
||||
//repeatList.Add(it.ManuNo);
|
||||
|
@ -279,6 +281,8 @@ namespace DM_Weight.ViewModels
|
|||
Id = Guid.NewGuid().ToString(),
|
||||
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1"
|
||||
}).ExecuteCommand();
|
||||
|
||||
|
||||
}
|
||||
// 获取更新完库存后的药品库存
|
||||
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
|
@ -307,7 +311,8 @@ namespace DM_Weight.ViewModels
|
|||
}).ExecuteCommand();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
//ChannelStocks.Clear();
|
||||
if (stockRepeats.Count == record.Count)
|
||||
{
|
||||
|
@ -486,7 +491,9 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
//删除ChannelStock表中该批次数据
|
||||
int isOk = SqlSugarHelper.Db.Deleteable<ChannelStock>().Where(cs => cs.DrugId == cstock.DrugId && cs.ManuNo == cs.ManuNo).ExecuteCommand();
|
||||
if(isOk>0 )
|
||||
|
||||
|
||||
if (isOk>0 )
|
||||
{
|
||||
logger.Info($"删除{cstock.DrawerNo}-{cstock.ColNo}抽屉中药品{cstock.DrugId}下的批次{cstock.ManuNo},");
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
|
@ -519,6 +526,8 @@ namespace DM_Weight.ViewModels
|
|||
Is8Drawer = count < 9;
|
||||
Is16Drawer = count >= 16;
|
||||
Is17Drawer = count > 16;
|
||||
|
||||
|
||||
}
|
||||
|
||||
//这个方法用于拦截请求,continuationCallback(true)就是不拦截,continuationCallback(false)拦截本次操作
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
public class BindingChannelDialogViewModel : BindableBase, IDialogAware
|
||||
{
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(HomeWindowViewModel));
|
||||
public string Title => "库位绑定";
|
||||
|
||||
public event Action<IDialogResult> RequestClose;
|
||||
|
@ -112,6 +112,8 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
//DrugList = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).Where(di => di.PyCode.Contains(pycode)).OrderBy(di => di.DrugId).ToList();
|
||||
DrugList = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).Where(di => di.PyCode.Contains(pycode)).OrderBy(di => di.DrugId).ToList();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -212,7 +214,8 @@ namespace DM_Weight.ViewModels
|
|||
//var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
|
||||
var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
|
||||
DrugInfos = list;
|
||||
DrugInfos_PY = list;
|
||||
DrugInfos_PY = list;
|
||||
|
||||
}
|
||||
|
||||
private void GetChannelsByDrawerNo()
|
||||
|
@ -235,6 +238,7 @@ namespace DM_Weight.ViewModels
|
|||
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||
Channels = list;
|
||||
TotalCount = totalCount;
|
||||
|
||||
}
|
||||
public void OnDialogOpened(IDialogParameters parameters)
|
||||
{
|
||||
|
@ -269,6 +273,7 @@ namespace DM_Weight.ViewModels
|
|||
if (DrugInfo != null)
|
||||
{
|
||||
int count = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrugId.Equals(DrugInfo.DrugId.ToString())).Where(cs => cs.DrawerType != 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).Count();
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
var item = SelectChannels[0];
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
public class BindingChannelNewDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime
|
||||
{
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(HomeWindowViewModel));
|
||||
|
||||
public string Title => "库位绑定";
|
||||
|
||||
|
@ -145,6 +146,7 @@ namespace DM_Weight.ViewModels
|
|||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
||||
|
||||
return;
|
||||
}
|
||||
if (DrugInfos != null)
|
||||
|
@ -153,7 +155,7 @@ namespace DM_Weight.ViewModels
|
|||
}
|
||||
|
||||
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).Where(di => di.DrugName.Contains(text) || di.PyCode.Contains(text) || di.DrugId.Contains(text)).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
||||
|
||||
|
||||
}
|
||||
//private List<DrugInfo>? _drugInfos;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ using DM_Weight.msg;
|
|||
using DM_Weight.Port;
|
||||
using DM_Weight.Report;
|
||||
using DM_Weight.util;
|
||||
using log4net;
|
||||
using Prism.Commands;
|
||||
using Prism.Events;
|
||||
using Prism.Mvvm;
|
||||
|
@ -22,6 +23,8 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
public class CheckRecordDetailDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime
|
||||
{
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckRecordDetailDialogViewModel));
|
||||
|
||||
public string Title => "盘点记录明细";
|
||||
private int _pageNum = 1;
|
||||
public int PageNum
|
||||
|
@ -159,6 +162,7 @@ namespace DM_Weight.ViewModels
|
|||
List<CheckRecordStock> checkList = SqlSugarHelper.Db.Queryable<CheckRecordStock>()
|
||||
.Includes<DrugInfo>(cs => cs.DrugInfo)
|
||||
.Where(cs => cs.optdate == OptDate).OrderByDescending(cs => cs.optdate).ToList();
|
||||
|
||||
ICollectionView vw = CollectionViewSource.GetDefaultView(checkList);
|
||||
vw.GroupDescriptions.Add(new PropertyGroupDescription("DrugInfo"));
|
||||
obsCheckRecordStock = new ObservableCollection<CheckRecordStock>(checkList);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using DM_Weight.Port;
|
||||
using DM_Weight.Report;
|
||||
using DM_Weight.util;
|
||||
using log4net;
|
||||
using Prism.Commands;
|
||||
using Prism.Events;
|
||||
using Prism.Mvvm;
|
||||
|
@ -21,6 +22,8 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
public class CheckRecordNewWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
|
||||
{
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckRecordNewWindowViewModel));
|
||||
|
||||
private int _pageNum = 1;
|
||||
public int PageNum
|
||||
{
|
||||
|
@ -168,6 +171,7 @@ namespace DM_Weight.ViewModels
|
|||
OPTSTARTDATE = StartDate,
|
||||
OPTENDDATE = EndDate
|
||||
}).ToPageList(PageNum, PageSize, ref totalCount);
|
||||
|
||||
//SqlSugarHelper.Db.ThenMapper(checkList, item =>
|
||||
//{
|
||||
// //item.drugDetails = SqlSugarHelper.Db.Queryable<CheckRecordStock>().SetContext(x => x.optdate, () => item.optdate, item).ToList();
|
||||
|
|
|
@ -590,8 +590,8 @@ namespace DM_Weight.ViewModels
|
|||
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||
{
|
||||
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||
Task.Factory.StartNew(() => { RequestData(); });
|
||||
//RequestData();
|
||||
//Task.Factory.StartNew(() => { RequestData(); });
|
||||
RequestData();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -721,8 +721,6 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
ChannelStocks.Clear();
|
||||
|
||||
ChannelStocks.Clear();
|
||||
|
||||
List<ChannelStock> q = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
.Includes<DrugInfo>(cs => cs.DrugInfo)
|
||||
.InnerJoin<ChannelList>((cs, cl) => cs.Chnguid == cl.Id && cs.DrugId == cl.DrugId)
|
||||
|
@ -746,8 +744,8 @@ namespace DM_Weight.ViewModels
|
|||
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||
{
|
||||
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||
Task.Factory.StartNew(() => { RequestData(); });
|
||||
//RequestData();
|
||||
//Task.Factory.StartNew(() => { RequestData(); });
|
||||
RequestData();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -385,6 +385,7 @@ namespace DM_Weight.ViewModels
|
|||
|
||||
return cs;
|
||||
}).ToList();
|
||||
|
||||
//obChannelStock = new ObservableCollection<ChannelStock>(ChannelStocks);
|
||||
}
|
||||
|
||||
|
|
|
@ -382,6 +382,7 @@ namespace DM_Weight.ViewModels
|
|||
.OrderBy(cs => cs.EffDate)
|
||||
.ToList();
|
||||
ChannelStocks = queryData;
|
||||
|
||||
}
|
||||
|
||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||
|
|
|
@ -804,7 +804,7 @@ namespace DM_Weight.ViewModels
|
|||
.Select(it => new Invoice())
|
||||
.Select("*")
|
||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||
|
||||
|
||||
TotalCount = totalCount;
|
||||
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace DM_Weight.ViewModels
|
|||
|
||||
private int loginMode = Convert.ToInt32(ConfigurationManager.AppSettings["loginMode"]?.ToString() ?? "1");
|
||||
private string firstLogin = ConfigurationManager.AppSettings["firstLogin"]?.ToString() ?? "operator";
|
||||
|
||||
|
||||
public bool SingleLogin
|
||||
{
|
||||
get => ReadAppSetting("loginMode") == "1";
|
||||
|
@ -150,7 +150,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
|
||||
.Includes<RoleDm>(u => u.Role)
|
||||
.First(u => u.UserName == username && ConfigurationManager.AppSettings["machineId"].ToString().Equals(u.MachineId));
|
||||
|
||||
//UserList userList =new UserService().CheckUserByFingerPrinter(msg.Id);
|
||||
//UserList userList = SqlSugarHelper.Db.Queryable<UserList>()
|
||||
// .Includes<RoleDm>(u => u.Role)
|
||||
// .InnerJoin<RoleDm>((u, r) => u.RoleId == r.Id)
|
||||
|
@ -342,7 +342,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
UserList userList = SqlSugarHelper.Db.Queryable<UserList>()
|
||||
.Includes<RoleDm>(u => u.Role)
|
||||
.First(u => u.Id == msg.Id);
|
||||
|
||||
|
||||
//UserList userList = new UserService().CheckUserByFingerPrinter(msg.Id);
|
||||
|
||||
logger.Info($"userList是空?{userList == null}");
|
||||
|
@ -378,11 +378,11 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.Info($"LoginEvent存在异常:{e.Message}");
|
||||
if(e.GetType().Name== "SqlSugarException")
|
||||
{
|
||||
UserList userList = new UserService().CheckUserByFingerPrinter(1);
|
||||
}
|
||||
logger.Info($"LoginEvent存在异常:{e.Message};数据库连接字符串:{ConfigurationManager.ConnectionStrings["database"].ToString()}");
|
||||
//if(e.GetType().Name== "SqlSugarException")
|
||||
//{
|
||||
// UserList userList = new UserService().CheckUserByFingerPrinter(1);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ using DM_Weight.Port;
|
|||
using DM_Weight.select;
|
||||
using DM_Weight.util;
|
||||
using System.Threading;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
namespace DM_Weight.ViewModels
|
||||
{
|
||||
|
@ -171,6 +172,7 @@ namespace DM_Weight.ViewModels
|
|||
|
||||
public void RequestData()
|
||||
{
|
||||
//
|
||||
orderDetails = SqlSugarHelper.Db.Queryable<OrderDetail>()
|
||||
.Includes<DrugInfo>(od => od.DrugInfo)
|
||||
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (od, t) => od.DrugId == t.DrugId)
|
||||
|
@ -330,7 +332,7 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
string InvoiceId = OrderInfo.OrderNo;
|
||||
try
|
||||
{
|
||||
{
|
||||
SqlSugarHelper.Db.BeginTran();
|
||||
logger.Info($"更新OrderInfo:{InvoiceId}");
|
||||
SqlSugarHelper.Db.Updateable(new OrderInfo()
|
||||
|
@ -338,7 +340,9 @@ namespace DM_Weight.ViewModels
|
|||
DmStatus = 1,
|
||||
OrderNo = OrderInfo.OrderNo
|
||||
}).UpdateColumns(it => new { it.DmStatus }).WhereColumns(it => new { it.OrderNo }).ExecuteCommand();
|
||||
|
||||
logger.Info($"Task.Delay前:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")}");
|
||||
Task.Delay(4000).Wait();
|
||||
logger.Info($"Task.Delay后:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")}");
|
||||
logger.Info("进入record循环");
|
||||
for (int i = 0; i < record.Count; i++)
|
||||
{
|
||||
|
@ -389,8 +393,8 @@ namespace DM_Weight.ViewModels
|
|||
logger.Info("事务已提交");
|
||||
// 更新屏显库存
|
||||
//List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType != 1);
|
||||
Task.Run(() =>
|
||||
{
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
List<ChannelStock> singleChannels = record.Where(it => it.BoardType == 5)
|
||||
.GroupBy(it => new { it.DrawerNo, it.ColNo })
|
||||
.Select(it =>
|
||||
|
@ -439,7 +443,7 @@ namespace DM_Weight.ViewModels
|
|||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
});
|
||||
//});
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -451,7 +455,8 @@ namespace DM_Weight.ViewModels
|
|||
Message = "抽屉取药完成,库存更新失败!",
|
||||
Type = MsgType.ERROR,
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
_isFinishClick = false;
|
||||
}
|
||||
|
||||
//var f = SqlSugarHelper.Db.UseTran(() =>
|
||||
|
|
|
@ -225,6 +225,8 @@ namespace DM_Weight.ViewModels
|
|||
logger.Info("开始OrderTakeDrugWindowViewModel_查询数据");
|
||||
OrderInfos.Clear();
|
||||
int totalCount = 0;
|
||||
//logger.Info($"SqlSugarHelper.Db.Ado.Connection.GetHashCode():{_db.Ado.Connection.GetHashCode()}");
|
||||
|
||||
List<OrderInfo> queryData = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
||||
.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
||||
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
|
||||
|
@ -242,7 +244,7 @@ namespace DM_Weight.ViewModels
|
|||
OrderInfos = queryData;
|
||||
TotalCount = totalCount;
|
||||
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
|
||||
logger.Info($"_db.Ado.Connection.GetHashCode():{SqlSugarHelper.Db.Ado.Connection.GetHashCode()};{SqlSugarHelper.Db.Ado.GetHashCode()}");
|
||||
logger.Info("结束OrderTakeDrugWindowViewModel_查询数据");
|
||||
}
|
||||
|
||||
|
@ -251,8 +253,8 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
logger.Info("进入OrderTakeDrugWindowViewModel_OnNavigatedTo");
|
||||
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||
//RequestData();
|
||||
Task.Factory.StartNew(() => RequestData());
|
||||
RequestData();
|
||||
//Task.Factory.StartNew(() => RequestData());
|
||||
|
||||
logger.Info("结束OrderTakeDrugWindowViewModel_OnNavigatedTo");
|
||||
//Task t = new Task(() => { RequestData(); });
|
||||
|
|
|
@ -238,7 +238,8 @@ namespace DM_Weight.ViewModels
|
|||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||
{
|
||||
Task.Factory.StartNew(() => RequestData());
|
||||
//Task.Factory.StartNew(() => RequestData());
|
||||
RequestData();
|
||||
}
|
||||
|
||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||
|
|
|
@ -192,7 +192,8 @@ namespace DM_Weight.ViewModels
|
|||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||
{
|
||||
Task.Factory.StartNew(() => RequestData());
|
||||
//Task.Factory.StartNew(() => RequestData());
|
||||
RequestData();
|
||||
}
|
||||
|
||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||
|
|
|
@ -192,7 +192,8 @@ namespace DM_Weight.ViewModels
|
|||
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||
{
|
||||
logger.Info("进入SelfAddWindowViewModel_OnNavigatedTo");
|
||||
Task.Factory.StartNew(() => RequestChannelData());
|
||||
//Task.Factory.StartNew(() => RequestChannelData());
|
||||
RequestChannelData();
|
||||
logger.Info("结束SelfAddWindowViewModel_OnNavigatedTo");
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,48 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
public class SelfAddWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||
{
|
||||
private int _pageNum = 1;
|
||||
public int PageNum
|
||||
{
|
||||
get => _pageNum;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageNum, value);
|
||||
RequestChannelData();
|
||||
}
|
||||
}
|
||||
|
||||
private int _pageCount = 1;
|
||||
public int PageCount
|
||||
{
|
||||
get => _pageCount;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageCount, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int _pageSize = 3;
|
||||
public int PageSize
|
||||
{
|
||||
get => _pageSize;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageSize, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int _totalCount = 0;
|
||||
public int TotalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _totalCount, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IDialogService _dialogService;
|
||||
IEventAggregator _eventAggregator;
|
||||
|
||||
|
@ -210,24 +252,28 @@ namespace DM_Weight.ViewModels
|
|||
// .OrderBy(cs => cs.ColNo)
|
||||
// .ToList();
|
||||
//ChannelStocks = queryData;
|
||||
int totalCount = 0;
|
||||
List<DrugInfo> q = SqlSugarHelper.Db.Queryable<DrugInfo>()
|
||||
.Includes<ChannelStock>(di => di.channelStocks.Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
|
||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue))
|
||||
|
||||
.Where(di => di.channelStocks.Any(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null)).WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue))
|
||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue))
|
||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (cs) => cs.PyCode.Contains(SearchValue))
|
||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (cs) => cs.DrugBarcode.Contains(SearchValue))
|
||||
.Where(di => di.channelStocks.Any(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null))
|
||||
.OrderBy(cs => cs.DrugId)
|
||||
.ToList();
|
||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||
Drugs = q;
|
||||
TotalCount = totalCount;
|
||||
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
logger.Info("结束SelfAddWindowViewModel_查询数据");
|
||||
|
||||
}
|
||||
|
||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||
{
|
||||
logger.Info("进入SelfAddWindowViewModel_OnNavigatedTo");
|
||||
Task.Factory.StartNew(() => RequestChannelData());
|
||||
RequestChannelData();
|
||||
logger.Info("结束SelfAddWindowViewModel_OnNavigatedTo");
|
||||
}
|
||||
|
||||
|
|
|
@ -14,14 +14,59 @@ using DM_Weight.util;
|
|||
using DM_Weight.msg;
|
||||
using Prism.Events;
|
||||
using SqlSugar;
|
||||
using log4net;
|
||||
using System.Drawing.Printing;
|
||||
|
||||
namespace DM_Weight.ViewModels
|
||||
{
|
||||
public class SelfTakeDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||
{
|
||||
private int _pageNum = 1;
|
||||
public int PageNum
|
||||
{
|
||||
get => _pageNum;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageNum, value);
|
||||
RequestChannelData();
|
||||
}
|
||||
}
|
||||
|
||||
private int _pageCount = 1;
|
||||
public int PageCount
|
||||
{
|
||||
get => _pageCount;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageCount, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int _pageSize = 3;
|
||||
public int PageSize
|
||||
{
|
||||
get => _pageSize;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageSize, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int _totalCount = 0;
|
||||
public int TotalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _totalCount, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(SelfTakeDrugWindowViewModel));
|
||||
|
||||
IDialogService _dialogService;
|
||||
IEventAggregator _eventAggregator;
|
||||
|
||||
public static List<OrderTakeSelect> StaticSelects = new()
|
||||
{
|
||||
new OrderTakeSelect
|
||||
|
@ -49,7 +94,7 @@ namespace DM_Weight.ViewModels
|
|||
public SelfTakeDrugWindowViewModel(IDialogService DialogService, IEventAggregator eventAggregator, SqlSugarScope sqlSugarScope)
|
||||
{
|
||||
_dialogService = DialogService;
|
||||
_eventAggregator= eventAggregator;
|
||||
_eventAggregator = eventAggregator;
|
||||
//this.SqlSugarHelper.Db = sqlSugarScope;
|
||||
}
|
||||
|
||||
|
@ -195,6 +240,7 @@ namespace DM_Weight.ViewModels
|
|||
// .OrderBy(cs => cs.ColNo)
|
||||
// .ToList();
|
||||
//ChannelStocks = queryData;
|
||||
int totalCount = 0;
|
||||
List<DrugInfo> q = SqlSugarHelper.Db.Queryable<DrugInfo>()
|
||||
.Includes<ChannelStock>(di => di.channelStocks.Where(cs => cs.DrawerType == 1)
|
||||
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null&&cs.Quantity>0).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
|
||||
|
@ -202,11 +248,16 @@ namespace DM_Weight.ViewModels
|
|||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue))
|
||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (cs) => cs.PyCode.Contains(SearchValue))
|
||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (cs) => cs.DrugBarcode.Contains(SearchValue))
|
||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (cs) => cs.DrugBarcode.Contains(SearchValue))
|
||||
.Where(di => di.channelStocks.Any(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null))
|
||||
|
||||
.OrderBy(cs => cs.DrugId)
|
||||
.ToList();
|
||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||
//.ToList();
|
||||
Drugs = q.Where(di => di.channelStocks.Count() > 0).ToList();
|
||||
TotalCount = totalCount;
|
||||
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
logger.Info($"_db.Ado.Connection.GetHashCode():{SqlSugarHelper.Db.Ado.Connection.GetHashCode()};{SqlSugarHelper.Db.Ado.GetHashCode()}");
|
||||
}
|
||||
|
||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||
|
|
|
@ -25,6 +25,47 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
public class StockListWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||
{
|
||||
private int _pageNum = 1;
|
||||
public int PageNum
|
||||
{
|
||||
get => _pageNum;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageNum, value);
|
||||
RequestData();
|
||||
}
|
||||
}
|
||||
|
||||
private int _pageCount = 1;
|
||||
public int PageCount
|
||||
{
|
||||
get => _pageCount;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageCount, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int _pageSize = 3;
|
||||
public int PageSize
|
||||
{
|
||||
get => _pageSize;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _pageSize, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int _totalCount = 0;
|
||||
public int TotalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _totalCount, value);
|
||||
}
|
||||
}
|
||||
|
||||
//public static StockListWindowViewModel vm;
|
||||
public string drugId;
|
||||
public static List<OrderTakeSelect> StaticSelects = new()
|
||||
|
@ -240,7 +281,7 @@ namespace DM_Weight.ViewModels
|
|||
// .OrderBy(cs => cs.DrugId)
|
||||
// .ToList();
|
||||
//Drugs = q;
|
||||
|
||||
int totalCount = 0;
|
||||
List<DrugInfo> q = SqlSugarHelper.Db.Queryable<DrugInfo>()
|
||||
.Includes<ChannelStock>(di => di.channelStocks.Where(cs => cs.DrawerType == 1)
|
||||
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
|
||||
|
@ -250,9 +291,10 @@ namespace DM_Weight.ViewModels
|
|||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (cs) => cs.DrugBarcode.Contains(SearchValue))
|
||||
.Where(di => di.channelStocks.Any(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null))
|
||||
.OrderBy(cs => cs.DrugId)
|
||||
.ToList();
|
||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||
Drugs = q;
|
||||
|
||||
TotalCount = totalCount;
|
||||
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
logger.Info("结束StockListWindowViewModel_查询数据");
|
||||
}
|
||||
|
||||
|
@ -261,7 +303,7 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
logger.Info("进入StockListWindowViewModel_OnNavigatedTo");
|
||||
//RequestData();
|
||||
Task.Factory.StartNew(() => RequestData());
|
||||
RequestData();
|
||||
logger.Info("结束StockListWindowViewModel_OnNavigatedTo");
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@
|
|||
</materialDesign:Card>
|
||||
<StackPanel Orientation="Vertical" Grid.Row="3" Grid.Column="2">
|
||||
<TextBlock Visibility="{Binding DrawerPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="抽屉串口连接失败" />
|
||||
<TextBlock Visibility="{Binding CanBusPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="can总线串口连接失败" />
|
||||
<TextBlock Visibility="{Binding CanBusPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="can总线串口连接失败" />
|
||||
<TextBlock Visibility="{Binding FingerMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="指纹机连接失败" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
|
@ -20,6 +21,7 @@
|
|||
<convert:TotalCountConverter x:Key="TotalCountConverter" />
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
@ -254,7 +256,12 @@
|
|||
</ListView>
|
||||
|
||||
</Grid>-->
|
||||
|
||||
<pagination:Pagination Grid.Row="2"
|
||||
CurrentPage="{Binding PageNum}"
|
||||
PageSize="{Binding PageSize}"
|
||||
TotalPages="{Binding TotalCount}"
|
||||
InfoTextIsEnabel="True"
|
||||
/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
|
@ -22,6 +23,7 @@
|
|||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0 6 0 6" Grid.Row="0">
|
||||
|
@ -103,7 +105,9 @@
|
|||
<!--GroupStyle to group data-->
|
||||
<!--<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
--><!--Group DataItems into DataGroup--><!--
|
||||
-->
|
||||
<!--Group DataItems into DataGroup-->
|
||||
<!--
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
|
@ -187,6 +191,11 @@
|
|||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
<pagination:Pagination Grid.Row="2"
|
||||
CurrentPage="{Binding PageNum}"
|
||||
PageSize="{Binding PageSize}"
|
||||
TotalPages="{Binding TotalCount}"
|
||||
InfoTextIsEnabel="True"
|
||||
/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
mc:Ignorable="d"
|
||||
xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
|
@ -24,6 +25,7 @@
|
|||
<convert:TotalCountConverter x:Key="TotalCountConverter" />
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
@ -255,6 +257,12 @@
|
|||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>-->
|
||||
<pagination:Pagination Grid.Row="2"
|
||||
CurrentPage="{Binding PageNum}"
|
||||
PageSize="{Binding PageSize}"
|
||||
TotalPages="{Binding TotalCount}"
|
||||
InfoTextIsEnabel="True"
|
||||
/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace DM_Weight.util
|
|||
|
||||
ConnectionString = ConfigurationManager.ConnectionStrings["database"].ToString(),
|
||||
DbType = DbType.MySql,
|
||||
IsAutoCloseConnection = true
|
||||
IsAutoCloseConnection = false
|
||||
},
|
||||
db =>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue