|
@@ -40,10 +40,10 @@ namespace MECF.Framework.Common.DBCore
|
|
|
AlarmList data = new AlarmList();
|
|
|
data.ModuleName = ds.Tables[0].Rows[i]["module_name"].ToString();
|
|
|
data.ModuleState = ds.Tables[0].Rows[i]["module_state"].ToString();
|
|
|
- data.ModuleStep=int.Parse(ds.Tables[0].Rows[i]["module_step"].ToString());
|
|
|
+ data.ModuleStep = int.Parse(ds.Tables[0].Rows[i]["module_step"].ToString());
|
|
|
data.ModuleCmd = int.Parse(ds.Tables[0].Rows[i]["module_cmd"].ToString());
|
|
|
data.AlarmMsg = ds.Tables[0].Rows[i]["alarm_msg"].ToString();
|
|
|
- data.AlarmType= int.Parse(ds.Tables[0].Rows[i]["alarm_type"].ToString());
|
|
|
+ data.AlarmType = int.Parse(ds.Tables[0].Rows[i]["alarm_type"].ToString());
|
|
|
data.DataItem = ds.Tables[0].Rows[i]["data_item"].ToString();
|
|
|
data.CreateTime = (DateTime)ds.Tables[0].Rows[i]["create_time"];
|
|
|
data.UpdateTime = (DateTime)ds.Tables[0].Rows[i]["update_time"];
|
|
@@ -63,14 +63,14 @@ namespace MECF.Framework.Common.DBCore
|
|
|
string sql = string.Format(@"Insert into alarm_list(module_name,module_state,module_step,module_cmd,alarm_msg,
|
|
|
create_time,update_time,alarm_type,data_item)
|
|
|
Values('{0}','{1}',{2},{3},'{4}','{5}','{6}',{7},'{8}');",
|
|
|
- data.ModuleName,data.ModuleState,data.ModuleStep,data.ModuleCmd,data.AlarmMsg, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
|
|
- DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),data.AlarmType,data.DataItem);
|
|
|
+ data.ModuleName, data.ModuleState, data.ModuleStep, data.ModuleCmd, data.AlarmMsg, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
|
|
+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), data.AlarmType, data.DataItem);
|
|
|
DB.Insert(sql);
|
|
|
- string sqlHistory= string.Format(@"Insert into alarm_list_history(module_name,module_state,module_step,module_cmd,alarm_msg,
|
|
|
+ string sqlHistory = string.Format(@"Insert into alarm_list_history(module_name,module_state,module_step,module_cmd,alarm_msg,
|
|
|
create_time,update_time,alarm_type,data_item,alarm_operation)
|
|
|
Values('{0}','{1}',{2},{3},'{4}','{5}','{6}',{7},'{8}','{9}');",
|
|
|
data.ModuleName, data.ModuleState, data.ModuleStep, data.ModuleCmd, data.AlarmMsg, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
|
|
- DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), data.AlarmType,data.DataItem,ADD_OPERATION);
|
|
|
+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), data.AlarmType, data.DataItem, ADD_OPERATION);
|
|
|
DB.Insert(sqlHistory);
|
|
|
}
|
|
|
|
|
@@ -99,7 +99,7 @@ namespace MECF.Framework.Common.DBCore
|
|
|
/// <param name="data"></param>
|
|
|
public static void RemoveAlarmList(AlarmList data)
|
|
|
{
|
|
|
- string sql = string.Format(@"delete from alarm_list where module_name='{0}'", data.ModuleName);
|
|
|
+ string sql = string.Format(@"delete from alarm_list where module_name='{0}' and data_item='{1}'", data.ModuleName, data.DataItem);
|
|
|
DB.Update(sql);
|
|
|
|
|
|
string sqlHistory = string.Format(@"Insert into alarm_list_history(module_name,module_state,module_step,module_cmd,alarm_msg,
|
|
@@ -118,5 +118,5 @@ namespace MECF.Framework.Common.DBCore
|
|
|
string sql = "delete from alarm_list";
|
|
|
DB.Update(sql);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|