Esempio n. 1
0
 public void RaiseUpdatedEventHander(DIC_ALLOWANCE Item)
 {
     if (this.Updated != null)
     {
         this.Updated(this, Item);
     }
 }
Esempio n. 2
0
 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();
         }
     }
 }
Esempio n. 3
0
 private void RaiseItemSelectedEventHander(DIC_ALLOWANCE item)
 {
     if (this.ItemSelected != null)
     {
         this.ItemSelected(this, item);
     }
 }
Esempio n. 4
0
        private void xfmAllowance_Added(object sender, DIC_ALLOWANCE Item)
        {
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();

            dICALLOWANCE.AddRepositoryGridLookupEdit(this.repAllowanceCode);
            dICALLOWANCE.AddRepositoryGridLookupEdit1(this.repAllowanceName);
        }
Esempio n. 5
0
 private void RaiseSuccessEventHander(DIC_ALLOWANCE item)
 {
     if (this.Success != null)
     {
         this.Success(this, item);
     }
 }
Esempio n. 6
0
        protected override string uc_Save()
        {
            string str;

            if (MyRule.Get(MyLogin.RoleId, "bbiAllowance") != "OK")
            {
                str = "";
            }
            else if (MyRule.AllowAdd)
            {
                // SYS_LOG.Insert("Danh Mục Phụ Cấp", "Thêm", this.txtID.Text);
                base.SetWaitDialogCaption("Đang lưu dữ liệu...");
                Cursor.Current = Cursors.WaitCursor;
                DIC_ALLOWANCE dICALLOWANCE = 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         = dICALLOWANCE.Insert();
                if (str1 == "OK")
                {
                    this.RaiseSuccessEventHander(dICALLOWANCE);
                }
                Cursor.Current = Cursors.Default;
                this.DoHide();
                if (str1 != "OK")
                {
                    XtraMessageBox.Show(str1, "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                str = str1;
            }
            else
            {
                MyRule.Notify();
                str = "";
            }
            return(str);
        }
Esempio n. 7
0
        protected override void Add()
        {
            base.Add();
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();

            this.txtID.Text = dICALLOWANCE.NewID();
            this.txtNAME.Focus();
        }
Esempio n. 8
0
        public xfmAllowanceAdd(Actions Action)
        {
            this.InitializeComponent();
            this.Init();
            this.ucAdd.Status = Action;
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();

            this.ucAdd.SetData(dICALLOWANCE.NewID());
            this.Text = "Thêm";
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        private void UpdateRow(DIC_ALLOWANCE item, RowClickEventArgs e)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int rowIndex = e.RowIndex;

            advBandedGridView.SetRowCellValue(rowIndex, "MaximumMoney", item.MaximumMoney);
            advBandedGridView.SetRowCellValue(rowIndex, "AllowanceCode", item.AllowanceCode);
            advBandedGridView.SetRowCellValue(rowIndex, "AllowanceName", item.AllowanceName);
            advBandedGridView.SetRowCellValue(rowIndex, "MaximumMoney", item.MaximumMoney);
            advBandedGridView.SetRowCellValue(rowIndex, "IncomeTaxValue", item.IncomeTaxValue);
            advBandedGridView.SetRowCellValue(rowIndex, "Description", item.Description);
            advBandedGridView.UpdateCurrentRow();
        }
Esempio n. 11
0
        protected override string uc_Delete()
        {
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE()
            {
                AllowanceCode = this.txtID.Text
            };
            string str = dICALLOWANCE.Delete();

            if (str == "OK")
            {
                this.RaiseSuccessEventHander(dICALLOWANCE);
            }
            return(str);
        }
Esempio n. 12
0
 public xfmAllowanceAdd(Actions Action, DIC_ALLOWANCE Item)
 {
     this.InitializeComponent();
     this.Init();
     this.ucAdd.Status = Action;
     if (Action == Actions.Update)
     {
         this.ucAdd.SetData(Item);
         this.Text = "Cập nhật";
     }
     else if (Action == Actions.Delete)
     {
         this.ucAdd.SetData(Item.AllowanceCode);
     }
 }
Esempio n. 13
0
 public void SetData(DIC_ALLOWANCE item)
 {
     this.txtID.Text = item.AllowanceCode;
     // SYS_LOG.Insert("Danh Mục Phụ Cấp", "Xem", this.txtID.Text);
     if (this.m_Status == Actions.Update)
     {
         this.txtID.Properties.ReadOnly = true;
     }
     this.txtNAME.Text = item.AllowanceName;
     this.calMaximumSalary.EditValue         = item.MaximumMoney;
     this.cheIsByWorkDay.Checked             = item.IsByWorkDay;
     this.calIncomeTaxValue.EditValue        = item.IncomeTaxValue;
     this.cheIsShowInSalaryTableList.Checked = item.IsShowInSalaryTableList;
     this.txtDescription.Text = item.Description;
 }
Esempio n. 14
0
        //private void gbList_ValidatingEditor(object sender, BaseContainerValidateEditorEventArgs e)
        //{
        //    if (!this.Exist(this.gcList.DataSource as DataTable, this.m_AllowanceCode))
        //    {
        //        this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
        //    }
        //    else
        //    {
        //        e.ErrorText = "Trùng phụ cấp - Nhấn ESC để phục hồi trạng thái bình thường!";
        //        e.Valid = false;
        //    }
        //}

        public void Init()
        {
            this.barManager1.SetPopupContextMenu(this.gcList, this.ppMenu);
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();
            //dICALLOWANCE.AddRepositoryGridLookupEdit(this.repAllowanceCode);
            //dICALLOWANCE.AddRepositoryGridLookupEdit1(this.repAllowanceName);
            //this.repAllowanceCode.EditValueChanged += new EventHandler(this.repAllowanceCode_EditValueChanged);
            //this.repAllowanceCode.EditValueChanging += new ChangingEventHandler(this.repAllowanceCode_EditValueChanging);
            //this.repAllowanceName.EditValueChanged += new EventHandler(this.repAllowanceName_EditValueChanged);
            //this.repAllowanceName.EditValueChanging += new ChangingEventHandler(this.repAllowanceName_EditValueChanging);
            //this.repMoney.EditValueChanging += new ChangingEventHandler(this.repMoney_EditValueChanging);
            //this.repMoney.EditValueChanged += new EventHandler(this.repMoney_EditValueChanged);
            //HRM_EMPLOYEE_ALLOWANCE hRMEMPLOYEEALLOWANCE = new HRM_EMPLOYEE_ALLOWANCE();
            //this.gcList.DataSource = hRMEMPLOYEEALLOWANCE.GetList(this.m_EmployeeCode);
        }
Esempio n. 15
0
        private void AddRow(DIC_ALLOWANCE Item)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int focusedRowHandle = advBandedGridView.FocusedRowHandle;

            advBandedGridView.AddNewRow();
            focusedRowHandle = advBandedGridView.FocusedRowHandle;
            advBandedGridView.SetRowCellValue(focusedRowHandle, "MaximumMoney", Item.MaximumMoney);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "AllowanceCode", Item.AllowanceCode);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "AllowanceName", Item.AllowanceName);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "MaximumMoney", Item.MaximumMoney);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "IncomeTaxValue", Item.IncomeTaxValue);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Description", Item.Description);
            advBandedGridView.UpdateCurrentRow();
        }
