修正错误

This commit is contained in:
gongxh
2022-05-05 20:42:02 +08:00
parent c6e7e582b8
commit b6b365339f
14 changed files with 28 additions and 57 deletions

View File

@@ -79,27 +79,6 @@ namespace CleanMachine.BLL.CM
#endregion #endregion
/// <summary>
/// 删除一个数据
/// </summary>
public bool Delete(string Key)
{
return new LastPattleNumDAL().Delete(Key);
}
/// <summary>
/// 获取一个对象
/// </summary>
public CleanMachine.Model.CM.LastPattleNum GetModel(string Key)
{
return new LastPattleNumDAL().GetModel(Key);
}
/// <summary>
/// 存在
/// </summary>
public bool Exists(string Key)
{
return new LastPattleNumDAL().Exists(Key);
}
/// <summary> /// <summary>

View File

@@ -102,30 +102,6 @@ namespace CleanMachine.DAL.CM
/// <summary>
/// 删除一个数据
/// </summary>
public bool Delete(string Key)
{
return this.Delete("Key=@Key ", new { Key }) ;
}
/// <summary>
/// 获取一个对象
/// </summary>
public CleanMachine.Model.CM.LastPattleNum GetModel(string Key)
{
return this.GetList("Key=@Key", new { Key }).QueryFirstOrDefault();
}
/// <summary>
/// 存在
/// </summary>
public bool Exists(string Key)
{
string strSql = @"SELECT count(1) from CM_LastPattleNum WHERE Key=@Key ";
return LeadDbHelperSQLite.ExecuteScalar<int>(strSql, new { Key }) > 0;
}
/// <summary> /// <summary>
/// 查询数据 /// 查询数据

View File

@@ -114,7 +114,7 @@ namespace CleanMachine.DAL.SYS
/// </summary> /// </summary>
public CleanMachine.Model.SYS.User GetModel(string UserCode) public CleanMachine.Model.SYS.User GetModel(string UserCode)
{ {
return this.GetList("USER_CODE=@UserCode", new { UserCode }).QueryFirstOrDefault(); return this.GetList("USER_CODE=@UserCode", new { UserCode }).FirstOrDefault();
} }

View File

@@ -1,4 +1,5 @@
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.CM;
using Krypton.Navigator; using Krypton.Navigator;
using Krypton.Toolkit; using Krypton.Toolkit;
using System; using System;

View File

