Example #1
0
        public void Save()
        {
            HRM_SALARY_ALLOWANCE hRMSALARYALLOWANCE = new HRM_SALARY_ALLOWANCE();

            hRMSALARYALLOWANCE.DeleteAll(this.m_SalaryTableListID, this.m_EmployeeCode);
            try
            {
                if ((this.gcList.DataSource as DataTable).Rows.Count > 0)
                {
                    foreach (DataRow row in (this.gcList.DataSource as DataTable).Rows)
                    {
                        try
                        {
                            if (row != null)
                            {
                                hRMSALARYALLOWANCE.Insert(this.m_SalaryTableListID, this.m_EmployeeCode, row["AllowanceCode"].ToString(), decimal.Parse(row["Money"].ToString()), double.Parse(row["IncomeTaxValue"].ToString()));
                            }
                        }
                        catch
                        {
                            continue;
                        }
                    }
                }
                this.UpdateEmployeeSalary();
                this.RaiseSavedHander();
            }
            catch
            {
            }
        }
Example #2
0
 protected override void Change()
 {
     if (MyRule.IsAccess("bbiSalary"))
     {
         HRM_SALARY_ALLOWANCE hRMSALARYALLOWANCE = new HRM_SALARY_ALLOWANCE();
         object focusedRowCellValue = this.gbList.GetFocusedRowCellValue("EmployeeCode");
         object obj = this.gbList.GetFocusedRowCellValue("AllowanceCode");
         if ((focusedRowCellValue == null ? false : obj != null))
         {
             base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
             if (!(hRMSALARYALLOWANCE.Get(this.m_SalaryTableListID, focusedRowCellValue.ToString(), obj.ToString()) != "OK"))
             {
                 this.DoHide();
                 //xfmSalaryAllowanceAdd _xfmSalaryAllowanceAdd = new xfmSalaryAllowanceAdd(Actions.Update, hRMSALARYALLOWANCE);
                 //_xfmSalaryAllowanceAdd.Updated += new xfmSalaryAllowanceAdd.UpdatedEventHander(this.frm_Updated);
                 //_xfmSalaryAllowanceAdd.Added += new xfmSalaryAllowanceAdd.AddedEventHander(this.frm_Added);
                 //_xfmSalaryAllowanceAdd.ShowDialog();
             }
             else
             {
                 this.DoHide();
                 XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
 }
 private void CreateSalaryTabelList()
 {
     Options.SetWaitDialogCaption("Đang khởi tạo dữ liệu...");
     if ((new HRM_TIMEKEEPER_TABLELIST()).Exist(this.m_Month, this.m_Year))
     {
         HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST();
         DIC_SALARY_FORMULA   dICSALARYFORMULA   = new DIC_SALARY_FORMULA();
         dICSALARYFORMULA.Get();
         if (!hRMSALARYTABLELIST.Exist(this.m_Month, this.m_Year))
         {
             Guid guid = Guid.NewGuid();
             if (hRMSALARYTABLELIST.Insert(guid.ToString(), string.Concat("Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString()), this.m_Month, this.m_Year, dICSALARYFORMULA.SocialInsurance, dICSALARYFORMULA.HealthInsurance, dICSALARYFORMULA.UnemploymentInsurance, dICSALARYFORMULA.SocialInsurance1, dICSALARYFORMULA.HealthInsurance1, dICSALARYFORMULA.UnemploymentInsurance1, dICSALARYFORMULA.OvertimeSaturdayType, false, false) == "OK")
             {
                 HRM_SALARY_ALLOWANCE.Create(guid.ToString(), true);
                 HRM_SALARY_INCOME.Create(guid.ToString());
                 HRM_SALARY.Create(0, "", guid.ToString(), string.Concat("Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString()), this.m_Month, this.m_Year);
             }
             this.RaiseCreatedHandler();
         }
         Options.HideDialog();
     }
     else
     {
         MessageBox.Show("Bảng chấm công tháng này chưa được khởi tạo! Vui lòng tạo bảng chấm công trước khi thực hiện tính lương!");
         Options.HideDialog();
     }
 }
Example #4
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);
        }
Example #5
0
        protected override void ReCreate()
        {
            base.ReCreate();
            Options.SetWaitDialogCaption("Đang tính lại lương...");
            HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST();
            DIC_SALARY_FORMULA   dICSALARYFORMULA   = new DIC_SALARY_FORMULA();

            dICSALARYFORMULA.Get();
            hRMSALARYTABLELIST.Update(this.m_SalaryTableListID.ToString(), this.bbeName.EditValue.ToString(), this.m_Month, this.m_Year, dICSALARYFORMULA.SocialInsurance, dICSALARYFORMULA.HealthInsurance, dICSALARYFORMULA.UnemploymentInsurance, dICSALARYFORMULA.SocialInsurance1, dICSALARYFORMULA.HealthInsurance1, dICSALARYFORMULA.UnemploymentInsurance1, dICSALARYFORMULA.OvertimeSaturdayType, false, false);
            clsSalaryOption _clsSalaryOption = new clsSalaryOption();

            HRM_SALARY_ALLOWANCE.Create(this.m_SalaryTableListID.ToString(), _clsSalaryOption.IsAllowanceReCreate);
            HRM_SALARY_INCOME.Create(this.m_SalaryTableListID.ToString());
            HRM_SALARY.Create(this.m_Level, this.m_Code, this.m_SalaryTableListID.ToString(), this.bbeName.EditValue.ToString(), this.m_Month, this.m_Year);
            this.LoadGrid();
            Options.HideDialog();
        }
Example #6
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();
        }
Example #7
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);
        }
Example #8
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();
            }
        }
Example #9
0
 private void frm_Updated(object sender, HRM_SALARY_ALLOWANCE Item)
 {
     this.UpdateRow(Item);
 }
Example #10
0
 private void frm_Added(object sender, HRM_SALARY_ALLOWANCE Item)
 {
     this.AddRow(Item);
 }