Esempio n. 16
0
 private void ucAdd_Success(object sender, DIC_ALLOWANCE Item)
 {
     if (this.ucAdd.Status == Actions.Add)
     {
         this.RaiseAddedEventHander(Item);
     }
     else if (this.ucAdd.Status == Actions.Update)
     {
         this.RaiseUpdatedEventHander(Item);
     }
     if (this.ucAdd.IsClose == CloseOrNew.Close)
     {
         base.Close();
     }
     this.ucAdd.Clear();
 }
Esempio n. 17
0
        //protected override void SendMail()
        //{
        //    if (!WinInet.IsConnectedToInternet())
        //    {
        //        XtraMessageBox.Show("Vui lòng kiểm tra lại kết nối với mạng internet!");
        //    }
        //    else
        //    {
        //        SendReportMail sendReportMail = new SendReportMail();
        //        if (!sendReportMail.IsLoginMail())
        //        {
        //            sendReportMail.LoginSuccessed += new SendReportMail.LoginSuccessHander((object s) => this.SendMail("", true));
        //            sendReportMail.Sended += new SendReportMail.SendHander((object s, string content, bool attach) => this.SendMail(content, attach));
        //            sendReportMail.LoginMail(2);
        //            return;
        //        }
        //        if ((new clsAllOption()).ShowSendMail)
        //        {
        //            xfmMailContent _xfmMailContent = new xfmMailContent(2);
        //            _xfmMailContent.Sended += new xfmMailContent.SendHander((object s, string content, bool attach) => {
        //                _xfmMailContent.Close();
        //                this.SendMail(content, attach);
        //            });
        //            _xfmMailContent.ShowDialog();
        //        }
        //        else
        //        {
        //            this.SendMail("", true);
        //        }
        //    }
        //}

        //private void SendMail(string Content, bool Attach)
        //{
        //    if (Content == "")
        //    {
        //        Content = this.LoadMailContent();
        //    }
        //    HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();
        //    int[] selectedRows = this.gbList.GetSelectedRows();
        //    int length = (int)selectedRows.Length;
        //    while (length > 0)
        //    {
        //        string str = this.gbList.GetRowCellValue(selectedRows[length - 1], "EmployeeCode").ToString();
        //        hRMEMPLOYEE.Get(str);
        //        if (!(hRMEMPLOYEE.Email == ""))
        //        {
        //            clsOptionPrintSalary _clsOptionPrintSalary = new clsOptionPrintSalary();
        //            XtraReport xtraReport = new XtraReport();
        //            if (_clsOptionPrintSalary.Theme == 0)
        //            {
        //                xtraReport = new rptSalary(this.m_Month, this.m_Year, str);
        //            }
        //            else if (_clsOptionPrintSalary.Theme != 1)
        //            {
        //                xtraReport = new rptSalary3(this.m_Month, this.m_Year, str);
        //            }
        //            else
        //            {
        //                xtraReport = new rptSalary2(this.m_Month, this.m_Year, str);
        //            }
        //            SendReportMail sendReportMail = new SendReportMail();
        //            string str1 = "";
        //            str1 = (!hRMEMPLOYEE.Sex ? "Chị" : "Anh");
        //            string str2 = Content.Replace("[Mã nhân viên]", str);
        //            str2 = str2.Replace("[Họ lót]", hRMEMPLOYEE.FirstName);
        //            str2 = str2.Replace("[Tên]", hRMEMPLOYEE.LastName);
        //            string[] strArrays = new string[5];
        //            int birthdayDay = hRMEMPLOYEE.BirthdayDay;
        //            strArrays[0] = birthdayDay.ToString();
        //            strArrays[1] = "/";
        //            birthdayDay = hRMEMPLOYEE.BirthdayMonth;
        //            strArrays[2] = birthdayDay.ToString();
        //            strArrays[3] = "/";
        //            birthdayDay = hRMEMPLOYEE.BirthdayYear;
        //            strArrays[4] = birthdayDay.ToString();
        //            str2 = str2.Replace("[Ngày sinh]", string.Concat(strArrays));
        //            str2 = str2.Replace("[Giới tính]", str1);
        //            str2 = str2.Replace("[Nơi sinh]", hRMEMPLOYEE.BirthPlace);
        //            str2 = str2.Replace("[Địa chỉ]", hRMEMPLOYEE.MainAddress);
        //            str2 = str2.Replace("[Tạm trú]", hRMEMPLOYEE.ContactAddress);
        //            str2 = str2.Replace("[CMND]", hRMEMPLOYEE.IDCard);
        //            str2 = str2.Replace("[Email]", hRMEMPLOYEE.Email);
        //            str2 = str2.Replace("[Điện thoại]", hRMEMPLOYEE.CellPhone);
        //            str2 = str2.Replace("[Chức vụ]", hRMEMPLOYEE.Position);
        //            str2 = str2.Replace("[Chi nhánh]", hRMEMPLOYEE.BranchName);
        //            str2 = str2.Replace("[Phòng ban]", hRMEMPLOYEE.DepartmentName);
        //            str2 = str2.Replace("[Tổ nhóm]", hRMEMPLOYEE.GroupName);
        //            decimal basicSalary = hRMEMPLOYEE.BasicSalary;
        //            str2 = str2.Replace("[Lương căn bản]", basicSalary.ToString("#,0"));
        //            str2 = str2.Replace("[Tháng]", this.m_Month.ToString());
        //            str2 = str2.Replace("[Năm]", this.m_Year.ToString());
        //            str2 = str2.Replace("[Xuống dòng]", "<br/>");
        //            sendReportMail.Send(hRMEMPLOYEE.Email, string.Concat(MyLogin.Account, " - ", MyInfo.Company), string.Concat("Phiếu Lương Tháng ", this.m_Month.ToString(), "/", this.m_Year.ToString()), str2, xtraReport, string.Concat(hRMEMPLOYEE.EmployeeCode, "_", this.m_Month.ToString(), this.m_Year.ToString()), Attach);
        //            length--;
        //        }
        //        else
        //        {
        //            XtraMessageBox.Show("Chưa thiết lập địa chỉ email cho nhân viên này!");
        //            break;
        //        }
        //    }
        //}

        private void UpdateAllowanceRow()
        {
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();
            HRM_SALARY    hRMSALARY    = new HRM_SALARY();

            foreach (DataRow row in dICALLOWANCE.GetList().Rows)
            {
                try
                {
                    this.gbList.SetFocusedRowCellValue(row["AllowanceCode"].ToString(), hRMSALARY.GetTotalAllowance(this.m_SalaryTableListID, this.m_EmployeeCode, row["AllowanceCode"].ToString(), false));
                    this.gbList.SetFocusedRowCellValue(string.Concat("Tax", row["AllowanceCode"].ToString()), hRMSALARY.GetTotalAllowance(this.m_SalaryTableListID, this.m_EmployeeCode, row["AllowanceCode"].ToString(), true));
                }
                catch
                {
                }
            }
        }