@@ -12,6 +12,8 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.BAS;
namespace CleanMachineHMI.FrmUserControl namespace CleanMachineHMI.FrmUserControl
{ {
[FormType(EnumFormType.IoMonitor)] [FormType(EnumFormType.IoMonitor)]

View File

@@ -1,4 +1,5 @@
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.CM;
using CleanMachineHMI.Domain.Enums; using CleanMachineHMI.Domain.Enums;
using CleanMachineHMI.Utils; using CleanMachineHMI.Utils;
using Krypton.Toolkit; using Krypton.Toolkit;

View File

@@ -13,6 +13,8 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.BAS;
namespace CleanMachineHMI.FrmUserControl namespace CleanMachineHMI.FrmUserControl
{ {
[FormType(EnumFormType.PlcItemConfig)] [FormType(EnumFormType.PlcItemConfig)]

View File

@@ -1,4 +1,6 @@
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.BAS;
using CleanMachine.Model.CM;
using CleanMachineHMI.Domain.Enums; using CleanMachineHMI.Domain.Enums;
using CleanMachineHMI.Domain.Models.ViewModels; using CleanMachineHMI.Domain.Models.ViewModels;
using CleanMachineHMI.forms; using CleanMachineHMI.forms;

View File

@@ -24,13 +24,13 @@ namespace CleanMachineHMI
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern int RegisterWindowMessage(string lpString); private static extern int RegisterWindowMessage(string lpString);
private static bool hasKeyboard=false; private static bool hasKeyboard = false;
private static readonly string USB = "USB"; private static readonly string USB = "USB";
static KeyboardAutoPopUp() static KeyboardAutoPopUp()
{ {
// hasKeyboard = GetKeyboardPresent(); hasKeyboard = GetKeyboardPresent();

View File

@@ -2,7 +2,7 @@
#if DEBUG #if DEBUG
//#define USE_LOCAL_TCP_DEBUG #define USE_LOCAL_TCP_DEBUG
#endif #endif
//启用心跳检查 //启用心跳检查
@@ -10,6 +10,8 @@
#define UseHeartbeat #define UseHeartbeat
#endif #endif
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.BAS;
using CleanMachine.Model.CM;
using LeadDataBaseUtility; using LeadDataBaseUtility;
using NModbus; using NModbus;

View File

@@ -16,6 +16,8 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.BAS;
namespace CleanMachineHMI namespace CleanMachineHMI
{ {
//[FormType(EnumFormType.IoMonitor)] //[FormType(EnumFormType.IoMonitor)]

View File

@@ -10,6 +10,8 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.BAS;
namespace CleanMachineHMI namespace CleanMachineHMI
{ {
public partial class frmIoMonitorNew : KryptonForm public partial class frmIoMonitorNew : KryptonForm

View File

@@ -51,7 +51,7 @@ namespace CleanMachineHMI
return; return;
} }
// var sql = $@"SELECT A.USER_ID,A.USER_CODE,A.USER_NAME,A.SCHEDULE_CODE,A.USED_FLAG,A.DEL_FLAG,A.PASSWORD,B.ROLE_ID,B.ROLE_GRADE FROM SYS_USER A LEFT JOIN SYS_ROLE B ON A.ROLE_ID = B.ROLE_ID WHERE A.USER_CODE= '{txtAccount.Text}'"; var sql = $@"SELECT A.USER_ID,A.USER_CODE,A.USER_NAME,A.SCHEDULE_CODE,A.USED_FLAG,A.DEL_FLAG,A.PASSWORD,B.ROLE_ID,B.ROLE_GRADE FROM SYS_USER A LEFT JOIN SYS_ROLE B ON A.ROLE_ID = B.ROLE_ID WHERE A.USER_CODE= '{txtAccount.Text}'";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0]; DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt.Rows.Count > 0) if (dt.Rows.Count > 0)

View File

@@ -1,4 +1,6 @@
using CleanMachine.Model; using CleanMachine.Model;
using CleanMachine.Model.BAS;
using CleanMachine.Model.CM;
using CleanMachineHMI.Domain.Enums; using CleanMachineHMI.Domain.Enums;
using CleanMachineHMI.frmChild; using CleanMachineHMI.frmChild;
using CleanMachineHMI.FrmUserControl; using CleanMachineHMI.FrmUserControl;
@@ -374,7 +376,7 @@ namespace CleanMachineHMI
PlcItem md = PlcItemMdList.Find(x => x.PlcItemCode == item["PLC_ITEM_CODE"].ToString()); PlcItem md = PlcItemMdList.Find(x => x.PlcItemCode == item["PLC_ITEM_CODE"].ToString());
if (md != null) if (md != null)
{ {
md.PlcItemId = item["PLC_ITEM_ID"].ToString(); md.PlcItemId = int.Parse( item["PLC_ITEM_ID"].ToString());
md.PlcItemCode = item["PLC_ITEM_CODE"].ToString(); md.PlcItemCode = item["PLC_ITEM_CODE"].ToString();
md.PlcItemName = item["PLC_ITEM_NAME"].ToString(); md.PlcItemName = item["PLC_ITEM_NAME"].ToString();
md.PlcItemType = Convert.ToInt32(item["PLC_ITEM_TYPE"].ToString()); md.PlcItemType = Convert.ToInt32(item["PLC_ITEM_TYPE"].ToString());
@@ -388,7 +390,7 @@ namespace CleanMachineHMI
{ {
PlcItemMdList.Add(new PlcItem PlcItemMdList.Add(new PlcItem
{ {
PlcItemId = item["PLC_ITEM_ID"].ToString(), PlcItemId = int.Parse( item["PLC_ITEM_ID"].ToString()),
PlcItemCode = item["PLC_ITEM_CODE"].ToString(), PlcItemCode = item["PLC_ITEM_CODE"].ToString(),
PlcItemName = item["PLC_ITEM_NAME"].ToString(), PlcItemName = item["PLC_ITEM_NAME"].ToString(),
PlcItemType = Convert.ToInt32(item["PLC_ITEM_TYPE"].ToString()), PlcItemType = Convert.ToInt32(item["PLC_ITEM_TYPE"].ToString()),
@@ -405,7 +407,7 @@ namespace CleanMachineHMI
PlcItemMdList = new List<PlcItem>(); PlcItemMdList = new List<PlcItem>();
PlcItemMdList.Add(new PlcItem PlcItemMdList.Add(new PlcItem
{ {
PlcItemId = item["PLC_ITEM_ID"].ToString(), PlcItemId = int.Parse( item["PLC_ITEM_ID"].ToString()),
PlcItemCode = item["PLC_ITEM_CODE"].ToString(), PlcItemCode = item["PLC_ITEM_CODE"].ToString(),
PlcItemName = item["PLC_ITEM_NAME"].ToString(), PlcItemName = item["PLC_ITEM_NAME"].ToString(),
PlcItemType = Convert.ToInt32(item["PLC_ITEM_TYPE"].ToString()), PlcItemType = Convert.ToInt32(item["PLC_ITEM_TYPE"].ToString()),