private void repFilter_EditValueChanged(object sender, EventArgs e) { HRM_CONTRACT hRMCONTRACT; if (this.m_Filter == "0") { hRMCONTRACT = new HRM_CONTRACT(); this.gcList.DataSource = hRMCONTRACT.GetList(this.m_Level, this.m_Code); } else if (this.m_Filter == "1") { hRMCONTRACT = new HRM_CONTRACT(); this.gcList.DataSource = hRMCONTRACT.GetCurrentList(this.m_Level, this.m_Code); } else if (!(this.m_Filter == "2")) { hRMCONTRACT = new HRM_CONTRACT(); this.gcList.DataSource = hRMCONTRACT.GetListExpiration(this.m_Level, this.m_Code); } else { hRMCONTRACT = new HRM_CONTRACT(); this.gcList.DataSource = hRMCONTRACT.GetListJustExpiration(this.m_Level, this.m_Code); } }
private void LoadGrid(int Level, string Code) { HRM_CONTRACT hRMCONTRACT = new HRM_CONTRACT(); if (!(Level == 0 || Level == 1 || Level == 2 || Level == 3 ? false : Level != 4)) { this.gcList.DataSource = hRMCONTRACT.GetList(Level, Code); } else if (Level == 5) { this.gcList.DataSource = hRMCONTRACT.GetListByEmployee(Code); } }
private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e) { string str; object rowCellValue; HRM_EMPLOYEE hRMEMPLOYEE; if (MyRule.IsDelete("bbiContract")) { bool flag = false; int[] selectedRows = this.gbList.GetSelectedRows(); if (XtraMessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No) { base.SetWaitDialogCaption("Đang xóa..."); HRM_CONTRACT hRMCONTRACT = new HRM_CONTRACT(); for (int i = (int)selectedRows.Length; i > 0; i--) { flag = true; rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "ContractCode"); this.m_EmployeeCode = this.gbList.GetRowCellValue(selectedRows[i - 1], "EmployeeCode").ToString(); if (rowCellValue != null) { // SYS_LOG.Insert("Hợp Đồng Lao Động", "Xoá", rowCellValue.ToString()); str = hRMCONTRACT.Delete(rowCellValue.ToString()); if (str == "OK") { this.gbList.DeleteRow(selectedRows[i - 1]); hRMEMPLOYEE = new HRM_EMPLOYEE(); hRMEMPLOYEE.Get(this.m_EmployeeCode); if (hRMEMPLOYEE.ContractCode == rowCellValue.ToString()) { hRMEMPLOYEE.ContractCode = ""; hRMEMPLOYEE.ContractType = ""; hRMEMPLOYEE.Update(); } } else if (str != "OK") { MessageBox.Show(string.Concat("Thông tin không được xóa", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } } this.DoHide(); if (!flag) { if (hRMCONTRACT.GetList(this.m_Level, this.m_Code).Rows.Count != 0) { rowCellValue = this.gbList.GetFocusedRowCellValue("ContractCode"); this.m_EmployeeCode = this.gbList.GetFocusedRowCellValue("EmployeeCode").ToString(); if (rowCellValue != null) { // SYS_LOG.Insert("Hợp Đồng Lao Động", "Xoá", rowCellValue.ToString()); base.SetWaitDialogCaption("Đang xóa..."); str = hRMCONTRACT.Delete(rowCellValue.ToString()); if (str == "OK") { this.gbList.DeleteRow(this.gbList.FocusedRowHandle); hRMEMPLOYEE = new HRM_EMPLOYEE(); hRMEMPLOYEE.Get(this.m_EmployeeCode); if (hRMEMPLOYEE.ContractCode == rowCellValue.ToString()) { hRMEMPLOYEE.ContractCode = ""; hRMEMPLOYEE.ContractType = ""; hRMEMPLOYEE.Update(); } } else if (str != "OK") { MessageBox.Show(string.Concat("Thông tin không được xóa", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand); } this.DoHide(); } } } } } }