Esempio n. 18
0
        private void txtID_KeyDown_1(object sender, KeyEventArgs e)
        {
            TextEdit textEdit = (TextEdit)sender;

            if (e.KeyCode == Keys.Return | e.KeyCode == Keys.Tab)
            {
                DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();
                if (this.m_Status == Actions.Add)
                {
                    if (dICALLOWANCE.Exist(textEdit.Text))
                    {
                        this.Err.SetError(textEdit, "Mã đã tồn tại.");
                        textEdit.Focus();
                    }
                }
            }
        }
Esempio n. 19
0
        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);
        }
Esempio n. 20
0
        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();
        }
Esempio n. 21
0
        public override void ReLoad()
        {
            base.SetWaitDialogCaption("Đang nạp dữ liệu...");
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();

            this.gcList.DataSource = dICALLOWANCE.GetList();
            base.SetWaitDialogCaption("Đang nạp cấu hình...");
            this.List_Init(this.gbList);
            base.SetWaitDialogCaption("Nạp quyền sử dụng...");
            MyRule.Get(MyLogin.RoleId, "bbiAllowance");
            if (!MyRule.AllowPrint)
            {
                this.ucToolBar.bbiPrint.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiAllowance");
            if (!MyRule.AllowExport)
            {
                this.ucToolBar.bbiExport.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiAllowance");
            if (!MyRule.AllowAdd)
            {
                this.ucToolBar.bbiAdd.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiAllowance");
            if (!MyRule.AllowDelete)
            {
                this.ucToolBar.bbiDelete.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiAllowance");
            if (!MyRule.AllowEdit)
            {
                this.ucToolBar.bbiEdit.Visibility = BarItemVisibility.Never;
            }
            base.SetWaitDialogCaption("Đã xong...");
            this.DoHide();
        }
Esempio n. 22
0
        public void Init(Guid SalaryTableListID, string EmployeeCode)
        {
            this.barManager1.SetPopupContextMenu(this.gcList, this.ppMenu);
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();

            dICALLOWANCE.AddRepositoryGridLookupEdit(this.repAllowanceCode);
            dICALLOWANCE.AddRepositoryGridLookupEdit1(this.repAllowanceName);
            this.repAllowanceCode.EditValueChanged  += new EventHandler(this.repAllowanceCode_EditValueChanged);
            this.repAllowanceCode.EditValueChanging += new ChangingEventHandler(this.repAllowanceCode_EditValueChanging);
            this.repAllowanceName.EditValueChanged  += new EventHandler(this.repAllowanceName_EditValueChanged);
            this.repAllowanceName.EditValueChanging += new ChangingEventHandler(this.repAllowanceName_EditValueChanging);
            this.repMoney.EditValueChanging         += new ChangingEventHandler(this.repMoney_EditValueChanging);
            this.repMoney.EditValueChanged          += new EventHandler(this.repMoney_EditValueChanged);
            HRM_SALARY_ALLOWANCE hRMSALARYALLOWANCE = new HRM_SALARY_ALLOWANCE();
            Guid salaryTableListID = SalaryTableListID;
            Guid guid = salaryTableListID;

            this.m_SalaryTableListID = salaryTableListID;
            string employeeCode = EmployeeCode;
            string str          = employeeCode;

            this.m_EmployeeCode    = employeeCode;
            this.gcList.DataSource = hRMSALARYALLOWANCE.GetListByEmployee(guid, str);
        }
Esempio n. 23
0
 private void frm_Updated(object sender, DIC_ALLOWANCE Item)
 {
     this.UpdateRow(Item, this.m_RowClickEventArgs);
 }
Esempio n. 24
0
 private void frm_Added(object sender, DIC_ALLOWANCE e)
 {
     this.AddRow(e);
 }
Esempio n. 25
0
        public override void Delete()
        {
            object cellValue;

            if (!(MyRule.Get(MyLogin.RoleId, "bbiAllowance") != "OK"))
            {
                if (MyRule.AllowDelete)
                {
                    if (ClsOption.System2.IsQuestion)
                    {
                        if (XtraMessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            return;
                        }
                    }
                    base.SetWaitDialogCaption("Đang xóa...");
                    string            str  = "";
                    bool              flag = false;
                    AdvBandedGridView advBandedGridView = this.gbList;
                    int[]             selectedRows      = advBandedGridView.GetSelectedRows();
                    DIC_ALLOWANCE     dICALLOWANCE      = new DIC_ALLOWANCE();
                    for (int i = (int)selectedRows.Length; i > 0; i--)
                    {
                        flag      = true;
                        cellValue = base.GetCellValue(selectedRows[i - 1], "AllowanceCode");
                        if (cellValue != null)
                        {
                            SYS_LOG.Insert("Danh Mục Phụ Cấp", "Xoá", cellValue.ToString());
                            str = dICALLOWANCE.Delete(cellValue.ToString());
                            if (str == "OK")
                            {
                                advBandedGridView.DeleteRow(selectedRows[i - 1]);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show(string.Concat("Thông tin không được xóa\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                    }
                    this.DoHide();
                    if (!flag)
                    {
                        if (advBandedGridView.DataSource != null)
                        {
                            RowClickEventArgs rowClickEventArg = new RowClickEventArgs((advBandedGridView == null ? -1 : advBandedGridView.FocusedRowHandle), (advBandedGridView.FocusedColumn == null ? -1 : advBandedGridView.FocusedColumn.ColumnHandle), (advBandedGridView.FocusedColumn == null ? "" : advBandedGridView.FocusedColumn.FieldName));
                            this.m_RowClickEventArgs = rowClickEventArg;
                            cellValue = null;
                            cellValue = base.GetCellValue(rowClickEventArg.RowIndex, "AllowanceCode");
                            if (cellValue != null)
                            {
                                SYS_LOG.Insert("Danh Mục Phụ Cấp", "Xoá", cellValue.ToString());
                                base.SetWaitDialogCaption("Đang xóa...");
                                str = dICALLOWANCE.Delete(cellValue.ToString());
                                if (str == "OK")
                                {
                                    advBandedGridView.DeleteRow(rowClickEventArg.RowIndex);
                                }
                                else if (str != "OK")
                                {
                                    MessageBox.Show(string.Concat("Thông tin không được xóa\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                }
                                this.DoHide();
                            }
                        }
                    }
                }
                else
                {
                    MyRule.Notify();
                }
            }
        }