Beispiel #1
0
        public bool UpdatePoint(PointInfo point, DbTransaction tran)
        {
            PointInfo p = GetPointsListByTNSN(point.SN, point.TN);

            point.ID = p.ID;
            return(processor.Update <PointInfo>(point, tran));
        }
Beispiel #2
0
        public bool UpdateLogConfig(LogConfig config, DbTransaction tran)
        {
            LogConfig p = GetLogConfigBySNTN(config.SN, config.TN);

            config.ID = p.ID;
            return(processor.Update <LogConfig>(config, tran));
        }
Beispiel #3
0
        public bool UpdateDevice(Device device, DbTransaction tran)
        {
            Device d = GetDeviceBySnTn(device.SerialNum, device.TripNum);

            device.ID = d.ID;
            return(processor.Update <Device>(device, tran));
        }
Beispiel #4
0
 public bool InsertOrUpdate(Policy entity, bool flag)
 {
     if (flag)
     {
         return(processor.Insert <Policy>(entity, null));
     }
     else
     {
         return(processor.Update <Policy>(entity, null));
     }
 }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 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);
 }
Beispiel #8
0
 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();
     }
 }
Beispiel #9
0
 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;
             }
         }
     }
 }
Beispiel #10
0
 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();
     }
 }
Beispiel #11
0
 public bool UpdateProfile(UserProfile profile)
 {
     return(processor.Update <UserProfile>(profile, null));
 }
Beispiel #12
0
 public bool UdateUser(UserInfo user)
 {
     return(processor.Update <UserInfo>(user, null));
 }
Beispiel #13
0
 public bool UpdateReportEditor(ReportEditor report)
 {
     return(processor.Update <ReportEditor>(report, null));
 }