public bool UpdatePoint(PointInfo point, DbTransaction tran) { PointInfo p = GetPointsListByTNSN(point.SN, point.TN); point.ID = p.ID; return(processor.Update <PointInfo>(point, tran)); }
public bool UpdateLogConfig(LogConfig config, DbTransaction tran) { LogConfig p = GetLogConfigBySNTN(config.SN, config.TN); config.ID = p.ID; return(processor.Update <LogConfig>(config, tran)); }
public bool UpdateDevice(Device device, DbTransaction tran) { Device d = GetDeviceBySnTn(device.SerialNum, device.TripNum); device.ID = d.ID; return(processor.Update <Device>(device, tran)); }
public bool InsertOrUpdate(Policy entity, bool flag) { if (flag) { return(processor.Insert <Policy>(entity, null)); } else { return(processor.Update <Policy>(entity, null)); } }
public void InsertOrUpdateMeaning(Meanings meaning) { Meanings MeaningGotFromDbById = this.GetMeaningById(meaning.Id); if (MeaningGotFromDbById.Id != 0) { processor.Update <Meanings>(meaning, null); } else { processor.Insert <Meanings>(meaning, null); } }
public bool UpdateDigitalSignature(List <DigitalSignature> list, DbTransaction tran) { if (list != null && list.Count > 0) { List <DigitalSignature> p = GetDigitalSignatureBySnTn(list[0].SN, list[0].TN); int i = 0; list.ForEach(v => { v.ID = p[i++].ID; processor.Update <DigitalSignature>(v, tran); }); } return(true); }
public bool UpdateAlarmConfig(List <AlarmConfig> list, DbTransaction tran) { if (list != null && list.Count > 0) { List <AlarmConfig> p = GetAlarmConfigBySnTn(list[0].SN, list[0].TN); int i = 0; list.ForEach(v => { v.ID = p[i].ID; processor.Update <AlarmConfig>(v, tran); i++; }); } return(true); }
private void OK() { if (Common.TextBoxChecked(this.tbPwd) && Common.TextBoxChecked(this.tbNewPwd) && Common.TextBoxChecked(this.tbConfirm) && Common.PasswordConfirmed(tbNewPwd, tbConfirm)) { Common.User.Pwd = this.tbNewPwd.Text.TrimEnd(); if (processor == null) processor = new DeviceProcessor(); if (processor.Update<UserInfo>(Common.User, null)) MessageBox.Show("Change Successfully."); else MessageBox.Show("Change Failure."); form.Close(); } }
private void OK(object sender, EventArgs args) { if (processor == null) { processor = new DeviceProcessor(); } if (this.tbMean.Text == string.Empty) { MessageBox.Show("Please input the meaning"); } else { if (meaning == null) { Meanings mean = new Meanings(); object o = processor.QueryScalar("SELECT MAX(ID) FROM Meanings", null); mean.Id = o != null && o.ToString() != string.Empty ? Convert.ToInt32(o) + 1 : 1; mean.Desc = this.tbMean.Text.TrimEnd(); mean.Remark = DateTime.Now.ToString(); if (processor.Insert <Meanings>(mean, null)) { form.DialogResult = DialogResult.OK; } else { MessageBox.Show("Saved Failure"); form.DialogResult = DialogResult.No; } } else { Meanings mean = new Meanings(); mean.Id = meaning.First().Key; mean.Desc = this.tbMean.Text.TrimEnd(); mean.Remark = DateTime.Now.ToString(); if (processor.Update <Meanings>(mean, null)) { form.DialogResult = MessageBox.Show("Saved Successfully"); } else { MessageBox.Show("Saved Failure"); form.DialogResult = DialogResult.No; } } } }
private void OK() { if (Common.TextBoxChecked(this.tbPwd) && Common.TextBoxChecked(this.tbNewPwd) && Common.TextBoxChecked(this.tbConfirm) && Common.PasswordConfirmed(tbNewPwd, tbConfirm)) { Common.User.Pwd = this.tbNewPwd.Text.TrimEnd(); if (processor == null) { processor = new DeviceProcessor(); } if (processor.Update <UserInfo>(Common.User, null)) { MessageBox.Show(Messages.ChangeNewPasswordOk, Messages.TitleNotification); } else { MessageBox.Show(Messages.ChangeNewPasswordFailed, Messages.TitleError); } form.Close(); } }
public bool UpdateProfile(UserProfile profile) { return(processor.Update <UserProfile>(profile, null)); }
public bool UdateUser(UserInfo user) { return(processor.Update <UserInfo>(user, null)); }
public bool UpdateReportEditor(ReportEditor report) { return(processor.Update <ReportEditor>(report, null)); }