public override void Change() { if (!(MyRule.Get(MyLogin.RoleId, "bbiAllowance") != "OK")) { if (MyRule.AllowAccess) { DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE(); object cellValue = base.GetCellValue(this.m_RowClickEventArgs.RowIndex, "AllowanceCode"); if (cellValue != null) { base.SetWaitDialogCaption("Đang kiểm tra dữ liệu...."); if (!(dICALLOWANCE.Get(cellValue.ToString()) != "OK")) { this.DoHide(); xfmAllowanceAdd _xfmAllowanceAdd = new xfmAllowanceAdd(Actions.Update, dICALLOWANCE); _xfmAllowanceAdd.Updated += new xfmAllowanceAdd.UpdatedEventHander(this.frm_Updated); _xfmAllowanceAdd.Added += new xfmAllowanceAdd.AddedEventHander(this.frm_Added); _xfmAllowanceAdd.ShowDialog(); } else { this.DoHide(); XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } else { MyRule.Notify(); } } }
private void CreateRowData() { DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE(); dICALLOWANCE.Get(this.m_AllowanceCode); this.gbList.SetFocusedRowCellValue(this.colEmployeeCode, this.m_EmployeeCode); this.gbList.SetFocusedRowCellValue(this.colAllowanceCode, dICALLOWANCE.AllowanceCode); this.gbList.SetFocusedRowCellValue(this.colAllowanceName, dICALLOWANCE.AllowanceCode); this.gbList.SetFocusedRowCellValue(this.colMoney, dICALLOWANCE.MaximumMoney); this.gbList.SetFocusedRowCellValue(this.colIncomeTaxValue, dICALLOWANCE.IncomeTaxValue); }
protected override string uc_Update() { string str; if (MyRule.Get(MyLogin.RoleId, "bbiAllowance") != "OK") { str = ""; } else if (MyRule.AllowEdit) { // SYS_LOG.Insert("Danh Mục Phụ Cấp", "Cập Nhật", this.txtID.Text); base.SetWaitDialogCaption("Đang cập nhật dữ liệu..."); DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE(); dICALLOWANCE.Get(this.txtID.Text); DIC_ALLOWANCE dICALLOWANCE1 = new DIC_ALLOWANCE(this.txtID.Text, this.txtNAME.Text, Convert.ToDecimal(this.calMaximumSalary.EditValue), this.cheIsByWorkDay.Checked, Convert.ToDouble(this.calIncomeTaxValue.EditValue), this.cheIsShowInSalaryTableList.Checked, this.txtDescription.Text); string str1 = dICALLOWANCE1.Update(); if (str1 == "OK") { this.RaiseSuccessEventHander(dICALLOWANCE1); if ((dICALLOWANCE.IsByWorkDay != dICALLOWANCE1.IsByWorkDay ? true : dICALLOWANCE.IncomeTaxValue != dICALLOWANCE1.IncomeTaxValue)) { if (XtraMessageBox.Show("Bạn có muốn thay đổi thông tin phụ cấp của tất cả nhân viên không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { this.DoHide(); str = ""; return(str); } dICALLOWANCE1.UpdateEmployeeAllowance(dICALLOWANCE1.AllowanceCode, this.cheIsByWorkDay.Checked, Convert.ToDouble(this.calIncomeTaxValue.EditValue)); } } if (str1 != "OK") { XtraMessageBox.Show(str1, "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.DoHide(); str = str1; } else { MyRule.Notify(); str = ""; } return(str); }
private void UpdateRow(HRM_SALARY_ALLOWANCE item) { GridView gridView = this.gbList; int focusedRowHandle = this.gbList.FocusedRowHandle; gridView.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode); HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE(); hRMEMPLOYEE.Get(item.EmployeeCode); DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE(); dICALLOWANCE.Get(item.AllowanceCode); gridView.SetRowCellValue(focusedRowHandle, "FirstName", hRMEMPLOYEE.FirstName); gridView.SetRowCellValue(focusedRowHandle, "LastName", hRMEMPLOYEE.LastName); gridView.SetRowCellValue(focusedRowHandle, "AllowanceCode", item.AllowanceCode); gridView.SetRowCellValue(focusedRowHandle, "AllowanceName", dICALLOWANCE.AllowanceName); gridView.SetRowCellValue(focusedRowHandle, "Money", item.Money); gridView.SetRowCellValue(focusedRowHandle, "IncomeTaxValue", item.IncomeTaxValue); gridView.UpdateCurrentRow(); }