예제 #1
0
        private void Update()
        {
            try
            {
                if (!string.IsNullOrEmpty(hdfKeyRecord.Text))
                {
                    var userRule = UserRuleTimeSheetServices.GetById(Convert.ToInt32(hdfKeyRecord.Text));
                    if (userRule != null)
                    {
                        if (!string.IsNullOrEmpty(hdfUpdateGroupWorkShift.Text))
                        {
                            userRule.GroupWorkShiftId = Convert.ToInt32(hdfUpdateGroupWorkShift.Text);
                            userRule.EditedDate       = DateTime.Now;
                        }

                        UserRuleTimeSheetServices.Update(userRule);
                    }
                    gridUserRule.Reload();
                }
            }
            catch (Exception ex)
            {
                Dialog.Alert("Có lỗi xảy ra trong quá trình cập nhật: {0}".FormatWith(ex.Message));
            }
        }
예제 #2
0
 protected void EditUserRule_Click(object sender, DirectEventArgs e)
 {
     if (!string.IsNullOrEmpty(hdfKeyRecord.Text))
     {
         var userRule = UserRuleTimeSheetServices.GetById(Convert.ToInt32(hdfKeyRecord.Text));
         if (userRule != null)
         {
             txtFullName.Text             = hr_RecordServices.GetFieldValueById(userRule.RecordId, "FullName");
             cbxUpdateGroupWorkShift.Text =
                 hr_TimeSheetGroupWorkShiftServices.GetFieldValueById(userRule.GroupWorkShiftId, "Name");
         }
         wdUpdateUserRule.Show();
     }
 }