public void UpdateAlarmState(int id, AlarmStateType onAlarm) { string sql = $"update tb_alarm set State = { Convert.ToInt32(onAlarm)} where id = {id}"; using (MySqlConnection conn = new MySqlConnection(_connStr)) { conn.Execute(sql); } }
public void RecoverAlarm(int id, DateTime recoverDate, AlarmStateType onAlarm) { try { var sql = $"update tb_alarm set State = { Convert.ToInt32(onAlarm)},RecoverDate='{recoverDate.ToString("yyyy-MM-dd HH:mm:ss")}' where id = {id};"; AddSql(sql); } catch (Exception ex) { throw; } }
public void UpdateAlarm(int id, AlarmStateType onAlarm) { try { var sql = $"update tb_alarm set State = { Convert.ToInt32(onAlarm)} where id = {id};"; AddSql(sql); } catch (Exception ex) { throw; } }
public int UpdateAlarm(int id, AlarmStateType onAlarm) { _cmd.CommandText = $"update tb_alarm set State = { Convert.ToInt32(onAlarm)} where id = {id}"; return(_cmd.ExecuteNonQuery()); }
public int RecoverAlarm(int id, DateTime recoverDate, AlarmStateType onAlarm) { _cmd.CommandText = $"update tb_alarm set State = { Convert.ToInt32(onAlarm)},RecoverDate='{recoverDate.ToString("yyyy-MM-dd HH:mm:ss")}' where id = {id}"; return(_cmd.ExecuteNonQuery()); }