Ejemplo n.º 1
0
        protected void EditSchedulerHistory_Click(object sender, DirectEventArgs e)
        {
            int id;

            if (!int.TryParse(hdfKeyRecord.Text, out id) || id <= 0)
            {
                return;
            }
            var schedulerHistory = SchedulerHistoryServices.GetById(id);

            if (schedulerHistory != null)
            {
                cbxScheduler.SelectedItem.Text = schedulerHistory.SchedulerName;
                txtDescription.Text            = schedulerHistory.Description;
                chkHasError.Checked            = schedulerHistory.HasError;
                txtErrorMessage.Text           = schedulerHistory.ErrorMessage;
                txtErrorDescription.Text       = schedulerHistory.ErrorDescription;
                txtStartTime.SelectedDate      = schedulerHistory.StartTime;
                txtEndTime.SelectedDate        = schedulerHistory.EndTime;
            }
            // show window
            btnUpdate.Show();
            btnUpdateClose.Hide();

            wdTimeSheetRule.Title = @"Cập nhật quản lý lịch sử tiến trình";
            wdTimeSheetRule.Show();
        }
Ejemplo n.º 2
0
 private void Update()
 {
     try
     {
         var util = new Util();
         if (string.IsNullOrEmpty(hdfKeyRecord.Text))
         {
             return;
         }
         var schedulerHistory = SchedulerHistoryServices.GetById(Convert.ToInt32(hdfKeyRecord.Text));
         if (schedulerHistory == null)
         {
             return;
         }
         int schedulerId;
         if (int.TryParse(cbxScheduler.SelectedItem.Value, out schedulerId))
         {
             schedulerHistory.SchedulerId = schedulerId;
         }
         if (!string.IsNullOrEmpty(txtDescription.Text))
         {
             schedulerHistory.Description = txtDescription.Text.Trim();
         }
         schedulerHistory.HasError = chkHasError.Checked;
         if (!string.IsNullOrEmpty(txtErrorMessage.Text))
         {
             schedulerHistory.ErrorMessage = txtErrorMessage.Text.Trim();
         }
         if (!string.IsNullOrEmpty(txtErrorDescription.Text))
         {
             schedulerHistory.ErrorDescription = txtErrorDescription.Text.Trim();
         }
         if (!util.IsDateNull(txtStartTime.SelectedDate))
         {
             schedulerHistory.StartTime = txtStartTime.SelectedDate;
         }
         if (!util.IsDateNull(txtEndTime.SelectedDate))
         {
             schedulerHistory.EndTime = txtEndTime.SelectedDate;
         }
         SchedulerHistoryServices.Update(schedulerHistory);
     }
     catch (Exception ex)
     {
         Dialog.Alert("Có lỗi xảy ra trong quá trình cập nhật: {0}".FormatWith(ex.Message));
     }
 }