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)); } }
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(); } }