This commit is contained in:
@ -30,63 +30,63 @@ namespace Epost.BLL
|
||||
public ResultModel Initialization_T(bool isback = true)
|
||||
{
|
||||
ResultModel resultModel = new ResultModel();
|
||||
//List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
//try
|
||||
//{
|
||||
// DataTable dt = addrBLL.getControlList();
|
||||
// bool result = false;
|
||||
// if (dt != null && dt.Rows.Count > 0)
|
||||
// {
|
||||
// foreach (DataRow item in dt.Rows)
|
||||
// {
|
||||
// LabelParamModel model = new LabelParamModel();
|
||||
// model.ControlIP = item["ControlIP"].ToString();
|
||||
// model.Address = "9999";
|
||||
// model.Command = "FORMAT_JOB_DATA";
|
||||
// model.Parameter = "50";
|
||||
// model.Timeout = "0.5";
|
||||
// list.Add(model);
|
||||
// model = new LabelParamModel();
|
||||
// model.ControlIP = item["ControlIP"].ToString();
|
||||
// model.Address = "9999";
|
||||
// model.Command = "CONNECT";
|
||||
// model.Parameter = IP;
|
||||
// model.Timeout = "0.5";
|
||||
// list.Add(model);
|
||||
// model = new LabelParamModel();
|
||||
// model.ControlIP = item["ControlIP"].ToString();
|
||||
// model.Address = "9999";
|
||||
// model.Parameter = "11111000";
|
||||
// model.Command = "UNLOCK";
|
||||
// model.Timeout = "0.5";
|
||||
// list.Add(model);
|
||||
// model = new LabelParamModel();
|
||||
// model.ControlIP = item["ControlIP"].ToString();
|
||||
// model.Address = "9999";
|
||||
// model.Command = "LED_OFF";
|
||||
// model.Timeout = "0.5";
|
||||
// list.Add(model);
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
try
|
||||
{
|
||||
DataTable dt = addrBLL.getControlList();
|
||||
bool result = false;
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
model.Address = "9999";
|
||||
model.Command = "FORMAT_JOB_DATA";
|
||||
model.Parameter = "50";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
model.Address = "9999";
|
||||
model.Command = "CONNECT";
|
||||
model.Parameter = IP;
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
model.Address = "9999";
|
||||
model.Parameter = "11111000";
|
||||
model.Command = "UNLOCK";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
model.Address = "9999";
|
||||
model.Command = "LED_OFF";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
|
||||
// }
|
||||
// if (list.Any())
|
||||
// {
|
||||
// resultModel = SendALL_Init(list);
|
||||
// }
|
||||
}
|
||||
if (list.Any())
|
||||
{
|
||||
resultModel = SendALL_Init(list);
|
||||
}
|
||||
|
||||
// }
|
||||
// return resultModel;
|
||||
}
|
||||
return resultModel;
|
||||
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
// resultModel.result = "0";
|
||||
// resultModel.msg = "初始化失败!";
|
||||
// LogHelper.WriteLogInfo("初始化异常:" + ex.Message);
|
||||
resultModel.result = "0";
|
||||
resultModel.msg = "初始化失败!";
|
||||
LogHelper.WriteLogInfo("初始化异常:" + ex.Message);
|
||||
|
||||
//}
|
||||
resultModel.result = "0";
|
||||
resultModel.msg = "成功";
|
||||
}
|
||||
//resultModel.result = "0";
|
||||
//resultModel.msg = "成功";
|
||||
return resultModel;
|
||||
}
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user