Exemple #1
0
        protected override void LoadGrid()
        {
            base.LoadGrid();
            this.bbeName.EditValue = string.Concat("Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString());
            this.lbSalaryName.Text = string.Concat("Bảng Phụ Cấp Lương Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString());
            HRM_SALARY_ALLOWANCE hRMSALARYALLOWANCE = new HRM_SALARY_ALLOWANCE();

            this.gcList.DataSource = hRMSALARYALLOWANCE.GetList(this.m_Level, this.m_Code, this.m_SalaryTableListID);
        }
Exemple #2
0
        protected override void Delete()
        {
            string str;
            object rowCellValue;
            object focusedRowCellValue;

            if (MyRule.IsDelete("bbiSalary"))
            {
                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_SALARY_ALLOWANCE hRMSALARYALLOWANCE = new HRM_SALARY_ALLOWANCE();
                    for (int i = (int)selectedRows.Length; i > 0; i--)
                    {
                        flag                = true;
                        rowCellValue        = this.gbList.GetRowCellValue(selectedRows[i - 1], "EmployeeCode");
                        focusedRowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "AllowanceCode");
                        if ((rowCellValue == null ? false : focusedRowCellValue != null))
                        {
                            SYS_LOG.Insert("Phụ Cấp Lương", "Xoá", focusedRowCellValue.ToString());
                            str = hRMSALARYALLOWANCE.Delete(this.m_SalaryTableListID, rowCellValue.ToString(), focusedRowCellValue.ToString());
                            if (str == "OK")
                            {
                                this.gbList.DeleteRow(selectedRows[i - 1]);
                            }
                            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 (hRMSALARYALLOWANCE.GetList(this.m_Level, this.m_Code, this.m_SalaryTableListID).Rows.Count != 0)
                        {
                            rowCellValue        = this.gbList.GetFocusedRowCellValue("EmployeeCode");
                            focusedRowCellValue = this.gbList.GetFocusedRowCellValue("AllowanceCode");
                            if ((rowCellValue == null ? false : focusedRowCellValue != null))
                            {
                                SYS_LOG.Insert("Phụ Cấp Lương", "Xoá", focusedRowCellValue.ToString());
                                base.SetWaitDialogCaption("Đang xóa...");
                                str = hRMSALARYALLOWANCE.Delete(this.m_SalaryTableListID, rowCellValue.ToString(), focusedRowCellValue.ToString());
                                if (str == "OK")
                                {
                                    this.gbList.DeleteRow(this.gbList.FocusedRowHandle);
                                }
                                else if (str != "OK")
                                {
                                    MessageBox.Show(string.Concat("Thông tin không được xóa\r\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                }
                                this.DoHide();
                            }
                        }
                    }
                }
            }
            else
            {
                MyRule.Notify();
            }
        }