diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs index 04f5244..05fcfb3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Reflection; -using System.Text; namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { @@ -14,12 +12,14 @@ public String getNameByCode(string codeType,string code) { String name = ""; + MySqlConnection conn = null; try { string sql = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "') and code = " + code; - - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + + conn = DbConnectService.getConnection(); + MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); @@ -35,6 +35,7 @@ } } + aReader.Close(); cmd.Dispose(); return name; } @@ -42,6 +43,14 @@ { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getNameByCode: " + ex.Message); name = ""; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } } return name; } @@ -49,16 +58,13 @@ public List getTypeListByCodeType(string codeType) { List nameList = new List(); + MySqlConnection conn = null; try { - if (DbConnectService.mySqlConnect.State == ConnectionState.Closed) - { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType : 数据库链接断开"); - return null; - } + conn = DbConnectService.getConnection(); string sQry = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "')"; - MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + MySqlCommand aCommand = new MySqlCommand(sQry, conn); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { @@ -69,6 +75,8 @@ } aCommand.Dispose(); + conn.Close(); + conn.Dispose(); // 用完即关闭连接 } } catch(MySqlException ex) @@ -76,10 +84,16 @@ LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType: " + ex.Message); nameList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } + } return nameList; } - - } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs index 04f5244..05fcfb3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Reflection; -using System.Text; namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { @@ -14,12 +12,14 @@ public String getNameByCode(string codeType,string code) { String name = ""; + MySqlConnection conn = null; try { string sql = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "') and code = " + code; - - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + + conn = DbConnectService.getConnection(); + MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); @@ -35,6 +35,7 @@ } } + aReader.Close(); cmd.Dispose(); return name; } @@ -42,6 +43,14 @@ { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getNameByCode: " + ex.Message); name = ""; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } } return name; } @@ -49,16 +58,13 @@ public List getTypeListByCodeType(string codeType) { List nameList = new List(); + MySqlConnection conn = null; try { - if (DbConnectService.mySqlConnect.State == ConnectionState.Closed) - { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType : 数据库链接断开"); - return null; - } + conn = DbConnectService.getConnection(); string sQry = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "')"; - MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + MySqlCommand aCommand = new MySqlCommand(sQry, conn); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { @@ -69,6 +75,8 @@ } aCommand.Dispose(); + conn.Close(); + conn.Dispose(); // 用完即关闭连接 } } catch(MySqlException ex) @@ -76,10 +84,16 @@ LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType: " + ex.Message); nameList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } + } return nameList; } - - } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 271e20a..472a36a 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -447,7 +447,6 @@ devTestDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 devTestDlg.ShowDialog(); } - } private void tableChannel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs index 04f5244..05fcfb3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Reflection; -using System.Text; namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { @@ -14,12 +12,14 @@ public String getNameByCode(string codeType,string code) { String name = ""; + MySqlConnection conn = null; try { string sql = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "') and code = " + code; - - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + + conn = DbConnectService.getConnection(); + MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); @@ -35,6 +35,7 @@ } } + aReader.Close(); cmd.Dispose(); return name; } @@ -42,6 +43,14 @@ { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getNameByCode: " + ex.Message); name = ""; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } } return name; } @@ -49,16 +58,13 @@ public List getTypeListByCodeType(string codeType) { List nameList = new List(); + MySqlConnection conn = null; try { - if (DbConnectService.mySqlConnect.State == ConnectionState.Closed) - { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType : 数据库链接断开"); - return null; - } + conn = DbConnectService.getConnection(); string sQry = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "')"; - MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + MySqlCommand aCommand = new MySqlCommand(sQry, conn); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { @@ -69,6 +75,8 @@ } aCommand.Dispose(); + conn.Close(); + conn.Dispose(); // 用完即关闭连接 } } catch(MySqlException ex) @@ -76,10 +84,16 @@ LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType: " + ex.Message); nameList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } + } return nameList; } - - } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 271e20a..472a36a 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -447,7 +447,6 @@ devTestDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 devTestDlg.ShowDialog(); } - } private void tableChannel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index fee0aae..b6b9993 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -29,174 +29,692 @@ /// private void InitializeComponent() { - this.btnAddDevCancel = new DevComponents.DotNetBar.ButtonX(); - this.buttonX1 = new DevComponents.DotNetBar.ButtonX(); - this.labelX3 = new DevComponents.DotNetBar.LabelX(); - this.labelX4 = new DevComponents.DotNetBar.LabelX(); - this.labelX2 = new DevComponents.DotNetBar.LabelX(); - this.labelX1 = new DevComponents.DotNetBar.LabelX(); - this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX3 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX4 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label6 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.endTimeEst = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.checkBox10 = new System.Windows.Forms.CheckBox(); + this.checkBox11 = new System.Windows.Forms.CheckBox(); + this.checkBox12 = new System.Windows.Forms.CheckBox(); + this.checkBox13 = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.inputDevName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label8 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnExitDev = new System.Windows.Forms.Button(); + this.labelTitle = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.channelFree = new DevComponents.DotNetBar.Controls.ComboBoxEx(); + this.channel1 = new DevComponents.Editors.ComboItem(); + this.channel2 = new DevComponents.Editors.ComboItem(); + this.channel3 = new DevComponents.Editors.ComboItem(); + this.channel4 = new DevComponents.Editors.ComboItem(); + this.channel5 = new DevComponents.Editors.ComboItem(); + this.label4 = new System.Windows.Forms.Label(); + this.inputCustName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label2 = new System.Windows.Forms.Label(); + this.inputCustComp = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevModel = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label1 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.inputDevCode = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.panel4.SuspendLayout(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).BeginInit(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // - // btnAddDevCancel + // checkBox9 // - this.btnAddDevCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnAddDevCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnAddDevCancel.Location = new System.Drawing.Point(216, 228); - this.btnAddDevCancel.Name = "btnAddDevCancel"; - this.btnAddDevCancel.Size = new System.Drawing.Size(75, 23); - this.btnAddDevCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnAddDevCancel.TabIndex = 8; - this.btnAddDevCancel.Text = "取消"; - this.btnAddDevCancel.Click += new System.EventHandler(this.btnAddDevCancel_Click); + this.checkBox9.AutoSize = true; + this.checkBox9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox9.Location = new System.Drawing.Point(506, 348); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(84, 24); + this.checkBox9.TabIndex = 19; + this.checkBox9.Text = "立即开始"; + this.checkBox9.UseVisualStyleBackColor = true; // - // buttonX1 + // btnSave // - this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.buttonX1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.buttonX1.Location = new System.Drawing.Point(108, 228); - this.buttonX1.Name = "buttonX1"; - this.buttonX1.Size = new System.Drawing.Size(75, 23); - this.buttonX1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.buttonX1.TabIndex = 9; - this.buttonX1.Text = "添加"; + this.btnSave.EnterBackColor = System.Drawing.Color.Blue; + this.btnSave.EnterForeColor = System.Drawing.Color.White; + this.btnSave.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnSave.FlatAppearance.BorderSize = 0; + this.btnSave.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSave.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(47)))), ((int)(((byte)(111)))), ((int)(((byte)(198))))); + this.btnSave.HoverForeColor = System.Drawing.Color.White; + this.btnSave.Location = new System.Drawing.Point(150, 342); + this.btnSave.Name = "btnSave"; + this.btnSave.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnSave.PressForeColor = System.Drawing.Color.White; + this.btnSave.Radius = 5; + this.btnSave.Size = new System.Drawing.Size(120, 30); + this.btnSave.TabIndex = 17; + this.btnSave.Text = "开始检测"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // labelX3 + // label6 + // + this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(0, 10); + this.label6.Margin = new System.Windows.Forms.Padding(0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 27); + this.label6.TabIndex = 38; + this.label6.Text = "频率稳定度"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox1.Location = new System.Drawing.Point(420, 12); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(60, 24); + this.checkBox1.TabIndex = 16; + this.checkBox1.Text = "100S"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox2.Location = new System.Drawing.Point(326, 12); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(52, 24); + this.checkBox2.TabIndex = 15; + this.checkBox2.Text = "20S"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox3.Location = new System.Drawing.Point(218, 12); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(52, 24); + this.checkBox3.TabIndex = 14; + this.checkBox3.Text = "10S"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox4.Location = new System.Drawing.Point(110, 12); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(44, 24); + this.checkBox4.TabIndex = 13; + this.checkBox4.Text = "1S"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // btnCancelSetDev + // + this.btnCancelSetDev.EnterBackColor = System.Drawing.Color.Blue; + this.btnCancelSetDev.EnterForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnCancelSetDev.FlatAppearance.BorderSize = 0; + this.btnCancelSetDev.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCancelSetDev.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCancelSetDev.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnCancelSetDev.HoverForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Location = new System.Drawing.Point(310, 342); + this.btnCancelSetDev.Name = "btnCancelSetDev"; + this.btnCancelSetDev.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnCancelSetDev.PressForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Radius = 5; + this.btnCancelSetDev.Size = new System.Drawing.Size(120, 30); + this.btnCancelSetDev.TabIndex = 18; + this.btnCancelSetDev.Text = "取消"; + this.btnCancelSetDev.UseVisualStyleBackColor = true; + this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // panel4 + // + this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel4.Controls.Add(this.label6); + this.panel4.Controls.Add(this.checkBox1); + this.panel4.Controls.Add(this.checkBox2); + this.panel4.Controls.Add(this.checkBox3); + this.panel4.Controls.Add(this.checkBox4); + this.panel4.Location = new System.Drawing.Point(10, 265); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(580, 47); + this.panel4.TabIndex = 21; + // + // panel3 + // + this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel3.Controls.Add(this.endTimeEst); + this.panel3.Controls.Add(this.startTime); + this.panel3.Controls.Add(this.checkBox10); + this.panel3.Controls.Add(this.checkBox11); + this.panel3.Controls.Add(this.checkBox12); + this.panel3.Controls.Add(this.checkBox13); + this.panel3.Controls.Add(this.label3); + this.panel3.Controls.Add(this.label12); + this.panel3.Controls.Add(this.label13); + this.panel3.Location = new System.Drawing.Point(10, 171); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(580, 84); + this.panel3.TabIndex = 20; + // + // endTimeEst // // // // - this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX3.Location = new System.Drawing.Point(60, 166); - this.labelX3.Name = "labelX3"; - this.labelX3.Size = new System.Drawing.Size(75, 23); - this.labelX3.TabIndex = 3; - this.labelX3.Text = "客户单位"; - // - // labelX4 + this.endTimeEst.BackgroundStyle.Class = "DateTimeInputBackground"; + this.endTimeEst.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.endTimeEst.ButtonDropDown.Visible = true; + this.endTimeEst.CustomFormat = "yyyy-MM-dd HH:mm"; + this.endTimeEst.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.endTimeEst.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.endTimeEst.IsPopupCalendarOpen = false; + this.endTimeEst.Location = new System.Drawing.Point(390, 49); // // // // - this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX4.Location = new System.Drawing.Point(60, 121); - this.labelX4.Name = "labelX4"; - this.labelX4.Size = new System.Drawing.Size(75, 23); - this.labelX4.TabIndex = 4; - this.labelX4.Text = "仪器名称"; // - // labelX2 + // + this.endTimeEst.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.endTimeEst.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.endTimeEst.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.TodayButtonVisible = true; + this.endTimeEst.Name = "endTimeEst"; + this.endTimeEst.ShowUpDown = true; + this.endTimeEst.Size = new System.Drawing.Size(180, 23); + this.endTimeEst.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.endTimeEst.TabIndex = 12; + this.endTimeEst.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // startTime // // // // - this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX2.Location = new System.Drawing.Point(60, 79); - this.labelX2.Name = "labelX2"; - this.labelX2.Size = new System.Drawing.Size(75, 23); - this.labelX2.TabIndex = 5; - this.labelX2.Text = "仪器编号"; - // - // labelX1 + this.startTime.BackgroundStyle.Class = "DateTimeInputBackground"; + this.startTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.startTime.ButtonDropDown.Visible = true; + this.startTime.CustomFormat = "yyyy-MM-dd HH:mm"; + this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.startTime.IsPopupCalendarOpen = false; + this.startTime.Location = new System.Drawing.Point(110, 49); // // // // - this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX1.Location = new System.Drawing.Point(60, 35); - this.labelX1.Name = "labelX1"; - this.labelX1.Size = new System.Drawing.Size(75, 23); - this.labelX1.TabIndex = 7; - this.labelX1.Text = "仪器型号"; // - // textBoxX1 + // + this.startTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.startTime.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.startTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.startTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.startTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.TodayButtonVisible = true; + this.startTime.Name = "startTime"; + this.startTime.ShowUpDown = true; + this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.startTime.TabIndex = 11; + this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // checkBox10 + // + this.checkBox10.AutoSize = true; + this.checkBox10.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox10.Location = new System.Drawing.Point(420, 12); + this.checkBox10.Name = "checkBox10"; + this.checkBox10.Size = new System.Drawing.Size(84, 24); + this.checkBox10.TabIndex = 10; + this.checkBox10.Text = "日老化率"; + this.checkBox10.UseVisualStyleBackColor = true; + // + // checkBox11 + // + this.checkBox11.AutoSize = true; + this.checkBox11.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox11.Location = new System.Drawing.Point(326, 12); + this.checkBox11.Name = "checkBox11"; + this.checkBox11.Size = new System.Drawing.Size(84, 24); + this.checkBox11.TabIndex = 9; + this.checkBox11.Text = "开机特性"; + this.checkBox11.UseVisualStyleBackColor = true; + // + // checkBox12 + // + this.checkBox12.AutoSize = true; + this.checkBox12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox12.Location = new System.Drawing.Point(218, 12); + this.checkBox12.Name = "checkBox12"; + this.checkBox12.Size = new System.Drawing.Size(98, 24); + this.checkBox12.TabIndex = 8; + this.checkBox12.Text = "频率准确度"; + this.checkBox12.UseVisualStyleBackColor = true; + // + // checkBox13 + // + this.checkBox13.AutoSize = true; + this.checkBox13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox13.Location = new System.Drawing.Point(110, 12); + this.checkBox13.Name = "checkBox13"; + this.checkBox13.Size = new System.Drawing.Size(98, 24); + this.checkBox13.TabIndex = 7; + this.checkBox13.Text = "频率稳定度"; + this.checkBox13.UseVisualStyleBackColor = true; + // + // label3 + // + this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(280, 47); + this.label3.Margin = new System.Windows.Forms.Padding(0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(100, 27); + this.label3.TabIndex = 8; + this.label3.Text = "预计结束时间"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label12 + // + this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(0, 47); + this.label12.Margin = new System.Windows.Forms.Padding(0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(100, 27); + this.label12.TabIndex = 37; + this.label12.Text = "测量开始时间"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label13 + // + this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label13.Location = new System.Drawing.Point(0, 10); + this.label13.Margin = new System.Windows.Forms.Padding(0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(100, 27); + this.label13.TabIndex = 36; + this.label13.Text = "检测项目"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevName // // // // - this.textBoxX1.Border.Class = "TextBoxBorder"; - this.textBoxX1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX1.Location = new System.Drawing.Point(152, 35); - this.textBoxX1.Name = "textBoxX1"; - this.textBoxX1.PreventEnterBeep = true; - this.textBoxX1.Size = new System.Drawing.Size(100, 21); - this.textBoxX1.TabIndex = 10; + this.inputDevName.Border.Class = "TextBoxBorder"; + this.inputDevName.Border.CornerDiameter = 5; + this.inputDevName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevName.Location = new System.Drawing.Point(110, 10); + this.inputDevName.Margin = new System.Windows.Forms.Padding(0); + this.inputDevName.Name = "inputDevName"; + this.inputDevName.PreventEnterBeep = true; + this.inputDevName.Size = new System.Drawing.Size(150, 27); + this.inputDevName.TabIndex = 1; // - // textBoxX2 + // label8 + // + this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label8.Location = new System.Drawing.Point(290, 10); + this.label8.Margin = new System.Windows.Forms.Padding(0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(100, 27); + this.label8.TabIndex = 31; + this.label8.Text = "仪器编号"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label5 + // + this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label5.Location = new System.Drawing.Point(0, 10); + this.label5.Margin = new System.Windows.Forms.Padding(0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 27); + this.label5.TabIndex = 30; + this.label5.Text = "仪器名称"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.btnExitDev); + this.panel1.Controls.Add(this.labelTitle); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(600, 32); + this.panel1.TabIndex = 18; + this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + // + // btnExitDev + // + this.btnExitDev.BackColor = System.Drawing.Color.Transparent; + this.btnExitDev.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitDev.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitDev.FlatAppearance.BorderSize = 0; + this.btnExitDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitDev.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitDev.Location = new System.Drawing.Point(570, 5); + this.btnExitDev.Margin = new System.Windows.Forms.Padding(0); + this.btnExitDev.Name = "btnExitDev"; + this.btnExitDev.Size = new System.Drawing.Size(20, 20); + this.btnExitDev.TabIndex = 2; + this.btnExitDev.UseVisualStyleBackColor = false; + this.btnExitDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // labelTitle + // + this.labelTitle.BackColor = System.Drawing.Color.Transparent; + this.labelTitle.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelTitle.ForeColor = System.Drawing.Color.White; + this.labelTitle.Location = new System.Drawing.Point(10, 5); + this.labelTitle.Name = "labelTitle"; + this.labelTitle.Size = new System.Drawing.Size(155, 23); + this.labelTitle.TabIndex = 0; + this.labelTitle.Text = "添加送检仪器"; + // + // panel2 + // + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.channelFree); + this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.inputCustName); + this.panel2.Controls.Add(this.label2); + this.panel2.Controls.Add(this.inputCustComp); + this.panel2.Controls.Add(this.inputDevModel); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.label9); + this.panel2.Controls.Add(this.inputDevCode); + this.panel2.Controls.Add(this.inputDevName); + this.panel2.Controls.Add(this.label8); + this.panel2.Controls.Add(this.label5); + this.panel2.Location = new System.Drawing.Point(10, 40); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(580, 121); + this.panel2.TabIndex = 19; + // + // channelFree + // + this.channelFree.DisplayMember = "Text"; + this.channelFree.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.channelFree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.channelFree.FormattingEnabled = true; + this.channelFree.ItemHeight = 18; + this.channelFree.Items.AddRange(new object[] { + this.channel1, + this.channel2, + this.channel3, + this.channel4, + this.channel5}); + this.channelFree.Location = new System.Drawing.Point(400, 87); + this.channelFree.Name = "channelFree"; + this.channelFree.Size = new System.Drawing.Size(150, 24); + this.channelFree.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.channelFree.TabIndex = 6; + // + // channel1 + // + this.channel1.Text = "通道1"; + this.channel1.Value = "1"; + // + // channel2 + // + this.channel2.Text = "通道2"; + this.channel2.Value = "2"; + // + // channel3 + // + this.channel3.Text = "通道3"; + this.channel3.Value = "3"; + // + // channel4 + // + this.channel4.Text = "通道4"; + this.channel4.Value = "4"; + // + // channel5 + // + this.channel5.Text = "通道5"; + this.channel5.Value = "5"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(290, 84); + this.label4.Margin = new System.Windows.Forms.Padding(0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 27); + this.label4.TabIndex = 35; + this.label4.Text = "选择通道"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustName // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX2.Location = new System.Drawing.Point(152, 79); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.Size = new System.Drawing.Size(100, 21); - this.textBoxX2.TabIndex = 10; + this.inputCustName.Border.Class = "TextBoxBorder"; + this.inputCustName.Border.CornerDiameter = 5; + this.inputCustName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustName.Location = new System.Drawing.Point(110, 84); + this.inputCustName.Margin = new System.Windows.Forms.Padding(0); + this.inputCustName.Name = "inputCustName"; + this.inputCustName.PreventEnterBeep = true; + this.inputCustName.Size = new System.Drawing.Size(150, 27); + this.inputCustName.TabIndex = 5; // - // textBoxX3 + // label2 + // + this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(0, 84); + this.label2.Margin = new System.Windows.Forms.Padding(0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(100, 27); + this.label2.TabIndex = 34; + this.label2.Text = "联系人"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustComp // // // // - this.textBoxX3.Border.Class = "TextBoxBorder"; - this.textBoxX3.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX3.Location = new System.Drawing.Point(152, 121); - this.textBoxX3.Name = "textBoxX3"; - this.textBoxX3.PreventEnterBeep = true; - this.textBoxX3.Size = new System.Drawing.Size(100, 21); - this.textBoxX3.TabIndex = 10; + this.inputCustComp.Border.Class = "TextBoxBorder"; + this.inputCustComp.Border.CornerDiameter = 5; + this.inputCustComp.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustComp.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustComp.Location = new System.Drawing.Point(400, 47); + this.inputCustComp.Margin = new System.Windows.Forms.Padding(0); + this.inputCustComp.Name = "inputCustComp"; + this.inputCustComp.PreventEnterBeep = true; + this.inputCustComp.Size = new System.Drawing.Size(150, 27); + this.inputCustComp.TabIndex = 4; // - // textBoxX4 + // inputDevModel // // // // - this.textBoxX4.Border.Class = "TextBoxBorder"; - this.textBoxX4.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX4.Location = new System.Drawing.Point(152, 166); - this.textBoxX4.Name = "textBoxX4"; - this.textBoxX4.PreventEnterBeep = true; - this.textBoxX4.Size = new System.Drawing.Size(100, 21); - this.textBoxX4.TabIndex = 10; + this.inputDevModel.Border.Class = "TextBoxBorder"; + this.inputDevModel.Border.CornerDiameter = 5; + this.inputDevModel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevModel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevModel.Location = new System.Drawing.Point(110, 47); + this.inputDevModel.Margin = new System.Windows.Forms.Padding(0); + this.inputDevModel.Name = "inputDevModel"; + this.inputDevModel.PreventEnterBeep = true; + this.inputDevModel.Size = new System.Drawing.Size(150, 27); + this.inputDevModel.TabIndex = 3; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(290, 47); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 27); + this.label1.TabIndex = 33; + this.label1.Text = "送检单位"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label9.Location = new System.Drawing.Point(0, 47); + this.label9.Margin = new System.Windows.Forms.Padding(0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(100, 27); + this.label9.TabIndex = 32; + this.label9.Text = "仪器型号"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevCode + // + // + // + // + this.inputDevCode.Border.Class = "TextBoxBorder"; + this.inputDevCode.Border.CornerDiameter = 5; + this.inputDevCode.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevCode.Location = new System.Drawing.Point(400, 10); + this.inputDevCode.Margin = new System.Windows.Forms.Padding(0); + this.inputDevCode.Name = "inputDevCode"; + this.inputDevCode.PreventEnterBeep = true; + this.inputDevCode.Size = new System.Drawing.Size(150, 27); + this.inputDevCode.TabIndex = 2; // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(400, 300); + this.ClientSize = new System.Drawing.Size(600, 392); this.ControlBox = false; - this.Controls.Add(this.textBoxX4); - this.Controls.Add(this.textBoxX3); - this.Controls.Add(this.textBoxX2); - this.Controls.Add(this.textBoxX1); - this.Controls.Add(this.btnAddDevCancel); - this.Controls.Add(this.buttonX1); - this.Controls.Add(this.labelX3); - this.Controls.Add(this.labelX4); - this.Controls.Add(this.labelX2); - this.Controls.Add(this.labelX1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Controls.Add(this.checkBox9); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.btnCancelSetDev); + this.Controls.Add(this.panel4); + this.Controls.Add(this.panel3); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AddDevDlg"; this.Text = "添加检测设备"; + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private DevComponents.DotNetBar.ButtonX btnAddDevCancel; - private DevComponents.DotNetBar.ButtonX buttonX1; - private DevComponents.DotNetBar.LabelX labelX3; - private DevComponents.DotNetBar.LabelX labelX4; - private DevComponents.DotNetBar.LabelX labelX2; - private DevComponents.DotNetBar.LabelX labelX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX3; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX4; + + private System.Windows.Forms.CheckBox checkBox9; + private RoundButton btnSave; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox4; + private RoundButton btnCancelSetDev; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel3; + private DevComponents.Editors.DateTimeAdv.DateTimeInput endTimeEst; + private DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; + private System.Windows.Forms.CheckBox checkBox10; + private System.Windows.Forms.CheckBox checkBox11; + private System.Windows.Forms.CheckBox checkBox12; + private System.Windows.Forms.CheckBox checkBox13; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevName; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnExitDev; + private System.Windows.Forms.Label labelTitle; + private System.Windows.Forms.Panel panel2; + private DevComponents.DotNetBar.Controls.ComboBoxEx channelFree; + private System.Windows.Forms.Label label4; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustName; + private System.Windows.Forms.Label label2; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustComp; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevModel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label9; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevCode; + private DevComponents.Editors.ComboItem channel1; + private DevComponents.Editors.ComboItem channel2; + private DevComponents.Editors.ComboItem channel3; + private DevComponents.Editors.ComboItem channel4; + private DevComponents.Editors.ComboItem channel5; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs index 04f5244..05fcfb3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Reflection; -using System.Text; namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { @@ -14,12 +12,14 @@ public String getNameByCode(string codeType,string code) { String name = ""; + MySqlConnection conn = null; try { string sql = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "') and code = " + code; - - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + + conn = DbConnectService.getConnection(); + MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); @@ -35,6 +35,7 @@ } } + aReader.Close(); cmd.Dispose(); return name; } @@ -42,6 +43,14 @@ { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getNameByCode: " + ex.Message); name = ""; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } } return name; } @@ -49,16 +58,13 @@ public List getTypeListByCodeType(string codeType) { List nameList = new List(); + MySqlConnection conn = null; try { - if (DbConnectService.mySqlConnect.State == ConnectionState.Closed) - { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType : 数据库链接断开"); - return null; - } + conn = DbConnectService.getConnection(); string sQry = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "')"; - MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + MySqlCommand aCommand = new MySqlCommand(sQry, conn); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { @@ -69,6 +75,8 @@ } aCommand.Dispose(); + conn.Close(); + conn.Dispose(); // 用完即关闭连接 } } catch(MySqlException ex) @@ -76,10 +84,16 @@ LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType: " + ex.Message); nameList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } + } return nameList; } - - } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 271e20a..472a36a 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -447,7 +447,6 @@ devTestDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 devTestDlg.ShowDialog(); } - } private void tableChannel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index fee0aae..b6b9993 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -29,174 +29,692 @@ /// private void InitializeComponent() { - this.btnAddDevCancel = new DevComponents.DotNetBar.ButtonX(); - this.buttonX1 = new DevComponents.DotNetBar.ButtonX(); - this.labelX3 = new DevComponents.DotNetBar.LabelX(); - this.labelX4 = new DevComponents.DotNetBar.LabelX(); - this.labelX2 = new DevComponents.DotNetBar.LabelX(); - this.labelX1 = new DevComponents.DotNetBar.LabelX(); - this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX3 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX4 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label6 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.endTimeEst = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.checkBox10 = new System.Windows.Forms.CheckBox(); + this.checkBox11 = new System.Windows.Forms.CheckBox(); + this.checkBox12 = new System.Windows.Forms.CheckBox(); + this.checkBox13 = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.inputDevName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label8 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnExitDev = new System.Windows.Forms.Button(); + this.labelTitle = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.channelFree = new DevComponents.DotNetBar.Controls.ComboBoxEx(); + this.channel1 = new DevComponents.Editors.ComboItem(); + this.channel2 = new DevComponents.Editors.ComboItem(); + this.channel3 = new DevComponents.Editors.ComboItem(); + this.channel4 = new DevComponents.Editors.ComboItem(); + this.channel5 = new DevComponents.Editors.ComboItem(); + this.label4 = new System.Windows.Forms.Label(); + this.inputCustName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label2 = new System.Windows.Forms.Label(); + this.inputCustComp = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevModel = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label1 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.inputDevCode = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.panel4.SuspendLayout(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).BeginInit(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // - // btnAddDevCancel + // checkBox9 // - this.btnAddDevCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnAddDevCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnAddDevCancel.Location = new System.Drawing.Point(216, 228); - this.btnAddDevCancel.Name = "btnAddDevCancel"; - this.btnAddDevCancel.Size = new System.Drawing.Size(75, 23); - this.btnAddDevCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnAddDevCancel.TabIndex = 8; - this.btnAddDevCancel.Text = "取消"; - this.btnAddDevCancel.Click += new System.EventHandler(this.btnAddDevCancel_Click); + this.checkBox9.AutoSize = true; + this.checkBox9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox9.Location = new System.Drawing.Point(506, 348); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(84, 24); + this.checkBox9.TabIndex = 19; + this.checkBox9.Text = "立即开始"; + this.checkBox9.UseVisualStyleBackColor = true; // - // buttonX1 + // btnSave // - this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.buttonX1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.buttonX1.Location = new System.Drawing.Point(108, 228); - this.buttonX1.Name = "buttonX1"; - this.buttonX1.Size = new System.Drawing.Size(75, 23); - this.buttonX1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.buttonX1.TabIndex = 9; - this.buttonX1.Text = "添加"; + this.btnSave.EnterBackColor = System.Drawing.Color.Blue; + this.btnSave.EnterForeColor = System.Drawing.Color.White; + this.btnSave.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnSave.FlatAppearance.BorderSize = 0; + this.btnSave.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSave.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(47)))), ((int)(((byte)(111)))), ((int)(((byte)(198))))); + this.btnSave.HoverForeColor = System.Drawing.Color.White; + this.btnSave.Location = new System.Drawing.Point(150, 342); + this.btnSave.Name = "btnSave"; + this.btnSave.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnSave.PressForeColor = System.Drawing.Color.White; + this.btnSave.Radius = 5; + this.btnSave.Size = new System.Drawing.Size(120, 30); + this.btnSave.TabIndex = 17; + this.btnSave.Text = "开始检测"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // labelX3 + // label6 + // + this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(0, 10); + this.label6.Margin = new System.Windows.Forms.Padding(0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 27); + this.label6.TabIndex = 38; + this.label6.Text = "频率稳定度"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox1.Location = new System.Drawing.Point(420, 12); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(60, 24); + this.checkBox1.TabIndex = 16; + this.checkBox1.Text = "100S"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox2.Location = new System.Drawing.Point(326, 12); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(52, 24); + this.checkBox2.TabIndex = 15; + this.checkBox2.Text = "20S"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox3.Location = new System.Drawing.Point(218, 12); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(52, 24); + this.checkBox3.TabIndex = 14; + this.checkBox3.Text = "10S"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox4.Location = new System.Drawing.Point(110, 12); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(44, 24); + this.checkBox4.TabIndex = 13; + this.checkBox4.Text = "1S"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // btnCancelSetDev + // + this.btnCancelSetDev.EnterBackColor = System.Drawing.Color.Blue; + this.btnCancelSetDev.EnterForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnCancelSetDev.FlatAppearance.BorderSize = 0; + this.btnCancelSetDev.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCancelSetDev.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCancelSetDev.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnCancelSetDev.HoverForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Location = new System.Drawing.Point(310, 342); + this.btnCancelSetDev.Name = "btnCancelSetDev"; + this.btnCancelSetDev.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnCancelSetDev.PressForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Radius = 5; + this.btnCancelSetDev.Size = new System.Drawing.Size(120, 30); + this.btnCancelSetDev.TabIndex = 18; + this.btnCancelSetDev.Text = "取消"; + this.btnCancelSetDev.UseVisualStyleBackColor = true; + this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // panel4 + // + this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel4.Controls.Add(this.label6); + this.panel4.Controls.Add(this.checkBox1); + this.panel4.Controls.Add(this.checkBox2); + this.panel4.Controls.Add(this.checkBox3); + this.panel4.Controls.Add(this.checkBox4); + this.panel4.Location = new System.Drawing.Point(10, 265); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(580, 47); + this.panel4.TabIndex = 21; + // + // panel3 + // + this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel3.Controls.Add(this.endTimeEst); + this.panel3.Controls.Add(this.startTime); + this.panel3.Controls.Add(this.checkBox10); + this.panel3.Controls.Add(this.checkBox11); + this.panel3.Controls.Add(this.checkBox12); + this.panel3.Controls.Add(this.checkBox13); + this.panel3.Controls.Add(this.label3); + this.panel3.Controls.Add(this.label12); + this.panel3.Controls.Add(this.label13); + this.panel3.Location = new System.Drawing.Point(10, 171); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(580, 84); + this.panel3.TabIndex = 20; + // + // endTimeEst // // // // - this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX3.Location = new System.Drawing.Point(60, 166); - this.labelX3.Name = "labelX3"; - this.labelX3.Size = new System.Drawing.Size(75, 23); - this.labelX3.TabIndex = 3; - this.labelX3.Text = "客户单位"; - // - // labelX4 + this.endTimeEst.BackgroundStyle.Class = "DateTimeInputBackground"; + this.endTimeEst.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.endTimeEst.ButtonDropDown.Visible = true; + this.endTimeEst.CustomFormat = "yyyy-MM-dd HH:mm"; + this.endTimeEst.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.endTimeEst.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.endTimeEst.IsPopupCalendarOpen = false; + this.endTimeEst.Location = new System.Drawing.Point(390, 49); // // // // - this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX4.Location = new System.Drawing.Point(60, 121); - this.labelX4.Name = "labelX4"; - this.labelX4.Size = new System.Drawing.Size(75, 23); - this.labelX4.TabIndex = 4; - this.labelX4.Text = "仪器名称"; // - // labelX2 + // + this.endTimeEst.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.endTimeEst.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.endTimeEst.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.TodayButtonVisible = true; + this.endTimeEst.Name = "endTimeEst"; + this.endTimeEst.ShowUpDown = true; + this.endTimeEst.Size = new System.Drawing.Size(180, 23); + this.endTimeEst.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.endTimeEst.TabIndex = 12; + this.endTimeEst.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // startTime // // // // - this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX2.Location = new System.Drawing.Point(60, 79); - this.labelX2.Name = "labelX2"; - this.labelX2.Size = new System.Drawing.Size(75, 23); - this.labelX2.TabIndex = 5; - this.labelX2.Text = "仪器编号"; - // - // labelX1 + this.startTime.BackgroundStyle.Class = "DateTimeInputBackground"; + this.startTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.startTime.ButtonDropDown.Visible = true; + this.startTime.CustomFormat = "yyyy-MM-dd HH:mm"; + this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.startTime.IsPopupCalendarOpen = false; + this.startTime.Location = new System.Drawing.Point(110, 49); // // // // - this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX1.Location = new System.Drawing.Point(60, 35); - this.labelX1.Name = "labelX1"; - this.labelX1.Size = new System.Drawing.Size(75, 23); - this.labelX1.TabIndex = 7; - this.labelX1.Text = "仪器型号"; // - // textBoxX1 + // + this.startTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.startTime.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.startTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.startTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.startTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.TodayButtonVisible = true; + this.startTime.Name = "startTime"; + this.startTime.ShowUpDown = true; + this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.startTime.TabIndex = 11; + this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // checkBox10 + // + this.checkBox10.AutoSize = true; + this.checkBox10.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox10.Location = new System.Drawing.Point(420, 12); + this.checkBox10.Name = "checkBox10"; + this.checkBox10.Size = new System.Drawing.Size(84, 24); + this.checkBox10.TabIndex = 10; + this.checkBox10.Text = "日老化率"; + this.checkBox10.UseVisualStyleBackColor = true; + // + // checkBox11 + // + this.checkBox11.AutoSize = true; + this.checkBox11.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox11.Location = new System.Drawing.Point(326, 12); + this.checkBox11.Name = "checkBox11"; + this.checkBox11.Size = new System.Drawing.Size(84, 24); + this.checkBox11.TabIndex = 9; + this.checkBox11.Text = "开机特性"; + this.checkBox11.UseVisualStyleBackColor = true; + // + // checkBox12 + // + this.checkBox12.AutoSize = true; + this.checkBox12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox12.Location = new System.Drawing.Point(218, 12); + this.checkBox12.Name = "checkBox12"; + this.checkBox12.Size = new System.Drawing.Size(98, 24); + this.checkBox12.TabIndex = 8; + this.checkBox12.Text = "频率准确度"; + this.checkBox12.UseVisualStyleBackColor = true; + // + // checkBox13 + // + this.checkBox13.AutoSize = true; + this.checkBox13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox13.Location = new System.Drawing.Point(110, 12); + this.checkBox13.Name = "checkBox13"; + this.checkBox13.Size = new System.Drawing.Size(98, 24); + this.checkBox13.TabIndex = 7; + this.checkBox13.Text = "频率稳定度"; + this.checkBox13.UseVisualStyleBackColor = true; + // + // label3 + // + this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(280, 47); + this.label3.Margin = new System.Windows.Forms.Padding(0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(100, 27); + this.label3.TabIndex = 8; + this.label3.Text = "预计结束时间"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label12 + // + this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(0, 47); + this.label12.Margin = new System.Windows.Forms.Padding(0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(100, 27); + this.label12.TabIndex = 37; + this.label12.Text = "测量开始时间"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label13 + // + this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label13.Location = new System.Drawing.Point(0, 10); + this.label13.Margin = new System.Windows.Forms.Padding(0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(100, 27); + this.label13.TabIndex = 36; + this.label13.Text = "检测项目"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevName // // // // - this.textBoxX1.Border.Class = "TextBoxBorder"; - this.textBoxX1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX1.Location = new System.Drawing.Point(152, 35); - this.textBoxX1.Name = "textBoxX1"; - this.textBoxX1.PreventEnterBeep = true; - this.textBoxX1.Size = new System.Drawing.Size(100, 21); - this.textBoxX1.TabIndex = 10; + this.inputDevName.Border.Class = "TextBoxBorder"; + this.inputDevName.Border.CornerDiameter = 5; + this.inputDevName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevName.Location = new System.Drawing.Point(110, 10); + this.inputDevName.Margin = new System.Windows.Forms.Padding(0); + this.inputDevName.Name = "inputDevName"; + this.inputDevName.PreventEnterBeep = true; + this.inputDevName.Size = new System.Drawing.Size(150, 27); + this.inputDevName.TabIndex = 1; // - // textBoxX2 + // label8 + // + this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label8.Location = new System.Drawing.Point(290, 10); + this.label8.Margin = new System.Windows.Forms.Padding(0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(100, 27); + this.label8.TabIndex = 31; + this.label8.Text = "仪器编号"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label5 + // + this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label5.Location = new System.Drawing.Point(0, 10); + this.label5.Margin = new System.Windows.Forms.Padding(0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 27); + this.label5.TabIndex = 30; + this.label5.Text = "仪器名称"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.btnExitDev); + this.panel1.Controls.Add(this.labelTitle); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(600, 32); + this.panel1.TabIndex = 18; + this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + // + // btnExitDev + // + this.btnExitDev.BackColor = System.Drawing.Color.Transparent; + this.btnExitDev.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitDev.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitDev.FlatAppearance.BorderSize = 0; + this.btnExitDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitDev.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitDev.Location = new System.Drawing.Point(570, 5); + this.btnExitDev.Margin = new System.Windows.Forms.Padding(0); + this.btnExitDev.Name = "btnExitDev"; + this.btnExitDev.Size = new System.Drawing.Size(20, 20); + this.btnExitDev.TabIndex = 2; + this.btnExitDev.UseVisualStyleBackColor = false; + this.btnExitDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // labelTitle + // + this.labelTitle.BackColor = System.Drawing.Color.Transparent; + this.labelTitle.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelTitle.ForeColor = System.Drawing.Color.White; + this.labelTitle.Location = new System.Drawing.Point(10, 5); + this.labelTitle.Name = "labelTitle"; + this.labelTitle.Size = new System.Drawing.Size(155, 23); + this.labelTitle.TabIndex = 0; + this.labelTitle.Text = "添加送检仪器"; + // + // panel2 + // + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.channelFree); + this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.inputCustName); + this.panel2.Controls.Add(this.label2); + this.panel2.Controls.Add(this.inputCustComp); + this.panel2.Controls.Add(this.inputDevModel); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.label9); + this.panel2.Controls.Add(this.inputDevCode); + this.panel2.Controls.Add(this.inputDevName); + this.panel2.Controls.Add(this.label8); + this.panel2.Controls.Add(this.label5); + this.panel2.Location = new System.Drawing.Point(10, 40); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(580, 121); + this.panel2.TabIndex = 19; + // + // channelFree + // + this.channelFree.DisplayMember = "Text"; + this.channelFree.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.channelFree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.channelFree.FormattingEnabled = true; + this.channelFree.ItemHeight = 18; + this.channelFree.Items.AddRange(new object[] { + this.channel1, + this.channel2, + this.channel3, + this.channel4, + this.channel5}); + this.channelFree.Location = new System.Drawing.Point(400, 87); + this.channelFree.Name = "channelFree"; + this.channelFree.Size = new System.Drawing.Size(150, 24); + this.channelFree.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.channelFree.TabIndex = 6; + // + // channel1 + // + this.channel1.Text = "通道1"; + this.channel1.Value = "1"; + // + // channel2 + // + this.channel2.Text = "通道2"; + this.channel2.Value = "2"; + // + // channel3 + // + this.channel3.Text = "通道3"; + this.channel3.Value = "3"; + // + // channel4 + // + this.channel4.Text = "通道4"; + this.channel4.Value = "4"; + // + // channel5 + // + this.channel5.Text = "通道5"; + this.channel5.Value = "5"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(290, 84); + this.label4.Margin = new System.Windows.Forms.Padding(0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 27); + this.label4.TabIndex = 35; + this.label4.Text = "选择通道"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustName // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX2.Location = new System.Drawing.Point(152, 79); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.Size = new System.Drawing.Size(100, 21); - this.textBoxX2.TabIndex = 10; + this.inputCustName.Border.Class = "TextBoxBorder"; + this.inputCustName.Border.CornerDiameter = 5; + this.inputCustName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustName.Location = new System.Drawing.Point(110, 84); + this.inputCustName.Margin = new System.Windows.Forms.Padding(0); + this.inputCustName.Name = "inputCustName"; + this.inputCustName.PreventEnterBeep = true; + this.inputCustName.Size = new System.Drawing.Size(150, 27); + this.inputCustName.TabIndex = 5; // - // textBoxX3 + // label2 + // + this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(0, 84); + this.label2.Margin = new System.Windows.Forms.Padding(0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(100, 27); + this.label2.TabIndex = 34; + this.label2.Text = "联系人"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustComp // // // // - this.textBoxX3.Border.Class = "TextBoxBorder"; - this.textBoxX3.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX3.Location = new System.Drawing.Point(152, 121); - this.textBoxX3.Name = "textBoxX3"; - this.textBoxX3.PreventEnterBeep = true; - this.textBoxX3.Size = new System.Drawing.Size(100, 21); - this.textBoxX3.TabIndex = 10; + this.inputCustComp.Border.Class = "TextBoxBorder"; + this.inputCustComp.Border.CornerDiameter = 5; + this.inputCustComp.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustComp.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustComp.Location = new System.Drawing.Point(400, 47); + this.inputCustComp.Margin = new System.Windows.Forms.Padding(0); + this.inputCustComp.Name = "inputCustComp"; + this.inputCustComp.PreventEnterBeep = true; + this.inputCustComp.Size = new System.Drawing.Size(150, 27); + this.inputCustComp.TabIndex = 4; // - // textBoxX4 + // inputDevModel // // // // - this.textBoxX4.Border.Class = "TextBoxBorder"; - this.textBoxX4.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX4.Location = new System.Drawing.Point(152, 166); - this.textBoxX4.Name = "textBoxX4"; - this.textBoxX4.PreventEnterBeep = true; - this.textBoxX4.Size = new System.Drawing.Size(100, 21); - this.textBoxX4.TabIndex = 10; + this.inputDevModel.Border.Class = "TextBoxBorder"; + this.inputDevModel.Border.CornerDiameter = 5; + this.inputDevModel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevModel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevModel.Location = new System.Drawing.Point(110, 47); + this.inputDevModel.Margin = new System.Windows.Forms.Padding(0); + this.inputDevModel.Name = "inputDevModel"; + this.inputDevModel.PreventEnterBeep = true; + this.inputDevModel.Size = new System.Drawing.Size(150, 27); + this.inputDevModel.TabIndex = 3; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(290, 47); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 27); + this.label1.TabIndex = 33; + this.label1.Text = "送检单位"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label9.Location = new System.Drawing.Point(0, 47); + this.label9.Margin = new System.Windows.Forms.Padding(0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(100, 27); + this.label9.TabIndex = 32; + this.label9.Text = "仪器型号"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevCode + // + // + // + // + this.inputDevCode.Border.Class = "TextBoxBorder"; + this.inputDevCode.Border.CornerDiameter = 5; + this.inputDevCode.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevCode.Location = new System.Drawing.Point(400, 10); + this.inputDevCode.Margin = new System.Windows.Forms.Padding(0); + this.inputDevCode.Name = "inputDevCode"; + this.inputDevCode.PreventEnterBeep = true; + this.inputDevCode.Size = new System.Drawing.Size(150, 27); + this.inputDevCode.TabIndex = 2; // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(400, 300); + this.ClientSize = new System.Drawing.Size(600, 392); this.ControlBox = false; - this.Controls.Add(this.textBoxX4); - this.Controls.Add(this.textBoxX3); - this.Controls.Add(this.textBoxX2); - this.Controls.Add(this.textBoxX1); - this.Controls.Add(this.btnAddDevCancel); - this.Controls.Add(this.buttonX1); - this.Controls.Add(this.labelX3); - this.Controls.Add(this.labelX4); - this.Controls.Add(this.labelX2); - this.Controls.Add(this.labelX1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Controls.Add(this.checkBox9); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.btnCancelSetDev); + this.Controls.Add(this.panel4); + this.Controls.Add(this.panel3); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AddDevDlg"; this.Text = "添加检测设备"; + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private DevComponents.DotNetBar.ButtonX btnAddDevCancel; - private DevComponents.DotNetBar.ButtonX buttonX1; - private DevComponents.DotNetBar.LabelX labelX3; - private DevComponents.DotNetBar.LabelX labelX4; - private DevComponents.DotNetBar.LabelX labelX2; - private DevComponents.DotNetBar.LabelX labelX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX3; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX4; + + private System.Windows.Forms.CheckBox checkBox9; + private RoundButton btnSave; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox4; + private RoundButton btnCancelSetDev; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel3; + private DevComponents.Editors.DateTimeAdv.DateTimeInput endTimeEst; + private DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; + private System.Windows.Forms.CheckBox checkBox10; + private System.Windows.Forms.CheckBox checkBox11; + private System.Windows.Forms.CheckBox checkBox12; + private System.Windows.Forms.CheckBox checkBox13; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevName; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnExitDev; + private System.Windows.Forms.Label labelTitle; + private System.Windows.Forms.Panel panel2; + private DevComponents.DotNetBar.Controls.ComboBoxEx channelFree; + private System.Windows.Forms.Label label4; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustName; + private System.Windows.Forms.Label label2; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustComp; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevModel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label9; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevCode; + private DevComponents.Editors.ComboItem channel1; + private DevComponents.Editors.ComboItem channel2; + private DevComponents.Editors.ComboItem channel3; + private DevComponents.Editors.ComboItem channel4; + private DevComponents.Editors.ComboItem channel5; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 739e250..652c6b4 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -1,25 +1,76 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.Tools; +using DevComponents.DotNetBar.Controls; +using DevComponents.Editors; +using System; +using System.Runtime.InteropServices; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.info { public partial class AddDevDlg : Form { + #region 无边框拖动效果/最小化窗口/关闭窗口 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + private void panel1_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + public Action HideMaskAction + { + get; + set; + } + public AddDevDlg() { InitializeComponent(); + + ((ComboBoxEx)this.Controls.Find("channelFree", true)[0]).SelectedIndex = 0; } // 关闭对话框 private void btnAddDevCancel_Click(object sender, EventArgs e) { - this.Close(); + this.HideMaskAction(); + } + + // 添加并开始检测 + private void btnSave_Click(object sender, EventArgs e) + { + // 取得输入框的参数 + string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; + string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; + string devModel = ((TextBoxX)this.Controls.Find("inputDevModel", true)[0]).Text; + string devCustomComp = ((TextBoxX)this.Controls.Find("inputCustComp", true)[0]).Text; + string devCustomName = ((TextBoxX)this.Controls.Find("inputCustName", true)[0]).Text; + + ComboBoxEx channels = (ComboBoxEx)this.Controls.Find("channelFree", true)[0]; + string channelNo = (string)((ComboItem)channels.SelectedItem).Value; + + // 初始化数据访问接口 + DeviceService devService = new DeviceServiceImpl(); + int id = devService.add(devName, devCode, "1", devModel, devCustomComp, devCustomName, channelNo); + if (id >= 0) + { + // 添加成功,继续保存检测项目和开始时间 + this.HideMaskAction(); + } + else + { + LogHelper.WriteErrorLog(this.GetType(), "添加设备[" + devName + "]失败"); + } } } } diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs index 04f5244..05fcfb3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Reflection; -using System.Text; namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { @@ -14,12 +12,14 @@ public String getNameByCode(string codeType,string code) { String name = ""; + MySqlConnection conn = null; try { string sql = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "') and code = " + code; - - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + + conn = DbConnectService.getConnection(); + MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); @@ -35,6 +35,7 @@ } } + aReader.Close(); cmd.Dispose(); return name; } @@ -42,6 +43,14 @@ { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getNameByCode: " + ex.Message); name = ""; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } } return name; } @@ -49,16 +58,13 @@ public List getTypeListByCodeType(string codeType) { List nameList = new List(); + MySqlConnection conn = null; try { - if (DbConnectService.mySqlConnect.State == ConnectionState.Closed) - { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType : 数据库链接断开"); - return null; - } + conn = DbConnectService.getConnection(); string sQry = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "')"; - MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + MySqlCommand aCommand = new MySqlCommand(sQry, conn); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { @@ -69,6 +75,8 @@ } aCommand.Dispose(); + conn.Close(); + conn.Dispose(); // 用完即关闭连接 } } catch(MySqlException ex) @@ -76,10 +84,16 @@ LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType: " + ex.Message); nameList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } + } return nameList; } - - } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 271e20a..472a36a 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -447,7 +447,6 @@ devTestDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 devTestDlg.ShowDialog(); } - } private void tableChannel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index fee0aae..b6b9993 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -29,174 +29,692 @@ /// private void InitializeComponent() { - this.btnAddDevCancel = new DevComponents.DotNetBar.ButtonX(); - this.buttonX1 = new DevComponents.DotNetBar.ButtonX(); - this.labelX3 = new DevComponents.DotNetBar.LabelX(); - this.labelX4 = new DevComponents.DotNetBar.LabelX(); - this.labelX2 = new DevComponents.DotNetBar.LabelX(); - this.labelX1 = new DevComponents.DotNetBar.LabelX(); - this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX3 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX4 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label6 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.endTimeEst = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.checkBox10 = new System.Windows.Forms.CheckBox(); + this.checkBox11 = new System.Windows.Forms.CheckBox(); + this.checkBox12 = new System.Windows.Forms.CheckBox(); + this.checkBox13 = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.inputDevName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label8 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnExitDev = new System.Windows.Forms.Button(); + this.labelTitle = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.channelFree = new DevComponents.DotNetBar.Controls.ComboBoxEx(); + this.channel1 = new DevComponents.Editors.ComboItem(); + this.channel2 = new DevComponents.Editors.ComboItem(); + this.channel3 = new DevComponents.Editors.ComboItem(); + this.channel4 = new DevComponents.Editors.ComboItem(); + this.channel5 = new DevComponents.Editors.ComboItem(); + this.label4 = new System.Windows.Forms.Label(); + this.inputCustName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label2 = new System.Windows.Forms.Label(); + this.inputCustComp = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevModel = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label1 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.inputDevCode = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.panel4.SuspendLayout(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).BeginInit(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // - // btnAddDevCancel + // checkBox9 // - this.btnAddDevCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnAddDevCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnAddDevCancel.Location = new System.Drawing.Point(216, 228); - this.btnAddDevCancel.Name = "btnAddDevCancel"; - this.btnAddDevCancel.Size = new System.Drawing.Size(75, 23); - this.btnAddDevCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnAddDevCancel.TabIndex = 8; - this.btnAddDevCancel.Text = "取消"; - this.btnAddDevCancel.Click += new System.EventHandler(this.btnAddDevCancel_Click); + this.checkBox9.AutoSize = true; + this.checkBox9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox9.Location = new System.Drawing.Point(506, 348); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(84, 24); + this.checkBox9.TabIndex = 19; + this.checkBox9.Text = "立即开始"; + this.checkBox9.UseVisualStyleBackColor = true; // - // buttonX1 + // btnSave // - this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.buttonX1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.buttonX1.Location = new System.Drawing.Point(108, 228); - this.buttonX1.Name = "buttonX1"; - this.buttonX1.Size = new System.Drawing.Size(75, 23); - this.buttonX1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.buttonX1.TabIndex = 9; - this.buttonX1.Text = "添加"; + this.btnSave.EnterBackColor = System.Drawing.Color.Blue; + this.btnSave.EnterForeColor = System.Drawing.Color.White; + this.btnSave.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnSave.FlatAppearance.BorderSize = 0; + this.btnSave.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSave.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(47)))), ((int)(((byte)(111)))), ((int)(((byte)(198))))); + this.btnSave.HoverForeColor = System.Drawing.Color.White; + this.btnSave.Location = new System.Drawing.Point(150, 342); + this.btnSave.Name = "btnSave"; + this.btnSave.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnSave.PressForeColor = System.Drawing.Color.White; + this.btnSave.Radius = 5; + this.btnSave.Size = new System.Drawing.Size(120, 30); + this.btnSave.TabIndex = 17; + this.btnSave.Text = "开始检测"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // labelX3 + // label6 + // + this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(0, 10); + this.label6.Margin = new System.Windows.Forms.Padding(0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 27); + this.label6.TabIndex = 38; + this.label6.Text = "频率稳定度"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox1.Location = new System.Drawing.Point(420, 12); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(60, 24); + this.checkBox1.TabIndex = 16; + this.checkBox1.Text = "100S"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox2.Location = new System.Drawing.Point(326, 12); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(52, 24); + this.checkBox2.TabIndex = 15; + this.checkBox2.Text = "20S"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox3.Location = new System.Drawing.Point(218, 12); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(52, 24); + this.checkBox3.TabIndex = 14; + this.checkBox3.Text = "10S"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox4.Location = new System.Drawing.Point(110, 12); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(44, 24); + this.checkBox4.TabIndex = 13; + this.checkBox4.Text = "1S"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // btnCancelSetDev + // + this.btnCancelSetDev.EnterBackColor = System.Drawing.Color.Blue; + this.btnCancelSetDev.EnterForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnCancelSetDev.FlatAppearance.BorderSize = 0; + this.btnCancelSetDev.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCancelSetDev.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCancelSetDev.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnCancelSetDev.HoverForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Location = new System.Drawing.Point(310, 342); + this.btnCancelSetDev.Name = "btnCancelSetDev"; + this.btnCancelSetDev.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnCancelSetDev.PressForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Radius = 5; + this.btnCancelSetDev.Size = new System.Drawing.Size(120, 30); + this.btnCancelSetDev.TabIndex = 18; + this.btnCancelSetDev.Text = "取消"; + this.btnCancelSetDev.UseVisualStyleBackColor = true; + this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // panel4 + // + this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel4.Controls.Add(this.label6); + this.panel4.Controls.Add(this.checkBox1); + this.panel4.Controls.Add(this.checkBox2); + this.panel4.Controls.Add(this.checkBox3); + this.panel4.Controls.Add(this.checkBox4); + this.panel4.Location = new System.Drawing.Point(10, 265); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(580, 47); + this.panel4.TabIndex = 21; + // + // panel3 + // + this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel3.Controls.Add(this.endTimeEst); + this.panel3.Controls.Add(this.startTime); + this.panel3.Controls.Add(this.checkBox10); + this.panel3.Controls.Add(this.checkBox11); + this.panel3.Controls.Add(this.checkBox12); + this.panel3.Controls.Add(this.checkBox13); + this.panel3.Controls.Add(this.label3); + this.panel3.Controls.Add(this.label12); + this.panel3.Controls.Add(this.label13); + this.panel3.Location = new System.Drawing.Point(10, 171); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(580, 84); + this.panel3.TabIndex = 20; + // + // endTimeEst // // // // - this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX3.Location = new System.Drawing.Point(60, 166); - this.labelX3.Name = "labelX3"; - this.labelX3.Size = new System.Drawing.Size(75, 23); - this.labelX3.TabIndex = 3; - this.labelX3.Text = "客户单位"; - // - // labelX4 + this.endTimeEst.BackgroundStyle.Class = "DateTimeInputBackground"; + this.endTimeEst.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.endTimeEst.ButtonDropDown.Visible = true; + this.endTimeEst.CustomFormat = "yyyy-MM-dd HH:mm"; + this.endTimeEst.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.endTimeEst.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.endTimeEst.IsPopupCalendarOpen = false; + this.endTimeEst.Location = new System.Drawing.Point(390, 49); // // // // - this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX4.Location = new System.Drawing.Point(60, 121); - this.labelX4.Name = "labelX4"; - this.labelX4.Size = new System.Drawing.Size(75, 23); - this.labelX4.TabIndex = 4; - this.labelX4.Text = "仪器名称"; // - // labelX2 + // + this.endTimeEst.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.endTimeEst.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.endTimeEst.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.TodayButtonVisible = true; + this.endTimeEst.Name = "endTimeEst"; + this.endTimeEst.ShowUpDown = true; + this.endTimeEst.Size = new System.Drawing.Size(180, 23); + this.endTimeEst.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.endTimeEst.TabIndex = 12; + this.endTimeEst.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // startTime // // // // - this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX2.Location = new System.Drawing.Point(60, 79); - this.labelX2.Name = "labelX2"; - this.labelX2.Size = new System.Drawing.Size(75, 23); - this.labelX2.TabIndex = 5; - this.labelX2.Text = "仪器编号"; - // - // labelX1 + this.startTime.BackgroundStyle.Class = "DateTimeInputBackground"; + this.startTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.startTime.ButtonDropDown.Visible = true; + this.startTime.CustomFormat = "yyyy-MM-dd HH:mm"; + this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.startTime.IsPopupCalendarOpen = false; + this.startTime.Location = new System.Drawing.Point(110, 49); // // // // - this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX1.Location = new System.Drawing.Point(60, 35); - this.labelX1.Name = "labelX1"; - this.labelX1.Size = new System.Drawing.Size(75, 23); - this.labelX1.TabIndex = 7; - this.labelX1.Text = "仪器型号"; // - // textBoxX1 + // + this.startTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.startTime.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.startTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.startTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.startTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.TodayButtonVisible = true; + this.startTime.Name = "startTime"; + this.startTime.ShowUpDown = true; + this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.startTime.TabIndex = 11; + this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // checkBox10 + // + this.checkBox10.AutoSize = true; + this.checkBox10.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox10.Location = new System.Drawing.Point(420, 12); + this.checkBox10.Name = "checkBox10"; + this.checkBox10.Size = new System.Drawing.Size(84, 24); + this.checkBox10.TabIndex = 10; + this.checkBox10.Text = "日老化率"; + this.checkBox10.UseVisualStyleBackColor = true; + // + // checkBox11 + // + this.checkBox11.AutoSize = true; + this.checkBox11.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox11.Location = new System.Drawing.Point(326, 12); + this.checkBox11.Name = "checkBox11"; + this.checkBox11.Size = new System.Drawing.Size(84, 24); + this.checkBox11.TabIndex = 9; + this.checkBox11.Text = "开机特性"; + this.checkBox11.UseVisualStyleBackColor = true; + // + // checkBox12 + // + this.checkBox12.AutoSize = true; + this.checkBox12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox12.Location = new System.Drawing.Point(218, 12); + this.checkBox12.Name = "checkBox12"; + this.checkBox12.Size = new System.Drawing.Size(98, 24); + this.checkBox12.TabIndex = 8; + this.checkBox12.Text = "频率准确度"; + this.checkBox12.UseVisualStyleBackColor = true; + // + // checkBox13 + // + this.checkBox13.AutoSize = true; + this.checkBox13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox13.Location = new System.Drawing.Point(110, 12); + this.checkBox13.Name = "checkBox13"; + this.checkBox13.Size = new System.Drawing.Size(98, 24); + this.checkBox13.TabIndex = 7; + this.checkBox13.Text = "频率稳定度"; + this.checkBox13.UseVisualStyleBackColor = true; + // + // label3 + // + this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(280, 47); + this.label3.Margin = new System.Windows.Forms.Padding(0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(100, 27); + this.label3.TabIndex = 8; + this.label3.Text = "预计结束时间"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label12 + // + this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(0, 47); + this.label12.Margin = new System.Windows.Forms.Padding(0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(100, 27); + this.label12.TabIndex = 37; + this.label12.Text = "测量开始时间"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label13 + // + this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label13.Location = new System.Drawing.Point(0, 10); + this.label13.Margin = new System.Windows.Forms.Padding(0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(100, 27); + this.label13.TabIndex = 36; + this.label13.Text = "检测项目"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevName // // // // - this.textBoxX1.Border.Class = "TextBoxBorder"; - this.textBoxX1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX1.Location = new System.Drawing.Point(152, 35); - this.textBoxX1.Name = "textBoxX1"; - this.textBoxX1.PreventEnterBeep = true; - this.textBoxX1.Size = new System.Drawing.Size(100, 21); - this.textBoxX1.TabIndex = 10; + this.inputDevName.Border.Class = "TextBoxBorder"; + this.inputDevName.Border.CornerDiameter = 5; + this.inputDevName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevName.Location = new System.Drawing.Point(110, 10); + this.inputDevName.Margin = new System.Windows.Forms.Padding(0); + this.inputDevName.Name = "inputDevName"; + this.inputDevName.PreventEnterBeep = true; + this.inputDevName.Size = new System.Drawing.Size(150, 27); + this.inputDevName.TabIndex = 1; // - // textBoxX2 + // label8 + // + this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label8.Location = new System.Drawing.Point(290, 10); + this.label8.Margin = new System.Windows.Forms.Padding(0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(100, 27); + this.label8.TabIndex = 31; + this.label8.Text = "仪器编号"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label5 + // + this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label5.Location = new System.Drawing.Point(0, 10); + this.label5.Margin = new System.Windows.Forms.Padding(0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 27); + this.label5.TabIndex = 30; + this.label5.Text = "仪器名称"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.btnExitDev); + this.panel1.Controls.Add(this.labelTitle); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(600, 32); + this.panel1.TabIndex = 18; + this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + // + // btnExitDev + // + this.btnExitDev.BackColor = System.Drawing.Color.Transparent; + this.btnExitDev.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitDev.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitDev.FlatAppearance.BorderSize = 0; + this.btnExitDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitDev.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitDev.Location = new System.Drawing.Point(570, 5); + this.btnExitDev.Margin = new System.Windows.Forms.Padding(0); + this.btnExitDev.Name = "btnExitDev"; + this.btnExitDev.Size = new System.Drawing.Size(20, 20); + this.btnExitDev.TabIndex = 2; + this.btnExitDev.UseVisualStyleBackColor = false; + this.btnExitDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // labelTitle + // + this.labelTitle.BackColor = System.Drawing.Color.Transparent; + this.labelTitle.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelTitle.ForeColor = System.Drawing.Color.White; + this.labelTitle.Location = new System.Drawing.Point(10, 5); + this.labelTitle.Name = "labelTitle"; + this.labelTitle.Size = new System.Drawing.Size(155, 23); + this.labelTitle.TabIndex = 0; + this.labelTitle.Text = "添加送检仪器"; + // + // panel2 + // + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.channelFree); + this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.inputCustName); + this.panel2.Controls.Add(this.label2); + this.panel2.Controls.Add(this.inputCustComp); + this.panel2.Controls.Add(this.inputDevModel); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.label9); + this.panel2.Controls.Add(this.inputDevCode); + this.panel2.Controls.Add(this.inputDevName); + this.panel2.Controls.Add(this.label8); + this.panel2.Controls.Add(this.label5); + this.panel2.Location = new System.Drawing.Point(10, 40); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(580, 121); + this.panel2.TabIndex = 19; + // + // channelFree + // + this.channelFree.DisplayMember = "Text"; + this.channelFree.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.channelFree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.channelFree.FormattingEnabled = true; + this.channelFree.ItemHeight = 18; + this.channelFree.Items.AddRange(new object[] { + this.channel1, + this.channel2, + this.channel3, + this.channel4, + this.channel5}); + this.channelFree.Location = new System.Drawing.Point(400, 87); + this.channelFree.Name = "channelFree"; + this.channelFree.Size = new System.Drawing.Size(150, 24); + this.channelFree.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.channelFree.TabIndex = 6; + // + // channel1 + // + this.channel1.Text = "通道1"; + this.channel1.Value = "1"; + // + // channel2 + // + this.channel2.Text = "通道2"; + this.channel2.Value = "2"; + // + // channel3 + // + this.channel3.Text = "通道3"; + this.channel3.Value = "3"; + // + // channel4 + // + this.channel4.Text = "通道4"; + this.channel4.Value = "4"; + // + // channel5 + // + this.channel5.Text = "通道5"; + this.channel5.Value = "5"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(290, 84); + this.label4.Margin = new System.Windows.Forms.Padding(0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 27); + this.label4.TabIndex = 35; + this.label4.Text = "选择通道"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustName // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX2.Location = new System.Drawing.Point(152, 79); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.Size = new System.Drawing.Size(100, 21); - this.textBoxX2.TabIndex = 10; + this.inputCustName.Border.Class = "TextBoxBorder"; + this.inputCustName.Border.CornerDiameter = 5; + this.inputCustName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustName.Location = new System.Drawing.Point(110, 84); + this.inputCustName.Margin = new System.Windows.Forms.Padding(0); + this.inputCustName.Name = "inputCustName"; + this.inputCustName.PreventEnterBeep = true; + this.inputCustName.Size = new System.Drawing.Size(150, 27); + this.inputCustName.TabIndex = 5; // - // textBoxX3 + // label2 + // + this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(0, 84); + this.label2.Margin = new System.Windows.Forms.Padding(0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(100, 27); + this.label2.TabIndex = 34; + this.label2.Text = "联系人"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustComp // // // // - this.textBoxX3.Border.Class = "TextBoxBorder"; - this.textBoxX3.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX3.Location = new System.Drawing.Point(152, 121); - this.textBoxX3.Name = "textBoxX3"; - this.textBoxX3.PreventEnterBeep = true; - this.textBoxX3.Size = new System.Drawing.Size(100, 21); - this.textBoxX3.TabIndex = 10; + this.inputCustComp.Border.Class = "TextBoxBorder"; + this.inputCustComp.Border.CornerDiameter = 5; + this.inputCustComp.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustComp.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustComp.Location = new System.Drawing.Point(400, 47); + this.inputCustComp.Margin = new System.Windows.Forms.Padding(0); + this.inputCustComp.Name = "inputCustComp"; + this.inputCustComp.PreventEnterBeep = true; + this.inputCustComp.Size = new System.Drawing.Size(150, 27); + this.inputCustComp.TabIndex = 4; // - // textBoxX4 + // inputDevModel // // // // - this.textBoxX4.Border.Class = "TextBoxBorder"; - this.textBoxX4.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX4.Location = new System.Drawing.Point(152, 166); - this.textBoxX4.Name = "textBoxX4"; - this.textBoxX4.PreventEnterBeep = true; - this.textBoxX4.Size = new System.Drawing.Size(100, 21); - this.textBoxX4.TabIndex = 10; + this.inputDevModel.Border.Class = "TextBoxBorder"; + this.inputDevModel.Border.CornerDiameter = 5; + this.inputDevModel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevModel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevModel.Location = new System.Drawing.Point(110, 47); + this.inputDevModel.Margin = new System.Windows.Forms.Padding(0); + this.inputDevModel.Name = "inputDevModel"; + this.inputDevModel.PreventEnterBeep = true; + this.inputDevModel.Size = new System.Drawing.Size(150, 27); + this.inputDevModel.TabIndex = 3; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(290, 47); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 27); + this.label1.TabIndex = 33; + this.label1.Text = "送检单位"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label9.Location = new System.Drawing.Point(0, 47); + this.label9.Margin = new System.Windows.Forms.Padding(0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(100, 27); + this.label9.TabIndex = 32; + this.label9.Text = "仪器型号"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevCode + // + // + // + // + this.inputDevCode.Border.Class = "TextBoxBorder"; + this.inputDevCode.Border.CornerDiameter = 5; + this.inputDevCode.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevCode.Location = new System.Drawing.Point(400, 10); + this.inputDevCode.Margin = new System.Windows.Forms.Padding(0); + this.inputDevCode.Name = "inputDevCode"; + this.inputDevCode.PreventEnterBeep = true; + this.inputDevCode.Size = new System.Drawing.Size(150, 27); + this.inputDevCode.TabIndex = 2; // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(400, 300); + this.ClientSize = new System.Drawing.Size(600, 392); this.ControlBox = false; - this.Controls.Add(this.textBoxX4); - this.Controls.Add(this.textBoxX3); - this.Controls.Add(this.textBoxX2); - this.Controls.Add(this.textBoxX1); - this.Controls.Add(this.btnAddDevCancel); - this.Controls.Add(this.buttonX1); - this.Controls.Add(this.labelX3); - this.Controls.Add(this.labelX4); - this.Controls.Add(this.labelX2); - this.Controls.Add(this.labelX1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Controls.Add(this.checkBox9); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.btnCancelSetDev); + this.Controls.Add(this.panel4); + this.Controls.Add(this.panel3); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AddDevDlg"; this.Text = "添加检测设备"; + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private DevComponents.DotNetBar.ButtonX btnAddDevCancel; - private DevComponents.DotNetBar.ButtonX buttonX1; - private DevComponents.DotNetBar.LabelX labelX3; - private DevComponents.DotNetBar.LabelX labelX4; - private DevComponents.DotNetBar.LabelX labelX2; - private DevComponents.DotNetBar.LabelX labelX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX3; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX4; + + private System.Windows.Forms.CheckBox checkBox9; + private RoundButton btnSave; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox4; + private RoundButton btnCancelSetDev; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel3; + private DevComponents.Editors.DateTimeAdv.DateTimeInput endTimeEst; + private DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; + private System.Windows.Forms.CheckBox checkBox10; + private System.Windows.Forms.CheckBox checkBox11; + private System.Windows.Forms.CheckBox checkBox12; + private System.Windows.Forms.CheckBox checkBox13; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevName; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnExitDev; + private System.Windows.Forms.Label labelTitle; + private System.Windows.Forms.Panel panel2; + private DevComponents.DotNetBar.Controls.ComboBoxEx channelFree; + private System.Windows.Forms.Label label4; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustName; + private System.Windows.Forms.Label label2; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustComp; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevModel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label9; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevCode; + private DevComponents.Editors.ComboItem channel1; + private DevComponents.Editors.ComboItem channel2; + private DevComponents.Editors.ComboItem channel3; + private DevComponents.Editors.ComboItem channel4; + private DevComponents.Editors.ComboItem channel5; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 739e250..652c6b4 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -1,25 +1,76 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.Tools; +using DevComponents.DotNetBar.Controls; +using DevComponents.Editors; +using System; +using System.Runtime.InteropServices; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.info { public partial class AddDevDlg : Form { + #region 无边框拖动效果/最小化窗口/关闭窗口 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + private void panel1_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + public Action HideMaskAction + { + get; + set; + } + public AddDevDlg() { InitializeComponent(); + + ((ComboBoxEx)this.Controls.Find("channelFree", true)[0]).SelectedIndex = 0; } // 关闭对话框 private void btnAddDevCancel_Click(object sender, EventArgs e) { - this.Close(); + this.HideMaskAction(); + } + + // 添加并开始检测 + private void btnSave_Click(object sender, EventArgs e) + { + // 取得输入框的参数 + string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; + string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; + string devModel = ((TextBoxX)this.Controls.Find("inputDevModel", true)[0]).Text; + string devCustomComp = ((TextBoxX)this.Controls.Find("inputCustComp", true)[0]).Text; + string devCustomName = ((TextBoxX)this.Controls.Find("inputCustName", true)[0]).Text; + + ComboBoxEx channels = (ComboBoxEx)this.Controls.Find("channelFree", true)[0]; + string channelNo = (string)((ComboItem)channels.SelectedItem).Value; + + // 初始化数据访问接口 + DeviceService devService = new DeviceServiceImpl(); + int id = devService.add(devName, devCode, "1", devModel, devCustomComp, devCustomName, channelNo); + if (id >= 0) + { + // 添加成功,继续保存检测项目和开始时间 + this.HideMaskAction(); + } + else + { + LogHelper.WriteErrorLog(this.GetType(), "添加设备[" + devName + "]失败"); + } } } } diff --git a/RbFreqStandMeasure/info/DevicesDto.cs b/RbFreqStandMeasure/info/DevicesDto.cs new file mode 100644 index 0000000..872c3b8 --- /dev/null +++ b/RbFreqStandMeasure/info/DevicesDto.cs @@ -0,0 +1,6 @@ +namespace Casic.Birmm.RbFreqStandMeasure.info +{ + internal class DevicesDto + { + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs index 04f5244..05fcfb3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Reflection; -using System.Text; namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { @@ -14,12 +12,14 @@ public String getNameByCode(string codeType,string code) { String name = ""; + MySqlConnection conn = null; try { string sql = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "') and code = " + code; - - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + + conn = DbConnectService.getConnection(); + MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); @@ -35,6 +35,7 @@ } } + aReader.Close(); cmd.Dispose(); return name; } @@ -42,6 +43,14 @@ { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getNameByCode: " + ex.Message); name = ""; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } } return name; } @@ -49,16 +58,13 @@ public List getTypeListByCodeType(string codeType) { List nameList = new List(); + MySqlConnection conn = null; try { - if (DbConnectService.mySqlConnect.State == ConnectionState.Closed) - { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType : 数据库链接断开"); - return null; - } + conn = DbConnectService.getConnection(); string sQry = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "')"; - MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + MySqlCommand aCommand = new MySqlCommand(sQry, conn); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { @@ -69,6 +75,8 @@ } aCommand.Dispose(); + conn.Close(); + conn.Dispose(); // 用完即关闭连接 } } catch(MySqlException ex) @@ -76,10 +84,16 @@ LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType: " + ex.Message); nameList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } + } return nameList; } - - } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 271e20a..472a36a 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -447,7 +447,6 @@ devTestDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 devTestDlg.ShowDialog(); } - } private void tableChannel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index fee0aae..b6b9993 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -29,174 +29,692 @@ /// private void InitializeComponent() { - this.btnAddDevCancel = new DevComponents.DotNetBar.ButtonX(); - this.buttonX1 = new DevComponents.DotNetBar.ButtonX(); - this.labelX3 = new DevComponents.DotNetBar.LabelX(); - this.labelX4 = new DevComponents.DotNetBar.LabelX(); - this.labelX2 = new DevComponents.DotNetBar.LabelX(); - this.labelX1 = new DevComponents.DotNetBar.LabelX(); - this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX3 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX4 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label6 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.endTimeEst = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.checkBox10 = new System.Windows.Forms.CheckBox(); + this.checkBox11 = new System.Windows.Forms.CheckBox(); + this.checkBox12 = new System.Windows.Forms.CheckBox(); + this.checkBox13 = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.inputDevName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label8 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnExitDev = new System.Windows.Forms.Button(); + this.labelTitle = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.channelFree = new DevComponents.DotNetBar.Controls.ComboBoxEx(); + this.channel1 = new DevComponents.Editors.ComboItem(); + this.channel2 = new DevComponents.Editors.ComboItem(); + this.channel3 = new DevComponents.Editors.ComboItem(); + this.channel4 = new DevComponents.Editors.ComboItem(); + this.channel5 = new DevComponents.Editors.ComboItem(); + this.label4 = new System.Windows.Forms.Label(); + this.inputCustName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label2 = new System.Windows.Forms.Label(); + this.inputCustComp = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevModel = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label1 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.inputDevCode = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.panel4.SuspendLayout(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).BeginInit(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // - // btnAddDevCancel + // checkBox9 // - this.btnAddDevCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnAddDevCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnAddDevCancel.Location = new System.Drawing.Point(216, 228); - this.btnAddDevCancel.Name = "btnAddDevCancel"; - this.btnAddDevCancel.Size = new System.Drawing.Size(75, 23); - this.btnAddDevCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnAddDevCancel.TabIndex = 8; - this.btnAddDevCancel.Text = "取消"; - this.btnAddDevCancel.Click += new System.EventHandler(this.btnAddDevCancel_Click); + this.checkBox9.AutoSize = true; + this.checkBox9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox9.Location = new System.Drawing.Point(506, 348); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(84, 24); + this.checkBox9.TabIndex = 19; + this.checkBox9.Text = "立即开始"; + this.checkBox9.UseVisualStyleBackColor = true; // - // buttonX1 + // btnSave // - this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.buttonX1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.buttonX1.Location = new System.Drawing.Point(108, 228); - this.buttonX1.Name = "buttonX1"; - this.buttonX1.Size = new System.Drawing.Size(75, 23); - this.buttonX1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.buttonX1.TabIndex = 9; - this.buttonX1.Text = "添加"; + this.btnSave.EnterBackColor = System.Drawing.Color.Blue; + this.btnSave.EnterForeColor = System.Drawing.Color.White; + this.btnSave.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnSave.FlatAppearance.BorderSize = 0; + this.btnSave.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSave.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(47)))), ((int)(((byte)(111)))), ((int)(((byte)(198))))); + this.btnSave.HoverForeColor = System.Drawing.Color.White; + this.btnSave.Location = new System.Drawing.Point(150, 342); + this.btnSave.Name = "btnSave"; + this.btnSave.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnSave.PressForeColor = System.Drawing.Color.White; + this.btnSave.Radius = 5; + this.btnSave.Size = new System.Drawing.Size(120, 30); + this.btnSave.TabIndex = 17; + this.btnSave.Text = "开始检测"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // labelX3 + // label6 + // + this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(0, 10); + this.label6.Margin = new System.Windows.Forms.Padding(0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 27); + this.label6.TabIndex = 38; + this.label6.Text = "频率稳定度"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox1.Location = new System.Drawing.Point(420, 12); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(60, 24); + this.checkBox1.TabIndex = 16; + this.checkBox1.Text = "100S"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox2.Location = new System.Drawing.Point(326, 12); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(52, 24); + this.checkBox2.TabIndex = 15; + this.checkBox2.Text = "20S"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox3.Location = new System.Drawing.Point(218, 12); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(52, 24); + this.checkBox3.TabIndex = 14; + this.checkBox3.Text = "10S"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox4.Location = new System.Drawing.Point(110, 12); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(44, 24); + this.checkBox4.TabIndex = 13; + this.checkBox4.Text = "1S"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // btnCancelSetDev + // + this.btnCancelSetDev.EnterBackColor = System.Drawing.Color.Blue; + this.btnCancelSetDev.EnterForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnCancelSetDev.FlatAppearance.BorderSize = 0; + this.btnCancelSetDev.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCancelSetDev.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCancelSetDev.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnCancelSetDev.HoverForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Location = new System.Drawing.Point(310, 342); + this.btnCancelSetDev.Name = "btnCancelSetDev"; + this.btnCancelSetDev.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnCancelSetDev.PressForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Radius = 5; + this.btnCancelSetDev.Size = new System.Drawing.Size(120, 30); + this.btnCancelSetDev.TabIndex = 18; + this.btnCancelSetDev.Text = "取消"; + this.btnCancelSetDev.UseVisualStyleBackColor = true; + this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // panel4 + // + this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel4.Controls.Add(this.label6); + this.panel4.Controls.Add(this.checkBox1); + this.panel4.Controls.Add(this.checkBox2); + this.panel4.Controls.Add(this.checkBox3); + this.panel4.Controls.Add(this.checkBox4); + this.panel4.Location = new System.Drawing.Point(10, 265); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(580, 47); + this.panel4.TabIndex = 21; + // + // panel3 + // + this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel3.Controls.Add(this.endTimeEst); + this.panel3.Controls.Add(this.startTime); + this.panel3.Controls.Add(this.checkBox10); + this.panel3.Controls.Add(this.checkBox11); + this.panel3.Controls.Add(this.checkBox12); + this.panel3.Controls.Add(this.checkBox13); + this.panel3.Controls.Add(this.label3); + this.panel3.Controls.Add(this.label12); + this.panel3.Controls.Add(this.label13); + this.panel3.Location = new System.Drawing.Point(10, 171); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(580, 84); + this.panel3.TabIndex = 20; + // + // endTimeEst // // // // - this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX3.Location = new System.Drawing.Point(60, 166); - this.labelX3.Name = "labelX3"; - this.labelX3.Size = new System.Drawing.Size(75, 23); - this.labelX3.TabIndex = 3; - this.labelX3.Text = "客户单位"; - // - // labelX4 + this.endTimeEst.BackgroundStyle.Class = "DateTimeInputBackground"; + this.endTimeEst.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.endTimeEst.ButtonDropDown.Visible = true; + this.endTimeEst.CustomFormat = "yyyy-MM-dd HH:mm"; + this.endTimeEst.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.endTimeEst.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.endTimeEst.IsPopupCalendarOpen = false; + this.endTimeEst.Location = new System.Drawing.Point(390, 49); // // // // - this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX4.Location = new System.Drawing.Point(60, 121); - this.labelX4.Name = "labelX4"; - this.labelX4.Size = new System.Drawing.Size(75, 23); - this.labelX4.TabIndex = 4; - this.labelX4.Text = "仪器名称"; // - // labelX2 + // + this.endTimeEst.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.endTimeEst.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.endTimeEst.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.TodayButtonVisible = true; + this.endTimeEst.Name = "endTimeEst"; + this.endTimeEst.ShowUpDown = true; + this.endTimeEst.Size = new System.Drawing.Size(180, 23); + this.endTimeEst.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.endTimeEst.TabIndex = 12; + this.endTimeEst.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // startTime // // // // - this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX2.Location = new System.Drawing.Point(60, 79); - this.labelX2.Name = "labelX2"; - this.labelX2.Size = new System.Drawing.Size(75, 23); - this.labelX2.TabIndex = 5; - this.labelX2.Text = "仪器编号"; - // - // labelX1 + this.startTime.BackgroundStyle.Class = "DateTimeInputBackground"; + this.startTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.startTime.ButtonDropDown.Visible = true; + this.startTime.CustomFormat = "yyyy-MM-dd HH:mm"; + this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.startTime.IsPopupCalendarOpen = false; + this.startTime.Location = new System.Drawing.Point(110, 49); // // // // - this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX1.Location = new System.Drawing.Point(60, 35); - this.labelX1.Name = "labelX1"; - this.labelX1.Size = new System.Drawing.Size(75, 23); - this.labelX1.TabIndex = 7; - this.labelX1.Text = "仪器型号"; // - // textBoxX1 + // + this.startTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.startTime.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.startTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.startTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.startTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.TodayButtonVisible = true; + this.startTime.Name = "startTime"; + this.startTime.ShowUpDown = true; + this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.startTime.TabIndex = 11; + this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // checkBox10 + // + this.checkBox10.AutoSize = true; + this.checkBox10.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox10.Location = new System.Drawing.Point(420, 12); + this.checkBox10.Name = "checkBox10"; + this.checkBox10.Size = new System.Drawing.Size(84, 24); + this.checkBox10.TabIndex = 10; + this.checkBox10.Text = "日老化率"; + this.checkBox10.UseVisualStyleBackColor = true; + // + // checkBox11 + // + this.checkBox11.AutoSize = true; + this.checkBox11.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox11.Location = new System.Drawing.Point(326, 12); + this.checkBox11.Name = "checkBox11"; + this.checkBox11.Size = new System.Drawing.Size(84, 24); + this.checkBox11.TabIndex = 9; + this.checkBox11.Text = "开机特性"; + this.checkBox11.UseVisualStyleBackColor = true; + // + // checkBox12 + // + this.checkBox12.AutoSize = true; + this.checkBox12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox12.Location = new System.Drawing.Point(218, 12); + this.checkBox12.Name = "checkBox12"; + this.checkBox12.Size = new System.Drawing.Size(98, 24); + this.checkBox12.TabIndex = 8; + this.checkBox12.Text = "频率准确度"; + this.checkBox12.UseVisualStyleBackColor = true; + // + // checkBox13 + // + this.checkBox13.AutoSize = true; + this.checkBox13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox13.Location = new System.Drawing.Point(110, 12); + this.checkBox13.Name = "checkBox13"; + this.checkBox13.Size = new System.Drawing.Size(98, 24); + this.checkBox13.TabIndex = 7; + this.checkBox13.Text = "频率稳定度"; + this.checkBox13.UseVisualStyleBackColor = true; + // + // label3 + // + this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(280, 47); + this.label3.Margin = new System.Windows.Forms.Padding(0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(100, 27); + this.label3.TabIndex = 8; + this.label3.Text = "预计结束时间"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label12 + // + this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(0, 47); + this.label12.Margin = new System.Windows.Forms.Padding(0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(100, 27); + this.label12.TabIndex = 37; + this.label12.Text = "测量开始时间"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label13 + // + this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label13.Location = new System.Drawing.Point(0, 10); + this.label13.Margin = new System.Windows.Forms.Padding(0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(100, 27); + this.label13.TabIndex = 36; + this.label13.Text = "检测项目"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevName // // // // - this.textBoxX1.Border.Class = "TextBoxBorder"; - this.textBoxX1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX1.Location = new System.Drawing.Point(152, 35); - this.textBoxX1.Name = "textBoxX1"; - this.textBoxX1.PreventEnterBeep = true; - this.textBoxX1.Size = new System.Drawing.Size(100, 21); - this.textBoxX1.TabIndex = 10; + this.inputDevName.Border.Class = "TextBoxBorder"; + this.inputDevName.Border.CornerDiameter = 5; + this.inputDevName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevName.Location = new System.Drawing.Point(110, 10); + this.inputDevName.Margin = new System.Windows.Forms.Padding(0); + this.inputDevName.Name = "inputDevName"; + this.inputDevName.PreventEnterBeep = true; + this.inputDevName.Size = new System.Drawing.Size(150, 27); + this.inputDevName.TabIndex = 1; // - // textBoxX2 + // label8 + // + this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label8.Location = new System.Drawing.Point(290, 10); + this.label8.Margin = new System.Windows.Forms.Padding(0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(100, 27); + this.label8.TabIndex = 31; + this.label8.Text = "仪器编号"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label5 + // + this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label5.Location = new System.Drawing.Point(0, 10); + this.label5.Margin = new System.Windows.Forms.Padding(0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 27); + this.label5.TabIndex = 30; + this.label5.Text = "仪器名称"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.btnExitDev); + this.panel1.Controls.Add(this.labelTitle); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(600, 32); + this.panel1.TabIndex = 18; + this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + // + // btnExitDev + // + this.btnExitDev.BackColor = System.Drawing.Color.Transparent; + this.btnExitDev.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitDev.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitDev.FlatAppearance.BorderSize = 0; + this.btnExitDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitDev.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitDev.Location = new System.Drawing.Point(570, 5); + this.btnExitDev.Margin = new System.Windows.Forms.Padding(0); + this.btnExitDev.Name = "btnExitDev"; + this.btnExitDev.Size = new System.Drawing.Size(20, 20); + this.btnExitDev.TabIndex = 2; + this.btnExitDev.UseVisualStyleBackColor = false; + this.btnExitDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // labelTitle + // + this.labelTitle.BackColor = System.Drawing.Color.Transparent; + this.labelTitle.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelTitle.ForeColor = System.Drawing.Color.White; + this.labelTitle.Location = new System.Drawing.Point(10, 5); + this.labelTitle.Name = "labelTitle"; + this.labelTitle.Size = new System.Drawing.Size(155, 23); + this.labelTitle.TabIndex = 0; + this.labelTitle.Text = "添加送检仪器"; + // + // panel2 + // + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.channelFree); + this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.inputCustName); + this.panel2.Controls.Add(this.label2); + this.panel2.Controls.Add(this.inputCustComp); + this.panel2.Controls.Add(this.inputDevModel); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.label9); + this.panel2.Controls.Add(this.inputDevCode); + this.panel2.Controls.Add(this.inputDevName); + this.panel2.Controls.Add(this.label8); + this.panel2.Controls.Add(this.label5); + this.panel2.Location = new System.Drawing.Point(10, 40); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(580, 121); + this.panel2.TabIndex = 19; + // + // channelFree + // + this.channelFree.DisplayMember = "Text"; + this.channelFree.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.channelFree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.channelFree.FormattingEnabled = true; + this.channelFree.ItemHeight = 18; + this.channelFree.Items.AddRange(new object[] { + this.channel1, + this.channel2, + this.channel3, + this.channel4, + this.channel5}); + this.channelFree.Location = new System.Drawing.Point(400, 87); + this.channelFree.Name = "channelFree"; + this.channelFree.Size = new System.Drawing.Size(150, 24); + this.channelFree.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.channelFree.TabIndex = 6; + // + // channel1 + // + this.channel1.Text = "通道1"; + this.channel1.Value = "1"; + // + // channel2 + // + this.channel2.Text = "通道2"; + this.channel2.Value = "2"; + // + // channel3 + // + this.channel3.Text = "通道3"; + this.channel3.Value = "3"; + // + // channel4 + // + this.channel4.Text = "通道4"; + this.channel4.Value = "4"; + // + // channel5 + // + this.channel5.Text = "通道5"; + this.channel5.Value = "5"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(290, 84); + this.label4.Margin = new System.Windows.Forms.Padding(0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 27); + this.label4.TabIndex = 35; + this.label4.Text = "选择通道"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustName // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX2.Location = new System.Drawing.Point(152, 79); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.Size = new System.Drawing.Size(100, 21); - this.textBoxX2.TabIndex = 10; + this.inputCustName.Border.Class = "TextBoxBorder"; + this.inputCustName.Border.CornerDiameter = 5; + this.inputCustName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustName.Location = new System.Drawing.Point(110, 84); + this.inputCustName.Margin = new System.Windows.Forms.Padding(0); + this.inputCustName.Name = "inputCustName"; + this.inputCustName.PreventEnterBeep = true; + this.inputCustName.Size = new System.Drawing.Size(150, 27); + this.inputCustName.TabIndex = 5; // - // textBoxX3 + // label2 + // + this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(0, 84); + this.label2.Margin = new System.Windows.Forms.Padding(0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(100, 27); + this.label2.TabIndex = 34; + this.label2.Text = "联系人"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustComp // // // // - this.textBoxX3.Border.Class = "TextBoxBorder"; - this.textBoxX3.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX3.Location = new System.Drawing.Point(152, 121); - this.textBoxX3.Name = "textBoxX3"; - this.textBoxX3.PreventEnterBeep = true; - this.textBoxX3.Size = new System.Drawing.Size(100, 21); - this.textBoxX3.TabIndex = 10; + this.inputCustComp.Border.Class = "TextBoxBorder"; + this.inputCustComp.Border.CornerDiameter = 5; + this.inputCustComp.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustComp.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustComp.Location = new System.Drawing.Point(400, 47); + this.inputCustComp.Margin = new System.Windows.Forms.Padding(0); + this.inputCustComp.Name = "inputCustComp"; + this.inputCustComp.PreventEnterBeep = true; + this.inputCustComp.Size = new System.Drawing.Size(150, 27); + this.inputCustComp.TabIndex = 4; // - // textBoxX4 + // inputDevModel // // // // - this.textBoxX4.Border.Class = "TextBoxBorder"; - this.textBoxX4.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX4.Location = new System.Drawing.Point(152, 166); - this.textBoxX4.Name = "textBoxX4"; - this.textBoxX4.PreventEnterBeep = true; - this.textBoxX4.Size = new System.Drawing.Size(100, 21); - this.textBoxX4.TabIndex = 10; + this.inputDevModel.Border.Class = "TextBoxBorder"; + this.inputDevModel.Border.CornerDiameter = 5; + this.inputDevModel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevModel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevModel.Location = new System.Drawing.Point(110, 47); + this.inputDevModel.Margin = new System.Windows.Forms.Padding(0); + this.inputDevModel.Name = "inputDevModel"; + this.inputDevModel.PreventEnterBeep = true; + this.inputDevModel.Size = new System.Drawing.Size(150, 27); + this.inputDevModel.TabIndex = 3; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(290, 47); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 27); + this.label1.TabIndex = 33; + this.label1.Text = "送检单位"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label9.Location = new System.Drawing.Point(0, 47); + this.label9.Margin = new System.Windows.Forms.Padding(0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(100, 27); + this.label9.TabIndex = 32; + this.label9.Text = "仪器型号"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevCode + // + // + // + // + this.inputDevCode.Border.Class = "TextBoxBorder"; + this.inputDevCode.Border.CornerDiameter = 5; + this.inputDevCode.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevCode.Location = new System.Drawing.Point(400, 10); + this.inputDevCode.Margin = new System.Windows.Forms.Padding(0); + this.inputDevCode.Name = "inputDevCode"; + this.inputDevCode.PreventEnterBeep = true; + this.inputDevCode.Size = new System.Drawing.Size(150, 27); + this.inputDevCode.TabIndex = 2; // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(400, 300); + this.ClientSize = new System.Drawing.Size(600, 392); this.ControlBox = false; - this.Controls.Add(this.textBoxX4); - this.Controls.Add(this.textBoxX3); - this.Controls.Add(this.textBoxX2); - this.Controls.Add(this.textBoxX1); - this.Controls.Add(this.btnAddDevCancel); - this.Controls.Add(this.buttonX1); - this.Controls.Add(this.labelX3); - this.Controls.Add(this.labelX4); - this.Controls.Add(this.labelX2); - this.Controls.Add(this.labelX1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Controls.Add(this.checkBox9); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.btnCancelSetDev); + this.Controls.Add(this.panel4); + this.Controls.Add(this.panel3); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AddDevDlg"; this.Text = "添加检测设备"; + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private DevComponents.DotNetBar.ButtonX btnAddDevCancel; - private DevComponents.DotNetBar.ButtonX buttonX1; - private DevComponents.DotNetBar.LabelX labelX3; - private DevComponents.DotNetBar.LabelX labelX4; - private DevComponents.DotNetBar.LabelX labelX2; - private DevComponents.DotNetBar.LabelX labelX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX3; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX4; + + private System.Windows.Forms.CheckBox checkBox9; + private RoundButton btnSave; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox4; + private RoundButton btnCancelSetDev; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel3; + private DevComponents.Editors.DateTimeAdv.DateTimeInput endTimeEst; + private DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; + private System.Windows.Forms.CheckBox checkBox10; + private System.Windows.Forms.CheckBox checkBox11; + private System.Windows.Forms.CheckBox checkBox12; + private System.Windows.Forms.CheckBox checkBox13; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevName; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnExitDev; + private System.Windows.Forms.Label labelTitle; + private System.Windows.Forms.Panel panel2; + private DevComponents.DotNetBar.Controls.ComboBoxEx channelFree; + private System.Windows.Forms.Label label4; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustName; + private System.Windows.Forms.Label label2; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustComp; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevModel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label9; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevCode; + private DevComponents.Editors.ComboItem channel1; + private DevComponents.Editors.ComboItem channel2; + private DevComponents.Editors.ComboItem channel3; + private DevComponents.Editors.ComboItem channel4; + private DevComponents.Editors.ComboItem channel5; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 739e250..652c6b4 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -1,25 +1,76 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.Tools; +using DevComponents.DotNetBar.Controls; +using DevComponents.Editors; +using System; +using System.Runtime.InteropServices; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.info { public partial class AddDevDlg : Form { + #region 无边框拖动效果/最小化窗口/关闭窗口 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + private void panel1_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + public Action HideMaskAction + { + get; + set; + } + public AddDevDlg() { InitializeComponent(); + + ((ComboBoxEx)this.Controls.Find("channelFree", true)[0]).SelectedIndex = 0; } // 关闭对话框 private void btnAddDevCancel_Click(object sender, EventArgs e) { - this.Close(); + this.HideMaskAction(); + } + + // 添加并开始检测 + private void btnSave_Click(object sender, EventArgs e) + { + // 取得输入框的参数 + string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; + string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; + string devModel = ((TextBoxX)this.Controls.Find("inputDevModel", true)[0]).Text; + string devCustomComp = ((TextBoxX)this.Controls.Find("inputCustComp", true)[0]).Text; + string devCustomName = ((TextBoxX)this.Controls.Find("inputCustName", true)[0]).Text; + + ComboBoxEx channels = (ComboBoxEx)this.Controls.Find("channelFree", true)[0]; + string channelNo = (string)((ComboItem)channels.SelectedItem).Value; + + // 初始化数据访问接口 + DeviceService devService = new DeviceServiceImpl(); + int id = devService.add(devName, devCode, "1", devModel, devCustomComp, devCustomName, channelNo); + if (id >= 0) + { + // 添加成功,继续保存检测项目和开始时间 + this.HideMaskAction(); + } + else + { + LogHelper.WriteErrorLog(this.GetType(), "添加设备[" + devName + "]失败"); + } } } } diff --git a/RbFreqStandMeasure/info/DevicesDto.cs b/RbFreqStandMeasure/info/DevicesDto.cs new file mode 100644 index 0000000..872c3b8 --- /dev/null +++ b/RbFreqStandMeasure/info/DevicesDto.cs @@ -0,0 +1,6 @@ +namespace Casic.Birmm.RbFreqStandMeasure.info +{ + internal class DevicesDto + { + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs b/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs index f28a581..aac4b31 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs @@ -41,8 +41,8 @@ this.tested = new DevComponents.Editors.ComboItem(); this.labelDevStatus = new System.Windows.Forms.Label(); this.inputDevName = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.inputDevType = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.inputDevNo = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevModel = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevCode = new DevComponents.DotNetBar.Controls.TextBoxX(); this.inputCustomName = new DevComponents.DotNetBar.Controls.TextBoxX(); this.labelCustomName = new System.Windows.Forms.Label(); this.labelDevNo = new System.Windows.Forms.Label(); @@ -50,20 +50,31 @@ this.inputCustomComp = new DevComponents.DotNetBar.Controls.TextBoxX(); this.labelCustomComp = new System.Windows.Forms.Label(); this.labelDevName = new System.Windows.Forms.Label(); + this.btnNext = new System.Windows.Forms.Button(); + this.btnPre = new System.Windows.Forms.Button(); + this.labelPageCount = new System.Windows.Forms.Label(); + this.labelCurrentPage = new System.Windows.Forms.Label(); + this.panelPage = new System.Windows.Forms.Panel(); + this.panelNodata = new System.Windows.Forms.Panel(); + this.labelNodata = new System.Windows.Forms.Label(); this.btnExport = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnDetail = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnAdd = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.benEdit = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnEdit = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnQuery = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tableDevList)).BeginInit(); this.panel2.SuspendLayout(); + this.panelPage.SuspendLayout(); + this.panelNodata.SuspendLayout(); this.SuspendLayout(); // // panel1 // this.panel1.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_dev_list; + this.panel1.Controls.Add(this.panelNodata); + this.panel1.Controls.Add(this.panelPage); this.panel1.Controls.Add(this.tableDevList); this.panel1.Controls.Add(this.panel2); this.panel1.Location = new System.Drawing.Point(10, 5); @@ -91,7 +102,7 @@ this.tableDevList.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.tableDevList.ColumnHeadersHeight = 40; this.tableDevList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.tableDevList.Location = new System.Drawing.Point(20, 120); + this.tableDevList.Location = new System.Drawing.Point(20, 100); this.tableDevList.Margin = new System.Windows.Forms.Padding(0); this.tableDevList.Name = "tableDevList"; this.tableDevList.ReadOnly = true; @@ -106,9 +117,9 @@ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.tableDevList.RowsDefaultCellStyle = dataGridViewCellStyle2; - this.tableDevList.RowTemplate.Height = 40; + this.tableDevList.RowTemplate.Height = 44; this.tableDevList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.tableDevList.Size = new System.Drawing.Size(964, 440); + this.tableDevList.Size = new System.Drawing.Size(964, 480); this.tableDevList.TabIndex = 2; // // panel2 @@ -117,14 +128,14 @@ this.panel2.Controls.Add(this.btnExport); this.panel2.Controls.Add(this.btnDetail); this.panel2.Controls.Add(this.btnAdd); - this.panel2.Controls.Add(this.benDelete); - this.panel2.Controls.Add(this.benEdit); + this.panel2.Controls.Add(this.btnDelete); + this.panel2.Controls.Add(this.btnEdit); this.panel2.Controls.Add(this.inputDevStatus); this.panel2.Controls.Add(this.labelDevStatus); this.panel2.Controls.Add(this.btnQuery); this.panel2.Controls.Add(this.inputDevName); - this.panel2.Controls.Add(this.inputDevType); - this.panel2.Controls.Add(this.inputDevNo); + this.panel2.Controls.Add(this.inputDevModel); + this.panel2.Controls.Add(this.inputDevCode); this.panel2.Controls.Add(this.inputCustomName); this.panel2.Controls.Add(this.labelCustomName); this.panel2.Controls.Add(this.labelDevNo); @@ -146,9 +157,9 @@ this.inputDevStatus.ItemHeight = 20; this.inputDevStatus.Items.AddRange(new object[] { this.All, - this.tested, + this.toBeTested, this.testing, - this.toBeTested}); + this.tested}); this.inputDevStatus.Location = new System.Drawing.Point(560, 43); this.inputDevStatus.Margin = new System.Windows.Forms.Padding(0); this.inputDevStatus.MaximumSize = new System.Drawing.Size(150, 0); @@ -163,15 +174,18 @@ // // toBeTested // - this.toBeTested.Text = "已检测"; + this.toBeTested.Text = "待检测"; + this.toBeTested.Value = "1"; // // testing // this.testing.Text = "检测中"; + this.testing.Value = "2"; // // tested // - this.tested.Text = "待检测"; + this.tested.Text = "已检测"; + this.tested.Value = "3"; // // labelDevStatus // @@ -204,44 +218,50 @@ this.inputDevName.Size = new System.Drawing.Size(150, 26); this.inputDevName.TabIndex = 9; this.inputDevName.Text = "请输入仪器名称"; + this.inputDevName.Click += new System.EventHandler(this.inputDevName_Click); + this.inputDevName.Leave += new System.EventHandler(this.inputDevName_Leave); // - // inputDevType + // inputDevModel // // // // - this.inputDevType.Border.Class = "TextBoxBorder"; - this.inputDevType.Border.CornerDiameter = 5; - this.inputDevType.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.inputDevType.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.inputDevType.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.inputDevType.Location = new System.Drawing.Point(320, 3); - this.inputDevType.Margin = new System.Windows.Forms.Padding(0); - this.inputDevType.MaximumSize = new System.Drawing.Size(150, 26); - this.inputDevType.Name = "inputDevType"; - this.inputDevType.PreventEnterBeep = true; - this.inputDevType.Size = new System.Drawing.Size(150, 26); - this.inputDevType.TabIndex = 8; - this.inputDevType.Text = "请输入仪器型号"; + this.inputDevModel.Border.Class = "TextBoxBorder"; + this.inputDevModel.Border.CornerDiameter = 5; + this.inputDevModel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevModel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevModel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.inputDevModel.Location = new System.Drawing.Point(320, 3); + this.inputDevModel.Margin = new System.Windows.Forms.Padding(0); + this.inputDevModel.MaximumSize = new System.Drawing.Size(150, 26); + this.inputDevModel.Name = "inputDevModel"; + this.inputDevModel.PreventEnterBeep = true; + this.inputDevModel.Size = new System.Drawing.Size(150, 26); + this.inputDevModel.TabIndex = 8; + this.inputDevModel.Text = "请输入仪器型号"; + this.inputDevModel.Click += new System.EventHandler(this.inputDevModel_Click); + this.inputDevModel.Leave += new System.EventHandler(this.inputDevModel_Leave); // - // inputDevNo + // inputDevCode // // // // - this.inputDevNo.Border.Class = "TextBoxBorder"; - this.inputDevNo.Border.CornerDiameter = 5; - this.inputDevNo.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.inputDevNo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.inputDevNo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.inputDevNo.Location = new System.Drawing.Point(560, 3); - this.inputDevNo.Margin = new System.Windows.Forms.Padding(0); - this.inputDevNo.MaximumSize = new System.Drawing.Size(150, 26); - this.inputDevNo.Name = "inputDevNo"; - this.inputDevNo.PreventEnterBeep = true; - this.inputDevNo.Size = new System.Drawing.Size(150, 26); - this.inputDevNo.TabIndex = 7; - this.inputDevNo.Text = "请输入仪器编号"; + this.inputDevCode.Border.Class = "TextBoxBorder"; + this.inputDevCode.Border.CornerDiameter = 5; + this.inputDevCode.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.inputDevCode.Location = new System.Drawing.Point(560, 3); + this.inputDevCode.Margin = new System.Windows.Forms.Padding(0); + this.inputDevCode.MaximumSize = new System.Drawing.Size(150, 26); + this.inputDevCode.Name = "inputDevCode"; + this.inputDevCode.PreventEnterBeep = true; + this.inputDevCode.Size = new System.Drawing.Size(150, 26); + this.inputDevCode.TabIndex = 7; + this.inputDevCode.Text = "请输入仪器编号"; + this.inputDevCode.Click += new System.EventHandler(this.inputDevCode_Click); + this.inputDevCode.Leave += new System.EventHandler(this.inputDevCode_Leave); // // inputCustomName // @@ -260,11 +280,12 @@ this.inputCustomName.PreventEnterBeep = true; this.inputCustomName.Size = new System.Drawing.Size(150, 26); this.inputCustomName.TabIndex = 6; - this.inputCustomName.Text = "请输入客户名称"; + this.inputCustomName.Text = "请输入联系人"; + this.inputCustomName.Click += new System.EventHandler(this.inputCustomName_Click); + this.inputCustomName.Leave += new System.EventHandler(this.inputCustomName_Leave); // // labelCustomName // - this.labelCustomName.AutoSize = true; this.labelCustomName.BackColor = System.Drawing.Color.Transparent; this.labelCustomName.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.labelCustomName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); @@ -273,7 +294,8 @@ this.labelCustomName.Name = "labelCustomName"; this.labelCustomName.Size = new System.Drawing.Size(74, 21); this.labelCustomName.TabIndex = 5; - this.labelCustomName.Text = "客户名称"; + this.labelCustomName.Text = "联系人"; + this.labelCustomName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // labelDevNo // @@ -319,7 +341,9 @@ this.inputCustomComp.PreventEnterBeep = true; this.inputCustomComp.Size = new System.Drawing.Size(150, 26); this.inputCustomComp.TabIndex = 3; - this.inputCustomComp.Text = "请输入单位名称"; + this.inputCustomComp.Text = "请输入送检单位名称"; + this.inputCustomComp.Click += new System.EventHandler(this.inputCustomComp_Click); + this.inputCustomComp.Leave += new System.EventHandler(this.inputCustomComp_Leave); // // labelCustomComp // @@ -332,7 +356,7 @@ this.labelCustomComp.Name = "labelCustomComp"; this.labelCustomComp.Size = new System.Drawing.Size(74, 21); this.labelCustomComp.TabIndex = 0; - this.labelCustomComp.Text = "客户单位"; + this.labelCustomComp.Text = "送检单位"; // // labelDevName // @@ -347,6 +371,85 @@ this.labelDevName.TabIndex = 0; this.labelDevName.Text = "仪器名称"; // + // btnNext + // + this.btnNext.BackColor = System.Drawing.Color.Transparent; + this.btnNext.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_page_next; + this.btnNext.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.btnNext.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnNext.Location = new System.Drawing.Point(950, 0); + this.btnNext.Name = "btnNext"; + this.btnNext.Size = new System.Drawing.Size(16, 16); + this.btnNext.TabIndex = 317; + this.btnNext.UseVisualStyleBackColor = false; + this.btnNext.Click += new System.EventHandler(this.btnNext_Click); + // + // btnPre + // + this.btnPre.BackColor = System.Drawing.Color.Transparent; + this.btnPre.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_page_pre; + this.btnPre.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.btnPre.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnPre.Location = new System.Drawing.Point(890, 0); + this.btnPre.Name = "btnPre"; + this.btnPre.Size = new System.Drawing.Size(16, 16); + this.btnPre.TabIndex = 318; + this.btnPre.UseVisualStyleBackColor = false; + this.btnPre.Click += new System.EventHandler(this.btnPre_Click); + // + // labelPageCount + // + this.labelPageCount.AutoSize = true; + this.labelPageCount.BackColor = System.Drawing.Color.Transparent; + this.labelPageCount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelPageCount.Location = new System.Drawing.Point(690, 0); + this.labelPageCount.Name = "labelPageCount"; + this.labelPageCount.Size = new System.Drawing.Size(151, 17); + this.labelPageCount.TabIndex = 315; + this.labelPageCount.Text = "共10条,每页10条,共2页"; + // + // labelCurrentPage + // + this.labelCurrentPage.AutoSize = true; + this.labelCurrentPage.BackColor = System.Drawing.Color.Transparent; + this.labelCurrentPage.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelCurrentPage.Location = new System.Drawing.Point(920, 0); + this.labelCurrentPage.Name = "labelCurrentPage"; + this.labelCurrentPage.Size = new System.Drawing.Size(15, 17); + this.labelCurrentPage.TabIndex = 315; + this.labelCurrentPage.Text = "1"; + // + // panelPage + // + this.panelPage.BackColor = System.Drawing.Color.Transparent; + this.panelPage.Controls.Add(this.labelPageCount); + this.panelPage.Controls.Add(this.btnNext); + this.panelPage.Controls.Add(this.btnPre); + this.panelPage.Controls.Add(this.labelCurrentPage); + this.panelPage.Location = new System.Drawing.Point(10, 595); + this.panelPage.Name = "panelPage"; + this.panelPage.Size = new System.Drawing.Size(984, 20); + this.panelPage.TabIndex = 319; + // + // panelNodata + // + this.panelNodata.BackColor = System.Drawing.Color.Transparent; + this.panelNodata.Controls.Add(this.labelNodata); + this.panelNodata.Location = new System.Drawing.Point(10, 140); + this.panelNodata.Name = "panelNodata"; + this.panelNodata.Size = new System.Drawing.Size(984, 40); + this.panelNodata.TabIndex = 320; + // + // labelNodata + // + this.labelNodata.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelNodata.Location = new System.Drawing.Point(0, 0); + this.labelNodata.Name = "labelNodata"; + this.labelNodata.Size = new System.Drawing.Size(984, 50); + this.labelNodata.TabIndex = 0; + this.labelNodata.Text = "没有搜索到数据"; + this.labelNodata.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // btnExport // this.btnExport.EnterBackColor = System.Drawing.Color.Blue; @@ -392,6 +495,7 @@ this.btnDetail.TabIndex = 13; this.btnDetail.Text = "详情"; this.btnDetail.UseVisualStyleBackColor = true; + this.btnDetail.Click += new System.EventHandler(this.btnDetail_Click); // // btnAdd // @@ -417,51 +521,52 @@ this.btnAdd.UseVisualStyleBackColor = true; this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); // - // benDelete + // btnDelete // - this.benDelete.EnterBackColor = System.Drawing.Color.Blue; - this.benDelete.EnterForeColor = System.Drawing.Color.White; - this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.benDelete.FlatAppearance.BorderSize = 0; - this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); - this.benDelete.HoverForeColor = System.Drawing.Color.White; - this.benDelete.Location = new System.Drawing.Point(890, 43); - this.benDelete.Margin = new System.Windows.Forms.Padding(0); - this.benDelete.Name = "benDelete"; - this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; - this.benDelete.PressForeColor = System.Drawing.Color.White; - this.benDelete.Radius = 5; - this.benDelete.Size = new System.Drawing.Size(70, 26); - this.benDelete.TabIndex = 12; - this.benDelete.Text = "删除"; - this.benDelete.UseVisualStyleBackColor = true; + this.btnDelete.EnterBackColor = System.Drawing.Color.Blue; + this.btnDelete.EnterForeColor = System.Drawing.Color.White; + this.btnDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnDelete.FlatAppearance.BorderSize = 0; + this.btnDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btnDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); + this.btnDelete.HoverForeColor = System.Drawing.Color.White; + this.btnDelete.Location = new System.Drawing.Point(890, 43); + this.btnDelete.Margin = new System.Windows.Forms.Padding(0); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnDelete.PressForeColor = System.Drawing.Color.White; + this.btnDelete.Radius = 5; + this.btnDelete.Size = new System.Drawing.Size(70, 26); + this.btnDelete.TabIndex = 12; + this.btnDelete.Text = "删除"; + this.btnDelete.UseVisualStyleBackColor = true; // - // benEdit + // btnEdit // - this.benEdit.EnterBackColor = System.Drawing.Color.Blue; - this.benEdit.EnterForeColor = System.Drawing.Color.White; - this.benEdit.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.benEdit.FlatAppearance.BorderSize = 0; - this.benEdit.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.benEdit.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.benEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.benEdit.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.benEdit.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.benEdit.HoverForeColor = System.Drawing.Color.White; - this.benEdit.Location = new System.Drawing.Point(810, 43); - this.benEdit.Margin = new System.Windows.Forms.Padding(0); - this.benEdit.Name = "benEdit"; - this.benEdit.PressBackColor = System.Drawing.Color.DarkBlue; - this.benEdit.PressForeColor = System.Drawing.Color.White; - this.benEdit.Radius = 5; - this.benEdit.Size = new System.Drawing.Size(70, 26); - this.benEdit.TabIndex = 10; - this.benEdit.Text = "修改"; - this.benEdit.UseVisualStyleBackColor = true; + this.btnEdit.EnterBackColor = System.Drawing.Color.Blue; + this.btnEdit.EnterForeColor = System.Drawing.Color.White; + this.btnEdit.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnEdit.FlatAppearance.BorderSize = 0; + this.btnEdit.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnEdit.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnEdit.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btnEdit.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnEdit.HoverForeColor = System.Drawing.Color.White; + this.btnEdit.Location = new System.Drawing.Point(810, 43); + this.btnEdit.Margin = new System.Windows.Forms.Padding(0); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnEdit.PressForeColor = System.Drawing.Color.White; + this.btnEdit.Radius = 5; + this.btnEdit.Size = new System.Drawing.Size(70, 26); + this.btnEdit.TabIndex = 10; + this.btnEdit.Text = "修改"; + this.btnEdit.UseVisualStyleBackColor = true; + this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); // // btnQuery // @@ -485,6 +590,7 @@ this.btnQuery.TabIndex = 10; this.btnQuery.Text = "查询"; this.btnQuery.UseVisualStyleBackColor = true; + this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click); // // InfoCtrlForm // @@ -499,6 +605,9 @@ ((System.ComponentModel.ISupportInitialize)(this.tableDevList)).EndInit(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); + this.panelPage.ResumeLayout(false); + this.panelPage.PerformLayout(); + this.panelNodata.ResumeLayout(false); this.ResumeLayout(false); } @@ -514,21 +623,28 @@ private System.Windows.Forms.Label labelCustomComp; private System.Windows.Forms.Label labelCustomName; private DevComponents.DotNetBar.Controls.TextBoxX inputCustomName; - private DevComponents.DotNetBar.Controls.TextBoxX inputDevNo; - private DevComponents.DotNetBar.Controls.TextBoxX inputDevType; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevCode; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevModel; private DevComponents.DotNetBar.Controls.TextBoxX inputDevName; private RoundButton btnQuery; private System.Windows.Forms.Label labelDevStatus; private DevComponents.DotNetBar.Controls.ComboBoxEx inputDevStatus; private DevComponents.Editors.ComboItem All; - private DevComponents.Editors.ComboItem toBeTested; - private DevComponents.Editors.ComboItem testing; private DevComponents.Editors.ComboItem tested; - private RoundButton benEdit; + private DevComponents.Editors.ComboItem testing; + private DevComponents.Editors.ComboItem toBeTested; + private RoundButton btnEdit; private RoundButton btnAdd; - private RoundButton benDelete; + private RoundButton btnDelete; private RoundButton btnDetail; private RoundButton btnExport; private System.Windows.Forms.DataGridView tableDevList; + private System.Windows.Forms.Button btnNext; + private System.Windows.Forms.Button btnPre; + private System.Windows.Forms.Label labelPageCount; + private System.Windows.Forms.Label labelCurrentPage; + private System.Windows.Forms.Panel panelPage; + private System.Windows.Forms.Panel panelNodata; + private System.Windows.Forms.Label labelNodata; } } diff --git a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs index 19ec91c..963b90b 100644 --- a/RbFreqStandMeasure/R_DataBase/DbConnectService.cs +++ b/RbFreqStandMeasure/R_DataBase/DbConnectService.cs @@ -28,7 +28,8 @@ + ";database=" + databaseName + ";password=" + databasePassword + ";Charset=utf8" - + ";Allow User Variables=True"; + + ";Allow User Variables=True" + + ";Pooling=true"; mySqlConnect = new MySqlConnection(sConnection); mySqlConnect.Open(); iRetval = 0; @@ -41,6 +42,22 @@ return iRetval; } + public static MySqlConnection getConnection() + { + string sConnection = "server=" + server + + ";port=" + databasePort + + ";user=" + databaseUser + + ";database=" + databaseName + + ";password=" + databasePassword + + ";Charset=utf8" + + ";Allow User Variables=True" + + ";Pooling=true"; + MySqlConnection conn = new MySqlConnection(sConnection); + conn.Open(); + + return conn; + } + public static int closeDb() { int iRetval = -1; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs index 01c45a9..274cc10 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DeviceService.cs @@ -8,18 +8,19 @@ { interface DeviceService { - int add(string devName,string devCode,string devTypeId,string devModel, string custometDev, - string customerName,string channel); + int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); - int update(int id, string devName, string devCode, string devTypeId, string devModel, - string custometDev, string customerName, string channel); + int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel); int delete(int id); - List search(string devName,string devCode, string devModel, string suctomerDev, - string customerName,string statusId); + List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId); + List searchPage(string devName, string devCode, string devModel, + string customDev, string customName, string statusId, + int page, int limit); + int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId); - List getAllCounter(string devTypeId); } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index d479b79..3f9b926 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -11,12 +11,13 @@ namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { - class DeviceServiceImpl:DeviceService + class DeviceServiceImpl : DeviceService { - public int add(string devName, string devCode, string devTypeId, string devModel, + public int add(string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; + //DetectionItemService detectionItemService = new DetectionItemServiceImpl(); try { @@ -54,7 +55,7 @@ return iRetval; } - public int update(int id, string devName, string devCode, string devTypeId, string devModel, + public int update(int id, string devName, string devCode, string devTypeId, string devModel, string custometDev, string customerName, string channel) { int iRetval = -1; @@ -124,7 +125,7 @@ public List search(string devName, string devCode, string devModel, string suctomerDev, string customerName, string statusId) { - + List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); @@ -144,12 +145,12 @@ sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) sQry += " and DEV_MODEL like '%" + devModel + "%'"; - if(suctomerDev!=""&&suctomerDev!=null) - sQry+= " and CUSTOMER_DEV like '%"+ suctomerDev + "%'"; + if (suctomerDev != "" && suctomerDev != null) + sQry += " and CUSTOMER_DEV like '%" + suctomerDev + "%'"; if (customerName != "" && customerName != null) sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; if (statusId != "" && statusId != null) - sQry += "and STATUSID = " + statusId; + sQry += " and STATUSID = " + statusId; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); @@ -181,6 +182,7 @@ } aCommand.Dispose(); + } } catch (MySqlException ex) @@ -192,52 +194,142 @@ return deviceDtoList; } - public List getAllCounter(string devTypeId) + public List searchPage(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId, + int page, int limit) { List deviceDtoList = new List(); DictService dictService = new DictServiceImpl(); + MySqlConnection conn = null; + try { - string sql = "SELECT * FROM r_device where active = 0 and DEV_TYPEID = 2"; + conn = DbConnectService.getConnection(); - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + string sQry = "SELECT * FROM r_device where active = " + 0; - MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; - while (aReader.Read()) + sQry += " limit " + limit + " offset " + (page - 1) * limit; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) { - DeviceDto deviceDto = new DeviceDto(); - - if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); - if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); - if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); - if (!aReader.IsDBNull(3)) + while (aReader.Read()) { - deviceDto.DevTypeId = aReader.GetString(3); - deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); - } - if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); - if (!aReader.IsDBNull(5)) deviceDto.CustomerName = aReader.GetString(5); - if (!aReader.IsDBNull(6)) deviceDto.CustomerDev = aReader.GetString(6); - if (!aReader.IsDBNull(7)) - { - deviceDto.StatusId = aReader.GetString(7); - deviceDto.StatusName = dictService.getNameByCode("devStatus", aReader.GetString(7)); - } - if (!aReader.IsDBNull(8)) deviceDto.Channel = aReader.GetString(8); + DeviceDto deviceDto = new DeviceDto(); - deviceDtoList.Add(deviceDto); + if (!aReader.IsDBNull(0)) deviceDto.Id = Convert.ToInt32(aReader.GetString(0)); // id + if (!aReader.IsDBNull(1)) deviceDto.DevName = aReader.GetString(1); // devName + if (!aReader.IsDBNull(2)) deviceDto.DevCode = aReader.GetString(2); // devCode + if (!aReader.IsDBNull(3)) + { + deviceDto.DevTypeId = aReader.GetString(3); // devType + deviceDto.DevTypeName = dictService.getNameByCode("devType", aReader.GetString(3)); + } + if (!aReader.IsDBNull(4)) deviceDto.DevModel = aReader.GetString(4); // devModel + if (!aReader.IsDBNull(5)) + { + DateTime reg = aReader.GetDateTime(5); // regTime + deviceDto.RegTime = reg.ToString("yyyy-MM-dd"); + } + if (!aReader.IsDBNull(6)) deviceDto.CustomerName = aReader.GetString(6); // customName + if (!aReader.IsDBNull(7)) deviceDto.CustomerDev = aReader.GetString(7); // customDev + if (!aReader.IsDBNull(8)) + { + deviceDto.StatusId = aReader.GetString(8); // devStatus + deviceDto.StatusName = dictService.getNameByCode("devStatus", deviceDto.StatusId); + } + if (!aReader.IsDBNull(9)) deviceDto.Channel = aReader.GetString(9); + + deviceDtoList.Add(deviceDto); + } + + aCommand.Dispose(); + } - - cmd.Dispose(); } - catch(MySqlException ex) + catch (MySqlException ex) { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getAllCounter: " + ex.Message); + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "searchDevice: " + ex.Message); deviceDtoList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + return deviceDtoList; } + public int getTotalCount(string devName, string devCode, string devModel, + string customDev, string customerName, string statusId) + { + int totalCount = 0; + MySqlConnection conn = null; + + try + { + conn = DbConnectService.getConnection(); + + string sQry = "SELECT count(id) FROM r_device where active = " + 0; + + if (devName != "" && devName != null) + sQry += " and DEV_NAME like '%" + devName + "%'"; + if (devCode != "" && devCode != null) + sQry += " and DEV_CODE like '%" + devCode + "%'"; + if (devModel != "" && devModel != null) + sQry += " and DEV_MODEL like '%" + devModel + "%'"; + if (customDev != "" && customDev != null) + sQry += " and CUSTOMER_DEV like '%" + customDev + "%'"; + if (customerName != "" && customerName != null) + sQry += " and CUSTOMER_NAME like '%" + customerName + "%'"; + if (statusId != "" && statusId != null) + sQry += " and STATUSID = " + statusId; + + MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + + using (MySqlDataReader aReader = aCommand.ExecuteReader()) + { + while (aReader.Read()) + { + totalCount = aReader.GetInt32(0); + } + + aCommand.Dispose(); + } + } + catch (MySqlException ex) + { + LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTotalCount: " + ex.Message); + totalCount = 0; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); //用完即关闭连接 + } + } + + return totalCount; + } } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs index 04f5244..05fcfb3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DictServiceImpl.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Reflection; -using System.Text; namespace Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl { @@ -14,12 +12,14 @@ public String getNameByCode(string codeType,string code) { String name = ""; + MySqlConnection conn = null; try { string sql = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "') and code = " + code; - - MySqlCommand cmd = new MySqlCommand(sql, DbConnectService.mySqlConnect); + + conn = DbConnectService.getConnection(); + MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader aReader = cmd.ExecuteReader(CommandBehavior.Default); @@ -35,6 +35,7 @@ } } + aReader.Close(); cmd.Dispose(); return name; } @@ -42,6 +43,14 @@ { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getNameByCode: " + ex.Message); name = ""; + } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } } return name; } @@ -49,16 +58,13 @@ public List getTypeListByCodeType(string codeType) { List nameList = new List(); + MySqlConnection conn = null; try { - if (DbConnectService.mySqlConnect.State == ConnectionState.Closed) - { - LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType : 数据库链接断开"); - return null; - } + conn = DbConnectService.getConnection(); string sQry = "SELECT name FROM r_dict where pid = (select id from r_dict where code = '" + codeType + "')"; - MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); + MySqlCommand aCommand = new MySqlCommand(sQry, conn); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { @@ -69,6 +75,8 @@ } aCommand.Dispose(); + conn.Close(); + conn.Dispose(); // 用完即关闭连接 } } catch(MySqlException ex) @@ -76,10 +84,16 @@ LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "getTypeListByCodeType: " + ex.Message); nameList = null; } + finally + { + if (null != conn) + { + conn.Close(); + conn.Dispose(); // 用完即关闭连接 + } + } return nameList; } - - } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 271e20a..472a36a 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -447,7 +447,6 @@ devTestDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 devTestDlg.ShowDialog(); } - } private void tableChannel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index fee0aae..b6b9993 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -29,174 +29,692 @@ /// private void InitializeComponent() { - this.btnAddDevCancel = new DevComponents.DotNetBar.ButtonX(); - this.buttonX1 = new DevComponents.DotNetBar.ButtonX(); - this.labelX3 = new DevComponents.DotNetBar.LabelX(); - this.labelX4 = new DevComponents.DotNetBar.LabelX(); - this.labelX2 = new DevComponents.DotNetBar.LabelX(); - this.labelX1 = new DevComponents.DotNetBar.LabelX(); - this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX3 = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.textBoxX4 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label6 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.endTimeEst = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.checkBox10 = new System.Windows.Forms.CheckBox(); + this.checkBox11 = new System.Windows.Forms.CheckBox(); + this.checkBox12 = new System.Windows.Forms.CheckBox(); + this.checkBox13 = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.inputDevName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label8 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnExitDev = new System.Windows.Forms.Button(); + this.labelTitle = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.channelFree = new DevComponents.DotNetBar.Controls.ComboBoxEx(); + this.channel1 = new DevComponents.Editors.ComboItem(); + this.channel2 = new DevComponents.Editors.ComboItem(); + this.channel3 = new DevComponents.Editors.ComboItem(); + this.channel4 = new DevComponents.Editors.ComboItem(); + this.channel5 = new DevComponents.Editors.ComboItem(); + this.label4 = new System.Windows.Forms.Label(); + this.inputCustName = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label2 = new System.Windows.Forms.Label(); + this.inputCustComp = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevModel = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label1 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.inputDevCode = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.panel4.SuspendLayout(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).BeginInit(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // - // btnAddDevCancel + // checkBox9 // - this.btnAddDevCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnAddDevCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnAddDevCancel.Location = new System.Drawing.Point(216, 228); - this.btnAddDevCancel.Name = "btnAddDevCancel"; - this.btnAddDevCancel.Size = new System.Drawing.Size(75, 23); - this.btnAddDevCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnAddDevCancel.TabIndex = 8; - this.btnAddDevCancel.Text = "取消"; - this.btnAddDevCancel.Click += new System.EventHandler(this.btnAddDevCancel_Click); + this.checkBox9.AutoSize = true; + this.checkBox9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox9.Location = new System.Drawing.Point(506, 348); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(84, 24); + this.checkBox9.TabIndex = 19; + this.checkBox9.Text = "立即开始"; + this.checkBox9.UseVisualStyleBackColor = true; // - // buttonX1 + // btnSave // - this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.buttonX1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.buttonX1.Location = new System.Drawing.Point(108, 228); - this.buttonX1.Name = "buttonX1"; - this.buttonX1.Size = new System.Drawing.Size(75, 23); - this.buttonX1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.buttonX1.TabIndex = 9; - this.buttonX1.Text = "添加"; + this.btnSave.EnterBackColor = System.Drawing.Color.Blue; + this.btnSave.EnterForeColor = System.Drawing.Color.White; + this.btnSave.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnSave.FlatAppearance.BorderSize = 0; + this.btnSave.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSave.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(47)))), ((int)(((byte)(111)))), ((int)(((byte)(198))))); + this.btnSave.HoverForeColor = System.Drawing.Color.White; + this.btnSave.Location = new System.Drawing.Point(150, 342); + this.btnSave.Name = "btnSave"; + this.btnSave.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnSave.PressForeColor = System.Drawing.Color.White; + this.btnSave.Radius = 5; + this.btnSave.Size = new System.Drawing.Size(120, 30); + this.btnSave.TabIndex = 17; + this.btnSave.Text = "开始检测"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // labelX3 + // label6 + // + this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(0, 10); + this.label6.Margin = new System.Windows.Forms.Padding(0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 27); + this.label6.TabIndex = 38; + this.label6.Text = "频率稳定度"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox1.Location = new System.Drawing.Point(420, 12); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(60, 24); + this.checkBox1.TabIndex = 16; + this.checkBox1.Text = "100S"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox2.Location = new System.Drawing.Point(326, 12); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(52, 24); + this.checkBox2.TabIndex = 15; + this.checkBox2.Text = "20S"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox3.Location = new System.Drawing.Point(218, 12); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(52, 24); + this.checkBox3.TabIndex = 14; + this.checkBox3.Text = "10S"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox4.Location = new System.Drawing.Point(110, 12); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(44, 24); + this.checkBox4.TabIndex = 13; + this.checkBox4.Text = "1S"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // btnCancelSetDev + // + this.btnCancelSetDev.EnterBackColor = System.Drawing.Color.Blue; + this.btnCancelSetDev.EnterForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnCancelSetDev.FlatAppearance.BorderSize = 0; + this.btnCancelSetDev.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnCancelSetDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCancelSetDev.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCancelSetDev.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnCancelSetDev.HoverForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Location = new System.Drawing.Point(310, 342); + this.btnCancelSetDev.Name = "btnCancelSetDev"; + this.btnCancelSetDev.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnCancelSetDev.PressForeColor = System.Drawing.Color.White; + this.btnCancelSetDev.Radius = 5; + this.btnCancelSetDev.Size = new System.Drawing.Size(120, 30); + this.btnCancelSetDev.TabIndex = 18; + this.btnCancelSetDev.Text = "取消"; + this.btnCancelSetDev.UseVisualStyleBackColor = true; + this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // panel4 + // + this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel4.Controls.Add(this.label6); + this.panel4.Controls.Add(this.checkBox1); + this.panel4.Controls.Add(this.checkBox2); + this.panel4.Controls.Add(this.checkBox3); + this.panel4.Controls.Add(this.checkBox4); + this.panel4.Location = new System.Drawing.Point(10, 265); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(580, 47); + this.panel4.TabIndex = 21; + // + // panel3 + // + this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel3.Controls.Add(this.endTimeEst); + this.panel3.Controls.Add(this.startTime); + this.panel3.Controls.Add(this.checkBox10); + this.panel3.Controls.Add(this.checkBox11); + this.panel3.Controls.Add(this.checkBox12); + this.panel3.Controls.Add(this.checkBox13); + this.panel3.Controls.Add(this.label3); + this.panel3.Controls.Add(this.label12); + this.panel3.Controls.Add(this.label13); + this.panel3.Location = new System.Drawing.Point(10, 171); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(580, 84); + this.panel3.TabIndex = 20; + // + // endTimeEst // // // // - this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX3.Location = new System.Drawing.Point(60, 166); - this.labelX3.Name = "labelX3"; - this.labelX3.Size = new System.Drawing.Size(75, 23); - this.labelX3.TabIndex = 3; - this.labelX3.Text = "客户单位"; - // - // labelX4 + this.endTimeEst.BackgroundStyle.Class = "DateTimeInputBackground"; + this.endTimeEst.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.endTimeEst.ButtonDropDown.Visible = true; + this.endTimeEst.CustomFormat = "yyyy-MM-dd HH:mm"; + this.endTimeEst.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.endTimeEst.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.endTimeEst.IsPopupCalendarOpen = false; + this.endTimeEst.Location = new System.Drawing.Point(390, 49); // // // // - this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX4.Location = new System.Drawing.Point(60, 121); - this.labelX4.Name = "labelX4"; - this.labelX4.Size = new System.Drawing.Size(75, 23); - this.labelX4.TabIndex = 4; - this.labelX4.Text = "仪器名称"; // - // labelX2 + // + this.endTimeEst.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.endTimeEst.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.endTimeEst.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.endTimeEst.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.endTimeEst.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.endTimeEst.MonthCalendar.TodayButtonVisible = true; + this.endTimeEst.Name = "endTimeEst"; + this.endTimeEst.ShowUpDown = true; + this.endTimeEst.Size = new System.Drawing.Size(180, 23); + this.endTimeEst.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.endTimeEst.TabIndex = 12; + this.endTimeEst.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // startTime // // // // - this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX2.Location = new System.Drawing.Point(60, 79); - this.labelX2.Name = "labelX2"; - this.labelX2.Size = new System.Drawing.Size(75, 23); - this.labelX2.TabIndex = 5; - this.labelX2.Text = "仪器编号"; - // - // labelX1 + this.startTime.BackgroundStyle.Class = "DateTimeInputBackground"; + this.startTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.startTime.ButtonDropDown.Visible = true; + this.startTime.CustomFormat = "yyyy-MM-dd HH:mm"; + this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.startTime.IsPopupCalendarOpen = false; + this.startTime.Location = new System.Drawing.Point(110, 49); // // // // - this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.labelX1.Location = new System.Drawing.Point(60, 35); - this.labelX1.Name = "labelX1"; - this.labelX1.Size = new System.Drawing.Size(75, 23); - this.labelX1.TabIndex = 7; - this.labelX1.Text = "仪器型号"; // - // textBoxX1 + // + this.startTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.startTime.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.startTime.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.startTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.DisplayMonth = new System.DateTime(2021, 3, 1, 0, 0, 0, 0); + this.startTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.startTime.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.startTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.startTime.MonthCalendar.TodayButtonVisible = true; + this.startTime.Name = "startTime"; + this.startTime.ShowUpDown = true; + this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.startTime.TabIndex = 11; + this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); + // + // checkBox10 + // + this.checkBox10.AutoSize = true; + this.checkBox10.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox10.Location = new System.Drawing.Point(420, 12); + this.checkBox10.Name = "checkBox10"; + this.checkBox10.Size = new System.Drawing.Size(84, 24); + this.checkBox10.TabIndex = 10; + this.checkBox10.Text = "日老化率"; + this.checkBox10.UseVisualStyleBackColor = true; + // + // checkBox11 + // + this.checkBox11.AutoSize = true; + this.checkBox11.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox11.Location = new System.Drawing.Point(326, 12); + this.checkBox11.Name = "checkBox11"; + this.checkBox11.Size = new System.Drawing.Size(84, 24); + this.checkBox11.TabIndex = 9; + this.checkBox11.Text = "开机特性"; + this.checkBox11.UseVisualStyleBackColor = true; + // + // checkBox12 + // + this.checkBox12.AutoSize = true; + this.checkBox12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox12.Location = new System.Drawing.Point(218, 12); + this.checkBox12.Name = "checkBox12"; + this.checkBox12.Size = new System.Drawing.Size(98, 24); + this.checkBox12.TabIndex = 8; + this.checkBox12.Text = "频率准确度"; + this.checkBox12.UseVisualStyleBackColor = true; + // + // checkBox13 + // + this.checkBox13.AutoSize = true; + this.checkBox13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.checkBox13.Location = new System.Drawing.Point(110, 12); + this.checkBox13.Name = "checkBox13"; + this.checkBox13.Size = new System.Drawing.Size(98, 24); + this.checkBox13.TabIndex = 7; + this.checkBox13.Text = "频率稳定度"; + this.checkBox13.UseVisualStyleBackColor = true; + // + // label3 + // + this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(280, 47); + this.label3.Margin = new System.Windows.Forms.Padding(0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(100, 27); + this.label3.TabIndex = 8; + this.label3.Text = "预计结束时间"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label12 + // + this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(0, 47); + this.label12.Margin = new System.Windows.Forms.Padding(0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(100, 27); + this.label12.TabIndex = 37; + this.label12.Text = "测量开始时间"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label13 + // + this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label13.Location = new System.Drawing.Point(0, 10); + this.label13.Margin = new System.Windows.Forms.Padding(0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(100, 27); + this.label13.TabIndex = 36; + this.label13.Text = "检测项目"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevName // // // // - this.textBoxX1.Border.Class = "TextBoxBorder"; - this.textBoxX1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX1.Location = new System.Drawing.Point(152, 35); - this.textBoxX1.Name = "textBoxX1"; - this.textBoxX1.PreventEnterBeep = true; - this.textBoxX1.Size = new System.Drawing.Size(100, 21); - this.textBoxX1.TabIndex = 10; + this.inputDevName.Border.Class = "TextBoxBorder"; + this.inputDevName.Border.CornerDiameter = 5; + this.inputDevName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevName.Location = new System.Drawing.Point(110, 10); + this.inputDevName.Margin = new System.Windows.Forms.Padding(0); + this.inputDevName.Name = "inputDevName"; + this.inputDevName.PreventEnterBeep = true; + this.inputDevName.Size = new System.Drawing.Size(150, 27); + this.inputDevName.TabIndex = 1; // - // textBoxX2 + // label8 + // + this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label8.Location = new System.Drawing.Point(290, 10); + this.label8.Margin = new System.Windows.Forms.Padding(0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(100, 27); + this.label8.TabIndex = 31; + this.label8.Text = "仪器编号"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label5 + // + this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label5.Location = new System.Drawing.Point(0, 10); + this.label5.Margin = new System.Windows.Forms.Padding(0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 27); + this.label5.TabIndex = 30; + this.label5.Text = "仪器名称"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.btnExitDev); + this.panel1.Controls.Add(this.labelTitle); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(600, 32); + this.panel1.TabIndex = 18; + this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + // + // btnExitDev + // + this.btnExitDev.BackColor = System.Drawing.Color.Transparent; + this.btnExitDev.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitDev.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitDev.FlatAppearance.BorderSize = 0; + this.btnExitDev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitDev.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitDev.Location = new System.Drawing.Point(570, 5); + this.btnExitDev.Margin = new System.Windows.Forms.Padding(0); + this.btnExitDev.Name = "btnExitDev"; + this.btnExitDev.Size = new System.Drawing.Size(20, 20); + this.btnExitDev.TabIndex = 2; + this.btnExitDev.UseVisualStyleBackColor = false; + this.btnExitDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); + // + // labelTitle + // + this.labelTitle.BackColor = System.Drawing.Color.Transparent; + this.labelTitle.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelTitle.ForeColor = System.Drawing.Color.White; + this.labelTitle.Location = new System.Drawing.Point(10, 5); + this.labelTitle.Name = "labelTitle"; + this.labelTitle.Size = new System.Drawing.Size(155, 23); + this.labelTitle.TabIndex = 0; + this.labelTitle.Text = "添加送检仪器"; + // + // panel2 + // + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.channelFree); + this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.inputCustName); + this.panel2.Controls.Add(this.label2); + this.panel2.Controls.Add(this.inputCustComp); + this.panel2.Controls.Add(this.inputDevModel); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.label9); + this.panel2.Controls.Add(this.inputDevCode); + this.panel2.Controls.Add(this.inputDevName); + this.panel2.Controls.Add(this.label8); + this.panel2.Controls.Add(this.label5); + this.panel2.Location = new System.Drawing.Point(10, 40); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(580, 121); + this.panel2.TabIndex = 19; + // + // channelFree + // + this.channelFree.DisplayMember = "Text"; + this.channelFree.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.channelFree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.channelFree.FormattingEnabled = true; + this.channelFree.ItemHeight = 18; + this.channelFree.Items.AddRange(new object[] { + this.channel1, + this.channel2, + this.channel3, + this.channel4, + this.channel5}); + this.channelFree.Location = new System.Drawing.Point(400, 87); + this.channelFree.Name = "channelFree"; + this.channelFree.Size = new System.Drawing.Size(150, 24); + this.channelFree.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.channelFree.TabIndex = 6; + // + // channel1 + // + this.channel1.Text = "通道1"; + this.channel1.Value = "1"; + // + // channel2 + // + this.channel2.Text = "通道2"; + this.channel2.Value = "2"; + // + // channel3 + // + this.channel3.Text = "通道3"; + this.channel3.Value = "3"; + // + // channel4 + // + this.channel4.Text = "通道4"; + this.channel4.Value = "4"; + // + // channel5 + // + this.channel5.Text = "通道5"; + this.channel5.Value = "5"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(290, 84); + this.label4.Margin = new System.Windows.Forms.Padding(0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 27); + this.label4.TabIndex = 35; + this.label4.Text = "选择通道"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustName // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX2.Location = new System.Drawing.Point(152, 79); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.Size = new System.Drawing.Size(100, 21); - this.textBoxX2.TabIndex = 10; + this.inputCustName.Border.Class = "TextBoxBorder"; + this.inputCustName.Border.CornerDiameter = 5; + this.inputCustName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustName.Location = new System.Drawing.Point(110, 84); + this.inputCustName.Margin = new System.Windows.Forms.Padding(0); + this.inputCustName.Name = "inputCustName"; + this.inputCustName.PreventEnterBeep = true; + this.inputCustName.Size = new System.Drawing.Size(150, 27); + this.inputCustName.TabIndex = 5; // - // textBoxX3 + // label2 + // + this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(0, 84); + this.label2.Margin = new System.Windows.Forms.Padding(0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(100, 27); + this.label2.TabIndex = 34; + this.label2.Text = "联系人"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputCustComp // // // // - this.textBoxX3.Border.Class = "TextBoxBorder"; - this.textBoxX3.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX3.Location = new System.Drawing.Point(152, 121); - this.textBoxX3.Name = "textBoxX3"; - this.textBoxX3.PreventEnterBeep = true; - this.textBoxX3.Size = new System.Drawing.Size(100, 21); - this.textBoxX3.TabIndex = 10; + this.inputCustComp.Border.Class = "TextBoxBorder"; + this.inputCustComp.Border.CornerDiameter = 5; + this.inputCustComp.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputCustComp.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputCustComp.Location = new System.Drawing.Point(400, 47); + this.inputCustComp.Margin = new System.Windows.Forms.Padding(0); + this.inputCustComp.Name = "inputCustComp"; + this.inputCustComp.PreventEnterBeep = true; + this.inputCustComp.Size = new System.Drawing.Size(150, 27); + this.inputCustComp.TabIndex = 4; // - // textBoxX4 + // inputDevModel // // // // - this.textBoxX4.Border.Class = "TextBoxBorder"; - this.textBoxX4.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.textBoxX4.Location = new System.Drawing.Point(152, 166); - this.textBoxX4.Name = "textBoxX4"; - this.textBoxX4.PreventEnterBeep = true; - this.textBoxX4.Size = new System.Drawing.Size(100, 21); - this.textBoxX4.TabIndex = 10; + this.inputDevModel.Border.Class = "TextBoxBorder"; + this.inputDevModel.Border.CornerDiameter = 5; + this.inputDevModel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevModel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevModel.Location = new System.Drawing.Point(110, 47); + this.inputDevModel.Margin = new System.Windows.Forms.Padding(0); + this.inputDevModel.Name = "inputDevModel"; + this.inputDevModel.PreventEnterBeep = true; + this.inputDevModel.Size = new System.Drawing.Size(150, 27); + this.inputDevModel.TabIndex = 3; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(290, 47); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 27); + this.label1.TabIndex = 33; + this.label1.Text = "送检单位"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label9.Location = new System.Drawing.Point(0, 47); + this.label9.Margin = new System.Windows.Forms.Padding(0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(100, 27); + this.label9.TabIndex = 32; + this.label9.Text = "仪器型号"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // inputDevCode + // + // + // + // + this.inputDevCode.Border.Class = "TextBoxBorder"; + this.inputDevCode.Border.CornerDiameter = 5; + this.inputDevCode.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevCode.Location = new System.Drawing.Point(400, 10); + this.inputDevCode.Margin = new System.Windows.Forms.Padding(0); + this.inputDevCode.Name = "inputDevCode"; + this.inputDevCode.PreventEnterBeep = true; + this.inputDevCode.Size = new System.Drawing.Size(150, 27); + this.inputDevCode.TabIndex = 2; // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(400, 300); + this.ClientSize = new System.Drawing.Size(600, 392); this.ControlBox = false; - this.Controls.Add(this.textBoxX4); - this.Controls.Add(this.textBoxX3); - this.Controls.Add(this.textBoxX2); - this.Controls.Add(this.textBoxX1); - this.Controls.Add(this.btnAddDevCancel); - this.Controls.Add(this.buttonX1); - this.Controls.Add(this.labelX3); - this.Controls.Add(this.labelX4); - this.Controls.Add(this.labelX2); - this.Controls.Add(this.labelX1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Controls.Add(this.checkBox9); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.btnCancelSetDev); + this.Controls.Add(this.panel4); + this.Controls.Add(this.panel3); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AddDevDlg"; this.Text = "添加检测设备"; + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.endTimeEst)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.startTime)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private DevComponents.DotNetBar.ButtonX btnAddDevCancel; - private DevComponents.DotNetBar.ButtonX buttonX1; - private DevComponents.DotNetBar.LabelX labelX3; - private DevComponents.DotNetBar.LabelX labelX4; - private DevComponents.DotNetBar.LabelX labelX2; - private DevComponents.DotNetBar.LabelX labelX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX1; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX3; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX4; + + private System.Windows.Forms.CheckBox checkBox9; + private RoundButton btnSave; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox4; + private RoundButton btnCancelSetDev; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel3; + private DevComponents.Editors.DateTimeAdv.DateTimeInput endTimeEst; + private DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; + private System.Windows.Forms.CheckBox checkBox10; + private System.Windows.Forms.CheckBox checkBox11; + private System.Windows.Forms.CheckBox checkBox12; + private System.Windows.Forms.CheckBox checkBox13; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevName; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnExitDev; + private System.Windows.Forms.Label labelTitle; + private System.Windows.Forms.Panel panel2; + private DevComponents.DotNetBar.Controls.ComboBoxEx channelFree; + private System.Windows.Forms.Label label4; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustName; + private System.Windows.Forms.Label label2; + private DevComponents.DotNetBar.Controls.TextBoxX inputCustComp; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevModel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label9; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevCode; + private DevComponents.Editors.ComboItem channel1; + private DevComponents.Editors.ComboItem channel2; + private DevComponents.Editors.ComboItem channel3; + private DevComponents.Editors.ComboItem channel4; + private DevComponents.Editors.ComboItem channel5; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 739e250..652c6b4 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -1,25 +1,76 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.Tools; +using DevComponents.DotNetBar.Controls; +using DevComponents.Editors; +using System; +using System.Runtime.InteropServices; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.info { public partial class AddDevDlg : Form { + #region 无边框拖动效果/最小化窗口/关闭窗口 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + private void panel1_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + public Action HideMaskAction + { + get; + set; + } + public AddDevDlg() { InitializeComponent(); + + ((ComboBoxEx)this.Controls.Find("channelFree", true)[0]).SelectedIndex = 0; } // 关闭对话框 private void btnAddDevCancel_Click(object sender, EventArgs e) { - this.Close(); + this.HideMaskAction(); + } + + // 添加并开始检测 + private void btnSave_Click(object sender, EventArgs e) + { + // 取得输入框的参数 + string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; + string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; + string devModel = ((TextBoxX)this.Controls.Find("inputDevModel", true)[0]).Text; + string devCustomComp = ((TextBoxX)this.Controls.Find("inputCustComp", true)[0]).Text; + string devCustomName = ((TextBoxX)this.Controls.Find("inputCustName", true)[0]).Text; + + ComboBoxEx channels = (ComboBoxEx)this.Controls.Find("channelFree", true)[0]; + string channelNo = (string)((ComboItem)channels.SelectedItem).Value; + + // 初始化数据访问接口 + DeviceService devService = new DeviceServiceImpl(); + int id = devService.add(devName, devCode, "1", devModel, devCustomComp, devCustomName, channelNo); + if (id >= 0) + { + // 添加成功,继续保存检测项目和开始时间 + this.HideMaskAction(); + } + else + { + LogHelper.WriteErrorLog(this.GetType(), "添加设备[" + devName + "]失败"); + } } } } diff --git a/RbFreqStandMeasure/info/DevicesDto.cs b/RbFreqStandMeasure/info/DevicesDto.cs new file mode 100644 index 0000000..872c3b8 --- /dev/null +++ b/RbFreqStandMeasure/info/DevicesDto.cs @@ -0,0 +1,6 @@ +namespace Casic.Birmm.RbFreqStandMeasure.info +{ + internal class DevicesDto + { + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs b/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs index f28a581..aac4b31 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.Designer.cs @@ -41,8 +41,8 @@ this.tested = new DevComponents.Editors.ComboItem(); this.labelDevStatus = new System.Windows.Forms.Label(); this.inputDevName = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.inputDevType = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.inputDevNo = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevModel = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.inputDevCode = new DevComponents.DotNetBar.Controls.TextBoxX(); this.inputCustomName = new DevComponents.DotNetBar.Controls.TextBoxX(); this.labelCustomName = new System.Windows.Forms.Label(); this.labelDevNo = new System.Windows.Forms.Label(); @@ -50,20 +50,31 @@ this.inputCustomComp = new DevComponents.DotNetBar.Controls.TextBoxX(); this.labelCustomComp = new System.Windows.Forms.Label(); this.labelDevName = new System.Windows.Forms.Label(); + this.btnNext = new System.Windows.Forms.Button(); + this.btnPre = new System.Windows.Forms.Button(); + this.labelPageCount = new System.Windows.Forms.Label(); + this.labelCurrentPage = new System.Windows.Forms.Label(); + this.panelPage = new System.Windows.Forms.Panel(); + this.panelNodata = new System.Windows.Forms.Panel(); + this.labelNodata = new System.Windows.Forms.Label(); this.btnExport = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnDetail = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnAdd = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.benEdit = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnEdit = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnQuery = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tableDevList)).BeginInit(); this.panel2.SuspendLayout(); + this.panelPage.SuspendLayout(); + this.panelNodata.SuspendLayout(); this.SuspendLayout(); // // panel1 // this.panel1.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_dev_list; + this.panel1.Controls.Add(this.panelNodata); + this.panel1.Controls.Add(this.panelPage); this.panel1.Controls.Add(this.tableDevList); this.panel1.Controls.Add(this.panel2); this.panel1.Location = new System.Drawing.Point(10, 5); @@ -91,7 +102,7 @@ this.tableDevList.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.tableDevList.ColumnHeadersHeight = 40; this.tableDevList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.tableDevList.Location = new System.Drawing.Point(20, 120); + this.tableDevList.Location = new System.Drawing.Point(20, 100); this.tableDevList.Margin = new System.Windows.Forms.Padding(0); this.tableDevList.Name = "tableDevList"; this.tableDevList.ReadOnly = true; @@ -106,9 +117,9 @@ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.tableDevList.RowsDefaultCellStyle = dataGridViewCellStyle2; - this.tableDevList.RowTemplate.Height = 40; + this.tableDevList.RowTemplate.Height = 44; this.tableDevList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.tableDevList.Size = new System.Drawing.Size(964, 440); + this.tableDevList.Size = new System.Drawing.Size(964, 480); this.tableDevList.TabIndex = 2; // // panel2 @@ -117,14 +128,14 @@ this.panel2.Controls.Add(this.btnExport); this.panel2.Controls.Add(this.btnDetail); this.panel2.Controls.Add(this.btnAdd); - this.panel2.Controls.Add(this.benDelete); - this.panel2.Controls.Add(this.benEdit); + this.panel2.Controls.Add(this.btnDelete); + this.panel2.Controls.Add(this.btnEdit); this.panel2.Controls.Add(this.inputDevStatus); this.panel2.Controls.Add(this.labelDevStatus); this.panel2.Controls.Add(this.btnQuery); this.panel2.Controls.Add(this.inputDevName); - this.panel2.Controls.Add(this.inputDevType); - this.panel2.Controls.Add(this.inputDevNo); + this.panel2.Controls.Add(this.inputDevModel); + this.panel2.Controls.Add(this.inputDevCode); this.panel2.Controls.Add(this.inputCustomName); this.panel2.Controls.Add(this.labelCustomName); this.panel2.Controls.Add(this.labelDevNo); @@ -146,9 +157,9 @@ this.inputDevStatus.ItemHeight = 20; this.inputDevStatus.Items.AddRange(new object[] { this.All, - this.tested, + this.toBeTested, this.testing, - this.toBeTested}); + this.tested}); this.inputDevStatus.Location = new System.Drawing.Point(560, 43); this.inputDevStatus.Margin = new System.Windows.Forms.Padding(0); this.inputDevStatus.MaximumSize = new System.Drawing.Size(150, 0); @@ -163,15 +174,18 @@ // // toBeTested // - this.toBeTested.Text = "已检测"; + this.toBeTested.Text = "待检测"; + this.toBeTested.Value = "1"; // // testing // this.testing.Text = "检测中"; + this.testing.Value = "2"; // // tested // - this.tested.Text = "待检测"; + this.tested.Text = "已检测"; + this.tested.Value = "3"; // // labelDevStatus // @@ -204,44 +218,50 @@ this.inputDevName.Size = new System.Drawing.Size(150, 26); this.inputDevName.TabIndex = 9; this.inputDevName.Text = "请输入仪器名称"; + this.inputDevName.Click += new System.EventHandler(this.inputDevName_Click); + this.inputDevName.Leave += new System.EventHandler(this.inputDevName_Leave); // - // inputDevType + // inputDevModel // // // // - this.inputDevType.Border.Class = "TextBoxBorder"; - this.inputDevType.Border.CornerDiameter = 5; - this.inputDevType.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.inputDevType.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.inputDevType.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.inputDevType.Location = new System.Drawing.Point(320, 3); - this.inputDevType.Margin = new System.Windows.Forms.Padding(0); - this.inputDevType.MaximumSize = new System.Drawing.Size(150, 26); - this.inputDevType.Name = "inputDevType"; - this.inputDevType.PreventEnterBeep = true; - this.inputDevType.Size = new System.Drawing.Size(150, 26); - this.inputDevType.TabIndex = 8; - this.inputDevType.Text = "请输入仪器型号"; + this.inputDevModel.Border.Class = "TextBoxBorder"; + this.inputDevModel.Border.CornerDiameter = 5; + this.inputDevModel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevModel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevModel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.inputDevModel.Location = new System.Drawing.Point(320, 3); + this.inputDevModel.Margin = new System.Windows.Forms.Padding(0); + this.inputDevModel.MaximumSize = new System.Drawing.Size(150, 26); + this.inputDevModel.Name = "inputDevModel"; + this.inputDevModel.PreventEnterBeep = true; + this.inputDevModel.Size = new System.Drawing.Size(150, 26); + this.inputDevModel.TabIndex = 8; + this.inputDevModel.Text = "请输入仪器型号"; + this.inputDevModel.Click += new System.EventHandler(this.inputDevModel_Click); + this.inputDevModel.Leave += new System.EventHandler(this.inputDevModel_Leave); // - // inputDevNo + // inputDevCode // // // // - this.inputDevNo.Border.Class = "TextBoxBorder"; - this.inputDevNo.Border.CornerDiameter = 5; - this.inputDevNo.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.inputDevNo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.inputDevNo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.inputDevNo.Location = new System.Drawing.Point(560, 3); - this.inputDevNo.Margin = new System.Windows.Forms.Padding(0); - this.inputDevNo.MaximumSize = new System.Drawing.Size(150, 26); - this.inputDevNo.Name = "inputDevNo"; - this.inputDevNo.PreventEnterBeep = true; - this.inputDevNo.Size = new System.Drawing.Size(150, 26); - this.inputDevNo.TabIndex = 7; - this.inputDevNo.Text = "请输入仪器编号"; + this.inputDevCode.Border.Class = "TextBoxBorder"; + this.inputDevCode.Border.CornerDiameter = 5; + this.inputDevCode.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.inputDevCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.inputDevCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.inputDevCode.Location = new System.Drawing.Point(560, 3); + this.inputDevCode.Margin = new System.Windows.Forms.Padding(0); + this.inputDevCode.MaximumSize = new System.Drawing.Size(150, 26); + this.inputDevCode.Name = "inputDevCode"; + this.inputDevCode.PreventEnterBeep = true; + this.inputDevCode.Size = new System.Drawing.Size(150, 26); + this.inputDevCode.TabIndex = 7; + this.inputDevCode.Text = "请输入仪器编号"; + this.inputDevCode.Click += new System.EventHandler(this.inputDevCode_Click); + this.inputDevCode.Leave += new System.EventHandler(this.inputDevCode_Leave); // // inputCustomName // @@ -260,11 +280,12 @@ this.inputCustomName.PreventEnterBeep = true; this.inputCustomName.Size = new System.Drawing.Size(150, 26); this.inputCustomName.TabIndex = 6; - this.inputCustomName.Text = "请输入客户名称"; + this.inputCustomName.Text = "请输入联系人"; + this.inputCustomName.Click += new System.EventHandler(this.inputCustomName_Click); + this.inputCustomName.Leave += new System.EventHandler(this.inputCustomName_Leave); // // labelCustomName // - this.labelCustomName.AutoSize = true; this.labelCustomName.BackColor = System.Drawing.Color.Transparent; this.labelCustomName.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.labelCustomName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); @@ -273,7 +294,8 @@ this.labelCustomName.Name = "labelCustomName"; this.labelCustomName.Size = new System.Drawing.Size(74, 21); this.labelCustomName.TabIndex = 5; - this.labelCustomName.Text = "客户名称"; + this.labelCustomName.Text = "联系人"; + this.labelCustomName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // labelDevNo // @@ -319,7 +341,9 @@ this.inputCustomComp.PreventEnterBeep = true; this.inputCustomComp.Size = new System.Drawing.Size(150, 26); this.inputCustomComp.TabIndex = 3; - this.inputCustomComp.Text = "请输入单位名称"; + this.inputCustomComp.Text = "请输入送检单位名称"; + this.inputCustomComp.Click += new System.EventHandler(this.inputCustomComp_Click); + this.inputCustomComp.Leave += new System.EventHandler(this.inputCustomComp_Leave); // // labelCustomComp // @@ -332,7 +356,7 @@ this.labelCustomComp.Name = "labelCustomComp"; this.labelCustomComp.Size = new System.Drawing.Size(74, 21); this.labelCustomComp.TabIndex = 0; - this.labelCustomComp.Text = "客户单位"; + this.labelCustomComp.Text = "送检单位"; // // labelDevName // @@ -347,6 +371,85 @@ this.labelDevName.TabIndex = 0; this.labelDevName.Text = "仪器名称"; // + // btnNext + // + this.btnNext.BackColor = System.Drawing.Color.Transparent; + this.btnNext.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_page_next; + this.btnNext.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.btnNext.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnNext.Location = new System.Drawing.Point(950, 0); + this.btnNext.Name = "btnNext"; + this.btnNext.Size = new System.Drawing.Size(16, 16); + this.btnNext.TabIndex = 317; + this.btnNext.UseVisualStyleBackColor = false; + this.btnNext.Click += new System.EventHandler(this.btnNext_Click); + // + // btnPre + // + this.btnPre.BackColor = System.Drawing.Color.Transparent; + this.btnPre.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_page_pre; + this.btnPre.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.btnPre.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnPre.Location = new System.Drawing.Point(890, 0); + this.btnPre.Name = "btnPre"; + this.btnPre.Size = new System.Drawing.Size(16, 16); + this.btnPre.TabIndex = 318; + this.btnPre.UseVisualStyleBackColor = false; + this.btnPre.Click += new System.EventHandler(this.btnPre_Click); + // + // labelPageCount + // + this.labelPageCount.AutoSize = true; + this.labelPageCount.BackColor = System.Drawing.Color.Transparent; + this.labelPageCount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelPageCount.Location = new System.Drawing.Point(690, 0); + this.labelPageCount.Name = "labelPageCount"; + this.labelPageCount.Size = new System.Drawing.Size(151, 17); + this.labelPageCount.TabIndex = 315; + this.labelPageCount.Text = "共10条,每页10条,共2页"; + // + // labelCurrentPage + // + this.labelCurrentPage.AutoSize = true; + this.labelCurrentPage.BackColor = System.Drawing.Color.Transparent; + this.labelCurrentPage.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelCurrentPage.Location = new System.Drawing.Point(920, 0); + this.labelCurrentPage.Name = "labelCurrentPage"; + this.labelCurrentPage.Size = new System.Drawing.Size(15, 17); + this.labelCurrentPage.TabIndex = 315; + this.labelCurrentPage.Text = "1"; + // + // panelPage + // + this.panelPage.BackColor = System.Drawing.Color.Transparent; + this.panelPage.Controls.Add(this.labelPageCount); + this.panelPage.Controls.Add(this.btnNext); + this.panelPage.Controls.Add(this.btnPre); + this.panelPage.Controls.Add(this.labelCurrentPage); + this.panelPage.Location = new System.Drawing.Point(10, 595); + this.panelPage.Name = "panelPage"; + this.panelPage.Size = new System.Drawing.Size(984, 20); + this.panelPage.TabIndex = 319; + // + // panelNodata + // + this.panelNodata.BackColor = System.Drawing.Color.Transparent; + this.panelNodata.Controls.Add(this.labelNodata); + this.panelNodata.Location = new System.Drawing.Point(10, 140); + this.panelNodata.Name = "panelNodata"; + this.panelNodata.Size = new System.Drawing.Size(984, 40); + this.panelNodata.TabIndex = 320; + // + // labelNodata + // + this.labelNodata.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.labelNodata.Location = new System.Drawing.Point(0, 0); + this.labelNodata.Name = "labelNodata"; + this.labelNodata.Size = new System.Drawing.Size(984, 50); + this.labelNodata.TabIndex = 0; + this.labelNodata.Text = "没有搜索到数据"; + this.labelNodata.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // btnExport // this.btnExport.EnterBackColor = System.Drawing.Color.Blue; @@ -392,6 +495,7 @@ this.btnDetail.TabIndex = 13; this.btnDetail.Text = "详情"; this.btnDetail.UseVisualStyleBackColor = true; + this.btnDetail.Click += new System.EventHandler(this.btnDetail_Click); // // btnAdd // @@ -417,51 +521,52 @@ this.btnAdd.UseVisualStyleBackColor = true; this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); // - // benDelete + // btnDelete // - this.benDelete.EnterBackColor = System.Drawing.Color.Blue; - this.benDelete.EnterForeColor = System.Drawing.Color.White; - this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.benDelete.FlatAppearance.BorderSize = 0; - this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); - this.benDelete.HoverForeColor = System.Drawing.Color.White; - this.benDelete.Location = new System.Drawing.Point(890, 43); - this.benDelete.Margin = new System.Windows.Forms.Padding(0); - this.benDelete.Name = "benDelete"; - this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; - this.benDelete.PressForeColor = System.Drawing.Color.White; - this.benDelete.Radius = 5; - this.benDelete.Size = new System.Drawing.Size(70, 26); - this.benDelete.TabIndex = 12; - this.benDelete.Text = "删除"; - this.benDelete.UseVisualStyleBackColor = true; + this.btnDelete.EnterBackColor = System.Drawing.Color.Blue; + this.btnDelete.EnterForeColor = System.Drawing.Color.White; + this.btnDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnDelete.FlatAppearance.BorderSize = 0; + this.btnDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btnDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); + this.btnDelete.HoverForeColor = System.Drawing.Color.White; + this.btnDelete.Location = new System.Drawing.Point(890, 43); + this.btnDelete.Margin = new System.Windows.Forms.Padding(0); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnDelete.PressForeColor = System.Drawing.Color.White; + this.btnDelete.Radius = 5; + this.btnDelete.Size = new System.Drawing.Size(70, 26); + this.btnDelete.TabIndex = 12; + this.btnDelete.Text = "删除"; + this.btnDelete.UseVisualStyleBackColor = true; // - // benEdit + // btnEdit // - this.benEdit.EnterBackColor = System.Drawing.Color.Blue; - this.benEdit.EnterForeColor = System.Drawing.Color.White; - this.benEdit.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.benEdit.FlatAppearance.BorderSize = 0; - this.benEdit.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.benEdit.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.benEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.benEdit.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.benEdit.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.benEdit.HoverForeColor = System.Drawing.Color.White; - this.benEdit.Location = new System.Drawing.Point(810, 43); - this.benEdit.Margin = new System.Windows.Forms.Padding(0); - this.benEdit.Name = "benEdit"; - this.benEdit.PressBackColor = System.Drawing.Color.DarkBlue; - this.benEdit.PressForeColor = System.Drawing.Color.White; - this.benEdit.Radius = 5; - this.benEdit.Size = new System.Drawing.Size(70, 26); - this.benEdit.TabIndex = 10; - this.benEdit.Text = "修改"; - this.benEdit.UseVisualStyleBackColor = true; + this.btnEdit.EnterBackColor = System.Drawing.Color.Blue; + this.btnEdit.EnterForeColor = System.Drawing.Color.White; + this.btnEdit.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnEdit.FlatAppearance.BorderSize = 0; + this.btnEdit.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnEdit.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnEdit.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btnEdit.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnEdit.HoverForeColor = System.Drawing.Color.White; + this.btnEdit.Location = new System.Drawing.Point(810, 43); + this.btnEdit.Margin = new System.Windows.Forms.Padding(0); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnEdit.PressForeColor = System.Drawing.Color.White; + this.btnEdit.Radius = 5; + this.btnEdit.Size = new System.Drawing.Size(70, 26); + this.btnEdit.TabIndex = 10; + this.btnEdit.Text = "修改"; + this.btnEdit.UseVisualStyleBackColor = true; + this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); // // btnQuery // @@ -485,6 +590,7 @@ this.btnQuery.TabIndex = 10; this.btnQuery.Text = "查询"; this.btnQuery.UseVisualStyleBackColor = true; + this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click); // // InfoCtrlForm // @@ -499,6 +605,9 @@ ((System.ComponentModel.ISupportInitialize)(this.tableDevList)).EndInit(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); + this.panelPage.ResumeLayout(false); + this.panelPage.PerformLayout(); + this.panelNodata.ResumeLayout(false); this.ResumeLayout(false); } @@ -514,21 +623,28 @@ private System.Windows.Forms.Label labelCustomComp; private System.Windows.Forms.Label labelCustomName; private DevComponents.DotNetBar.Controls.TextBoxX inputCustomName; - private DevComponents.DotNetBar.Controls.TextBoxX inputDevNo; - private DevComponents.DotNetBar.Controls.TextBoxX inputDevType; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevCode; + private DevComponents.DotNetBar.Controls.TextBoxX inputDevModel; private DevComponents.DotNetBar.Controls.TextBoxX inputDevName; private RoundButton btnQuery; private System.Windows.Forms.Label labelDevStatus; private DevComponents.DotNetBar.Controls.ComboBoxEx inputDevStatus; private DevComponents.Editors.ComboItem All; - private DevComponents.Editors.ComboItem toBeTested; - private DevComponents.Editors.ComboItem testing; private DevComponents.Editors.ComboItem tested; - private RoundButton benEdit; + private DevComponents.Editors.ComboItem testing; + private DevComponents.Editors.ComboItem toBeTested; + private RoundButton btnEdit; private RoundButton btnAdd; - private RoundButton benDelete; + private RoundButton btnDelete; private RoundButton btnDetail; private RoundButton btnExport; private System.Windows.Forms.DataGridView tableDevList; + private System.Windows.Forms.Button btnNext; + private System.Windows.Forms.Button btnPre; + private System.Windows.Forms.Label labelPageCount; + private System.Windows.Forms.Label labelCurrentPage; + private System.Windows.Forms.Panel panelPage; + private System.Windows.Forms.Panel panelNodata; + private System.Windows.Forms.Label labelNodata; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index a300ac1..2c0a4ef 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -1,10 +1,14 @@ -using System; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using DevComponents.DotNetBar.Controls; +using DevComponents.Editors; +using DevComponents.Editors.DateTimeAdv; +using Newtonsoft.Json.Linq; +using System; using System.Collections.Generic; -using System.ComponentModel; using System.Data; using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.info @@ -13,21 +17,44 @@ { private DataTable devList = null; - #region 样式常量定影 + private int totalCount = 0; // 总行数 + private int currentPage = 1; // 当前页码 + private int pageCount = 0; // 总页数 + private readonly int limitCount = 10; // 每页数据条数,当前页面的表格固定为10条 + + JObject condition = new JObject(); // 查询条件 + + DeviceService deviceService = new DeviceServiceImpl(); + + #region 输入框默认文字 + public readonly string DefaultDevName = "请输入仪器名称"; + public readonly string DefaultDevModel = "请输入仪器型号"; + public readonly string DefaultDevCode = "请输入仪器编号"; + public readonly string DefaultCustomComp = "请输入送检单位名称"; + public readonly string DefaultCustomName = "请输入联系人"; + #endregion + + #region 样式常量定义 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Color tableForeColor = Color.White; private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); + + private readonly Color inputBlack = Color.FromArgb(51, 51, 51); // #333333 + private readonly Color inputDefault = Color.FromArgb(204, 204, 204); // #CCCCCC #endregion public InfoCtrlForm() { InitializeComponent(); - this.inputDevStatus.SelectedIndex = 0; + this.inputDevStatus.SelectedIndex = 0; // 仪器状态默认选择“全部” + + // 进入页面时默认查询所有的数据 + totalCount = GetTotalCount(condition); // 初始化表格并加载数据 InitTableDevList(); - LoadDevList(); + LoadDevList(condition); } private void InitTableDevList() @@ -97,7 +124,7 @@ TextAlign = ContentAlignment.MiddleCenter, BackColor = titleBackColor, AutoSize = false, - Text = "仪器类型", + Text = "仪器型号", Location = new Point(364, 0), Size = new Size(120, 40) }; @@ -165,23 +192,86 @@ colChannelNo.BringToFront(); } - private void LoadDevList() + private void LoadDevList(JObject condition) { devList = new DataTable(); + // 设置表格的列 devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.DateTime")); + devList.Columns.Add("regTime", Type.GetType("System.String")); devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devType", Type.GetType("System.String")); - devList.Columns.Add("devNo", Type.GetType("System.String")); + devList.Columns.Add("devModel", Type.GetType("System.String")); + devList.Columns.Add("devCode", Type.GetType("System.String")); devList.Columns.Add("customName", Type.GetType("System.String")); devList.Columns.Add("status", Type.GetType("System.String")); devList.Columns.Add("channelNo", Type.GetType("System.String")); + devList.Columns.Add("id", Type.GetType("System.Int32")); - devList.Rows.Add("1", DateTime.Now, "SF2001-1", "通用计数器", "00001", "李涛", "检测中", "1"); - devList.Rows.Add("2", DateTime.Now, "SF2001-2", "通用计数器", "00002", "李涛", "检完", ""); - devList.Rows.Add("3", DateTime.Now, "SF2001-3", "通用计数器", "00003", "李涛", "检完", ""); - devList.Rows.Add("4", DateTime.Now, "SF2001-4", "通用计数器", "00004", "李涛", "待检", ""); + // 分页查询数据库 + string devName = ""; + string devModel = ""; + string devCode = ""; + string devStatus = ""; + string customComp = ""; + string customName = ""; + int page = 1; + if (condition.Property("devName") != null) + { + devName = condition.Property("devName").Value.ToString(); + } + if (condition.Property("devModel") != null) + { + devModel = condition.Property("devModel").Value.ToString(); + } + if (condition.Property("devCode") != null) + { + devCode = condition.Property("devCode").Value.ToString(); + } + if (condition.Property("devStatus") != null) + { + devStatus = condition.Property("devStatus").Value.ToString(); + } + if (condition.Property("customComp") != null) + { + customComp = condition.Property("customComp").Value.ToString(); + } + if (condition.Property("customName") != null) + { + customName = condition.Property("customName").Value.ToString(); + } + if (condition.Property("page") != null) + { + page = Convert.ToInt32(condition.Property("page").Value.ToString()); + } + + // 获取总条数 + totalCount = deviceService.getTotalCount(devName, devCode, devModel, customComp, customName, devStatus); + + // 获取当前页的数据 + List queryList = deviceService.searchPage(devName, devCode, devModel, customComp, customName, devStatus, page, limitCount); + if (null != queryList && queryList.Count > 0) + { + // 重新计算页码数据 + pageCount = Decimal.ToInt32(Math.Ceiling((decimal) totalCount / limitCount)); + ((Label)this.Controls.Find("labelPageCount", true)[0]).Text = "共 " + totalCount + " 条,每页 " + limitCount + " 条,共 " + pageCount + " 页"; + ((Label)this.Controls.Find("labelCurrentPage", true)[0]).Text = currentPage.ToString(); + + int i = 0; + foreach ( DeviceDto device in queryList ) + { + int index = (page-1) * limitCount + i + 1; + devList.Rows.Add(index, device.RegTime, device.DevName, device.DevModel, device.DevCode, device.CustomerName, device.StatusName, device.Channel, device.Id); + i++; + } + + this.Controls.Find("panelNodata", true)[0].Hide(); + this.Controls.Find("panelPage", true)[0].Show(); + } + else + { + this.Controls.Find("panelNodata", true)[0].Show(); + this.Controls.Find("panelPage", true)[0].Hide(); + } tableDevList.DataSource = devList; @@ -194,6 +284,9 @@ tableDevList.Columns[5].Width = 120; tableDevList.Columns[6].Width = 120; tableDevList.Columns[7].Width = 120; + tableDevList.Columns[8].Width = 0; + + tableDevList.Columns[8].Visible = false; // id不显示 tableDevList.Columns[0].ReadOnly = true; tableDevList.Columns[1].ReadOnly = true; @@ -203,12 +296,237 @@ tableDevList.Columns[5].ReadOnly = true; tableDevList.Columns[6].ReadOnly = true; tableDevList.Columns[7].ReadOnly = true; + tableDevList.Columns[8].ReadOnly = true; + } + + private int GetTotalCount(JObject condition) + { + string devName = ""; + string devModel = ""; + string devCode = ""; + string devStatus = ""; + string customComp = ""; + string customName = ""; + if (condition.Property("devName") != null) + { + devName = condition.Property("devName").Value.ToString(); + } + if (condition.Property("devModel") != null) + { + devModel = condition.Property("devModel").Value.ToString(); + } + if (condition.Property("devCode") != null) + { + devCode = condition.Property("devCode").Value.ToString(); + } + if (condition.Property("devStatus") != null) + { + devStatus = condition.Property("devStatus").Value.ToString(); + } + if (condition.Property("customComp") != null) + { + customComp = condition.Property("customComp").Value.ToString(); + } + if (condition.Property("customName") != null) + { + customName = condition.Property("customName").Value.ToString(); + } + + int total = deviceService.getTotalCount(devName, devCode, devModel, customComp, customName, devStatus); + + return total; } private void btnAdd_Click(object sender, EventArgs e) { - AddDevDlg addDev = new AddDevDlg(); - addDev.ShowDialog(); + AddDevDlg addDevDlg = new AddDevDlg(); + addDevDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + addDevDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + + // 设置默认值 + DateTimeInput startTimeInput = (DateTimeInput) addDevDlg.Controls.Find("startTime", true)[0]; + startTimeInput.Value = DateTime.Now; + + DateTimeInput endTimeInput = (DateTimeInput)addDevDlg.Controls.Find("endTimeEst", true)[0]; + endTimeInput.Value = DateTime.Now.AddDays(1); + + addDevDlg.ShowDialog(); + } + + private MaskForm maskForm; + + private void ShowMask() + { + maskForm = new MaskForm(this.Parent.Parent.Location, this.Parent.Parent.Size); + maskForm.Show(); + } + + private void HideMask() + { + if (maskForm != null) + { + maskForm.Close(); + } + } + + private void btnQuery_Click(object sender, EventArgs e) + { + string devName = CheckInputText("inputDevName", DefaultDevName); + string devModel = CheckInputText("inputDevModel", DefaultDevModel); + string devCode = CheckInputText("inputDevCode", DefaultDevCode); + string customComp = CheckInputText("inputCustomComp", DefaultCustomComp); + string customName = CheckInputText("inputCustomName", DefaultCustomName); + ComboBoxEx statusSelect = (ComboBoxEx)this.Controls.Find("inputDevStatus", true)[0]; + string devStatus = (string)((ComboItem)statusSelect.SelectedItem).Value; + + condition.RemoveAll(); + condition.Add("devName", devName); + condition.Add("devModel", devModel); + condition.Add("devCode", devCode); + condition.Add("devStatus", devStatus); + condition.Add("customComp", customComp); + condition.Add("customName", customName); + condition.Add("page", 1); + + // 查询数据 + LoadDevList(condition); + } + + private string CheckInputText(string inputName, string defaultText) + { + string name = ((TextBoxX)this.Controls.Find(inputName, true)[0]).Text; + if (name == defaultText) + { + return ""; + } + else + { + return name; + } + } + + private void inputClick(string inputName, string defaultText, object sender) + { + string name = CheckInputText(inputName, defaultText); + + ((TextBoxX)sender).Text = name; + ((TextBoxX)sender).ForeColor = inputBlack; + } + + private void inputLeave(string inputName, string defaultText, object sender) + { + string name = CheckInputText(inputName, defaultText); + if (name == "") + { + ((TextBoxX)sender).Text = defaultText; + ((TextBoxX)sender).ForeColor = inputDefault; + } + } + + private void inputDevName_Click(object sender, EventArgs e) + { + inputClick("inputDevName", DefaultDevName, sender); + } + + private void inputDevName_Leave(object sender, EventArgs e) + { + inputLeave("inputDevName", DefaultDevName, sender); + } + + private void inputDevModel_Click(object sender, EventArgs e) + { + inputClick("inputDevModel", DefaultDevModel, sender); + } + + private void inputDevModel_Leave(object sender, EventArgs e) + { + inputLeave("inputDevModel", DefaultDevModel, sender); + } + + private void inputDevCode_Click(object sender, EventArgs e) + { + inputClick("inputDevCode", DefaultDevCode, sender); + } + + private void inputDevCode_Leave(object sender, EventArgs e) + { + inputLeave("inputDevCode", DefaultDevCode, sender); + } + + private void inputCustomComp_Click(object sender, EventArgs e) + { + inputClick("inputCustomComp", DefaultCustomComp, sender); + } + + private void inputCustomComp_Leave(object sender, EventArgs e) + { + inputLeave("inputCustomComp", DefaultCustomComp, sender); + } + + private void inputCustomName_Click(object sender, EventArgs e) + { + inputClick("inputCustomName", DefaultCustomName, sender); + } + + private void inputCustomName_Leave(object sender, EventArgs e) + { + inputLeave("inputCustomName", DefaultCustomName, sender); + } + + private void btnPre_Click(object sender, EventArgs e) + { + if (currentPage > 1) + { + currentPage -= 1; + condition.Remove("page"); + condition.Add("page", currentPage); + LoadDevList(condition); + } + } + + private void btnNext_Click(object sender, EventArgs e) + { + if (currentPage < pageCount) + { + currentPage += 1; + condition.Remove("page"); + condition.Add("page", currentPage); + LoadDevList(condition); + } + } + + private void btnDetail_Click(object sender, EventArgs e) + { + int rowIndex = tableDevList.CurrentRow.Index; + int id = (int)tableDevList.Rows[rowIndex].Cells[8].Value; + MessageBox.Show(id.ToString()); + } + + private void btnEdit_Click(object sender, EventArgs e) + { + int rowIndex = tableDevList.CurrentRow.Index; + int id = (int)tableDevList.Rows[rowIndex].Cells[8].Value; + string devName = (string)tableDevList.Rows[rowIndex].Cells[2].Value; + string devModel = (string)tableDevList.Rows[rowIndex].Cells[3].Value; + string devCode = (string)tableDevList.Rows[rowIndex].Cells[4].Value; + + AddDevDlg editDlg = new AddDevDlg(); + editDlg.Controls.Find("labelTitle", true)[0].Text = "修改送检仪器"; + editDlg.Controls.Find("inputDevName", true)[0].Text = devName; + editDlg.Controls.Find("inputDevModel", true)[0].Text = devModel; + editDlg.Controls.Find("inputDevCode", true)[0].Text = devCode; + + editDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + editDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + editDlg.ShowDialog(); } } }