Beispiel #1
0
        private void UpdateIncomeRow()
        {
            HRM_SALARY_INCOME hRMSALARYINCOME = new HRM_SALARY_INCOME();
            HRM_SALARY        hRMSALARY       = new HRM_SALARY();

            foreach (DataRow row in hRMSALARYINCOME.GetList().Rows)
            {
                try
                {
                    this.gbList.SetFocusedRowCellValue(string.Concat("Income", row["IncomeCode"].ToString()), hRMSALARY.GetTotalIncome(this.m_SalaryTableListID, this.m_EmployeeCode, row["IncomeCode"].ToString()));
                }
                catch
                {
                }
            }
        }
Beispiel #2
0
        private void InitSalaryPlusMinus()
        {
            //BandedGridColumn column = null;
            //  DataRow row = null;
            BandedGridColumn        bandedGridColumn;
            GridSummaryItem         gridGroupSummaryItem;
            BandedGridColumn        blue;
            GridSummaryItem         gridSummaryItem;
            List <BandedGridColumn> bandedGridColumns = new List <BandedGridColumn>();

            foreach (BandedGridColumn column in this.bandPlusMinusBefore.Columns)
            {
                bandedGridColumns.Add(column);
            }
            foreach (BandedGridColumn bandedGridColumn1 in bandedGridColumns)
            {
                this.gbList.Columns.Remove(bandedGridColumn1);
            }
            List <BandedGridColumn> bandedGridColumns1 = new List <BandedGridColumn>();

            foreach (BandedGridColumn column1 in this.bandPlusMinusAfter.Columns)
            {
                bandedGridColumns1.Add(column1);
            }
            foreach (BandedGridColumn bandedGridColumn2 in bandedGridColumns1)
            {
                this.gbList.Columns.Remove(bandedGridColumn2);
            }
            if (!(this.m_SalaryTableListID == Guid.Empty))
            {
                HRM_SALARY_DEDUCTION hRMSALARYDEDUCTION = new HRM_SALARY_DEDUCTION();
                DataTable            list = hRMSALARYDEDUCTION.GetList(this.m_SalaryTableListID, true);
                foreach (DataRow row in list.Rows)
                {
                    bandedGridColumn = new BandedGridColumn()
                    {
                        FieldName  = string.Concat("Deduction", row["DeductionCode"].ToString()),
                        Caption    = string.Concat(row["DeductionName"].ToString().Remove(1).ToUpper(), row["DeductionName"].ToString().Remove(0, 1).ToLower()),
                        ColumnEdit = this.repCalculator,
                        Name       = string.Concat("colDeductionCode", row["DeductionCode"].ToString())
                    };
                    bandedGridColumn.AppearanceHeader.Options.UseForeColor = true;
                    bandedGridColumn.AppearanceHeader.ForeColor            = Color.Blue;
                    bandedGridColumn.AppearanceCell.Options.UseBackColor   = true;
                    bandedGridColumn.AppearanceCell.BackColor  = Color.Azure;
                    bandedGridColumn.OptionsColumn.ReadOnly    = true;
                    bandedGridColumn.SummaryItem.DisplayFormat = "{0:##,##0}";
                    bandedGridColumn.SummaryItem.SummaryType   = SummaryItemType.Sum;
                    bandedGridColumn.Visible = true;
                    bandedGridColumn.Width   = 76;
                    this.bandPlusMinusBefore.Columns.Add(bandedGridColumn);
                    gridGroupSummaryItem = new GridGroupSummaryItem(SummaryItemType.Sum, bandedGridColumn.FieldName, bandedGridColumn, "{0:##,##0}");
                    this.gbList.GroupSummary.Add(gridGroupSummaryItem);
                    bandedGridColumn.Width = 76;
                }
                HRM_SALARY_INCOME hRMSALARYINCOME = new HRM_SALARY_INCOME();
                DataTable         dataTable       = hRMSALARYINCOME.GetList(this.m_SalaryTableListID, true);
                if (dataTable.Rows.Count + list.Rows.Count <= 0)
                {
                    this.bandPlusMinusBefore.Visible = false;
                }
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    blue = new BandedGridColumn()
                    {
                        FieldName  = string.Concat("Income", dataRow["IncomeCode"].ToString()),
                        Caption    = string.Concat(dataRow["IncomeName"].ToString().Remove(1).ToUpper(), dataRow["IncomeName"].ToString().Remove(0, 1).ToLower()),
                        ColumnEdit = this.repCalculator,
                        Name       = string.Concat("colIncomeCode", dataRow["IncomeCode"].ToString())
                    };
                    blue.AppearanceHeader.Options.UseForeColor = true;
                    blue.AppearanceHeader.ForeColor            = Color.Blue;
                    blue.AppearanceCell.Options.UseBackColor   = true;
                    blue.AppearanceCell.BackColor  = Color.Azure;
                    blue.OptionsColumn.ReadOnly    = true;
                    blue.SummaryItem.DisplayFormat = "{0:##,##0}";
                    blue.SummaryItem.SummaryType   = SummaryItemType.Sum;
                    blue.Visible = true;
                    blue.Width   = 76;
                    this.bandPlusMinusBefore.Columns.Add(blue);
                    gridSummaryItem = new GridGroupSummaryItem(SummaryItemType.Sum, blue.FieldName, blue, "{0:##,##0}");
                    this.gbList.GroupSummary.Add(gridSummaryItem);
                    blue.Width = 76;
                }
                list = hRMSALARYDEDUCTION.GetList(this.m_SalaryTableListID, false);
                foreach (DataRow row1 in list.Rows)
                {
                    bandedGridColumn = new BandedGridColumn()
                    {
                        FieldName  = string.Concat("Deduction", row1["DeductionCode"].ToString()),
                        Caption    = string.Concat(row1["DeductionName"].ToString().Remove(1).ToUpper(), row1["DeductionName"].ToString().Remove(0, 1).ToLower()),
                        ColumnEdit = this.repCalculator,
                        Name       = string.Concat("colDeductionCode", row1["DeductionCode"].ToString())
                    };
                    bandedGridColumn.AppearanceHeader.Options.UseForeColor = true;
                    bandedGridColumn.AppearanceHeader.ForeColor            = Color.Blue;
                    bandedGridColumn.AppearanceCell.Options.UseBackColor   = true;
                    bandedGridColumn.AppearanceCell.BackColor  = Color.Azure;
                    bandedGridColumn.OptionsColumn.ReadOnly    = true;
                    bandedGridColumn.SummaryItem.DisplayFormat = "{0:##,##0}";
                    bandedGridColumn.SummaryItem.SummaryType   = SummaryItemType.Sum;
                    bandedGridColumn.Visible = true;
                    bandedGridColumn.Width   = 76;
                    this.bandPlusMinusAfter.Columns.Add(bandedGridColumn);
                    gridGroupSummaryItem = new GridGroupSummaryItem(SummaryItemType.Sum, bandedGridColumn.FieldName, bandedGridColumn, "{0:##,##0}");
                    this.gbList.GroupSummary.Add(gridGroupSummaryItem);
                    bandedGridColumn.Width = 76;
                }
                dataTable = hRMSALARYINCOME.GetList(this.m_SalaryTableListID, false);
                if (dataTable.Rows.Count + list.Rows.Count <= 0)
                {
                    this.bandPlusMinusAfter.Visible = false;
                }
                foreach (DataRow dataRow1 in dataTable.Rows)
                {
                    blue = new BandedGridColumn()
                    {
                        FieldName  = string.Concat("Income", dataRow1["IncomeCode"].ToString()),
                        Caption    = string.Concat(dataRow1["IncomeName"].ToString().Remove(1).ToUpper(), dataRow1["IncomeName"].ToString().Remove(0, 1).ToLower()),
                        ColumnEdit = this.repCalculator,
                        Name       = string.Concat("colIncomeCode", dataRow1["IncomeCode"].ToString())
                    };
                    blue.AppearanceHeader.Options.UseForeColor = true;
                    blue.AppearanceHeader.ForeColor            = Color.Blue;
                    blue.AppearanceCell.Options.UseBackColor   = true;
                    blue.AppearanceCell.BackColor  = Color.Azure;
                    blue.OptionsColumn.ReadOnly    = true;
                    blue.SummaryItem.DisplayFormat = "{0:##,##0}";
                    blue.SummaryItem.SummaryType   = SummaryItemType.Sum;
                    blue.Visible = true;
                    blue.Width   = 76;
                    this.bandPlusMinusAfter.Columns.Add(blue);
                    gridSummaryItem = new GridGroupSummaryItem(SummaryItemType.Sum, blue.FieldName, blue, "{0:##,##0}");
                    this.gbList.GroupSummary.Add(gridSummaryItem);
                    blue.Width = 76;
                }
                this.colEmployeeCode.Width        = 65;
                this.colFirstName.Width           = 121;
                this.colLastName.Width            = 56;
                this.colCoefficientSalary.Width   = 54;
                this.colBasicSalary.Width         = 76;
                this.colInsuranceSalary.Width     = 76;
                this.colAllowanceInsurance.Width  = 76;
                this.colAllowance.Width           = 64;
                this.colTotalSalary.Width         = 76;
                this.colTaxYourSelfMoney.Width    = 75;
                this.colNumberDepend.Width        = 66;
                this.colDependMoney.Width         = 77;
                this.colTaxOvertime150Money.Width = 75;
                this.colTaxOvertime200Money.Width = 75;
                this.colTaxOvertime300Money.Width = 75;
                this.colTaxOvertime195Money.Width = 75;
                this.colTaxOvertime260Money.Width = 75;
                this.colTaxOvertime390Money.Width = 75;
            }
        }