private void Load_CurrentForm_Records()
        {
            int intCurrentRow = 0;

            this.grbCompanyLock.Visible = false;

            pvtCompanyDataView = null;
            pvtCompanyDataView = new DataView(pvtDataSet.Tables["Company"]
                                              , ""
                                              , "COMPANY_DESC"
                                              , DataViewRowState.CurrentRows);

            clsISUtilities.DataViewIndex = 0;

            if (clsISUtilities.DataBind_Form_And_DataView_To_Class() == false)
            {
                clsISUtilities.DataBind_DataView_And_Index(this, pvtCompanyDataView, "COMPANY_NO");

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtCompany, "COMPANY_DESC", true, "Enter Company Description.", true);

                //Needs To Be Looked At For EFiling
                clsISUtilities.DataBind_DataView_To_TextBox(this.txtUnitNumber, "RES_UNIT_NUMBER", false, "", true);
                clsISUtilities.DataBind_DataView_To_TextBox(this.txtComplex, "RES_COMPLEX", false, "", true);
                clsISUtilities.DataBind_DataView_To_TextBox(this.txtStreetNumber, "RES_STREET_NUMBER", false, "", true);

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtStreetName, "RES_STREET_NAME", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtStreetName, 1);

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtSuburb, "RES_SUBURB", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtSuburb, 1);
                clsISUtilities.DataBind_DataView_To_TextBox(this.txtCity, "RES_CITY", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtCity, 1);

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtPhysicalCode, "RES_ADDR_CODE", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtPhysicalCode, 1);

                clsISUtilities.DataBind_DataView_To_TextBox(txtPostAddr1, "POST_ADDR_LINE1", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtPostAddr1, 2);
                clsISUtilities.DataBind_DataView_To_TextBox(txtPostAddr2, "POST_ADDR_LINE2", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtPostAddr2, 2);
                clsISUtilities.DataBind_DataView_To_TextBox(txtPostAddr3, "POST_ADDR_LINE3", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtPostAddr3, 2);
                clsISUtilities.DataBind_DataView_To_TextBox(this.txtPostAddr4, "POST_ADDR_LINE4", false, "", true);

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtPostAddrCode, "POST_ADDR_CODE", false, "", true);
                clsISUtilities.DataBind_Special_Field(this.txtPostAddrCode, 2);

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox_Min_Length(this.txtTelWork, "TEL_WORK", 0, 10, false, "Enter Work Number.", true, 0, true);
                clsISUtilities.DataBind_DataView_Field_EFiling(this.txtTelWork);

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox_Min_Length(this.txtTelFax, "TEL_FAX", 0, 10, false, "Enter Fax Number.", true, 0, true);

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtRate1, "OVERTIME1_RATE", 2, true, "Enter Wage Overtime Rate 1.", true, 9.99, false);
                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtRate2, "OVERTIME2_RATE", 2, true, "Enter Wage Overtime Rate 2.", true, 9.99, false);
                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtRate3, "OVERTIME3_RATE", 2, true, "Enter Wage Overtime Rate 3.", true, 9.99, false);

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtSalaryRate1, "SALARY_OVERTIME1_RATE", 2, true, "Enter Salary Overtime Rate 1.", true, 9.99, false);
                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtSalaryRate2, "SALARY_OVERTIME2_RATE", 2, true, "Enter Salary Overtime Rate 2.", true, 9.99, false);
                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtSalaryRate3, "SALARY_OVERTIME3_RATE", 2, true, "Enter Salary Overtime Rate 3.", true, 9.99, false);

                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnEmplNumYes, "GENERATE_EMPLOYEE_NUMBER_IND", "Y");
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnEmplNumNo, "GENERATE_EMPLOYEE_NUMBER_IND", "N");
                clsISUtilities.DataBind_RadioButton_Default(this.rbnEmplNumNo);

                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnYYYY, "DATE_FORMAT", "yyyy-MM-dd");
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnDD, "DATE_FORMAT", "dd-MM-yyyy");
                clsISUtilities.DataBind_RadioButton_Default(this.rbnDD);
            }

            this.Clear_DataGridView(this.dgvCompanyDataGridView);

            this.pvtblnCompanyDataGridViewLoaded = false;

            int intReturnCode = 0;

            for (int intRow = 0; intRow < this.pvtCompanyDataView.Count; intRow++)
            {
                this.dgvCompanyDataGridView.Rows.Add("",
                                                     pvtCompanyDataView[intRow]["COMPANY_DESC"].ToString(),
                                                     intRow.ToString());

                if (Convert.ToInt32(pvtCompanyDataView[intRow]["COUNT_PAY_CATEGORY_NO_CURRENT"]) > 0)
                {
                    this.dgvCompanyDataGridView[0, this.dgvCompanyDataGridView.Rows.Count - 1].Style = this.PayrollLinkDataGridViewCellStyle;
                }


                if (Convert.ToInt32(pvtCompanyDataView[intRow]["COMPANY_NO"]) == pvtint64CompanyNo)
                {
                    intCurrentRow = intRow;
                }
            }

            this.pvtblnCompanyDataGridViewLoaded = true;

            if (this.dgvCompanyDataGridView.Rows.Count > 0)
            {
                this.Set_DataGridView_SelectedRowIndex(this.dgvCompanyDataGridView, intCurrentRow);
            }
        }
        private void Load_CurrentForm_Records()
        {
            pvtLeaveDataView = null;
            pvtLeaveDataView = new DataView(pvtDataSet.Tables["Leave"],
                                            "COMPANY_NO = " + AppDomain.CurrentDomain.GetData("CompanyNo").ToString() + " AND PAY_CATEGORY_TYPE = '" + pvstrPayrollType + "'",
                                            "LEAVE_SHIFT_DESC",
                                            DataViewRowState.CurrentRows);

            clsISUtilities.DataViewIndex = 0;

            if (clsISUtilities.DataBind_Form_And_DataView_To_Class() == false)
            {
                clsISUtilities.DataBind_DataView_And_Index(this, pvtLeaveDataView, "LEAVE_SHIFT_NO");

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtLeave, "LEAVE_SHIFT_DESC", true, "Enter Normal Leave / Sick Leave Category Description.", true);

                clsISUtilities.DataBind_DataView_To_ComboBox(this.cboNormalPaid, "NORM_PAID_DAYS", true, "Select Normal Leave - Number of Days Paid.", true);
                clsISUtilities.DataBind_DataView_To_ComboBox(this.cboSickPaid, "SICK_PAID_DAYS", true, "Select Sick Leave - Number of Days Paid.", true);

                clsISUtilities.DataBind_DataView_To_ComboBox(this.cboMaxShifts, "MAX_SHIFTS_YEAR", true, "Select Number of shifts in Year.", true);

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtNormLeaveAccum, "NORM_PAID_PER_PERIOD", 4, false, "", false, 0, false);
                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtSickLeaveAccum, "SICK_PAID_PER_PERIOD", 4, false, "", false, 0, false);

                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnWeekDays, "LEAVE_PAID_ACCUMULATOR_IND", "1");
                clsISUtilities.DataBind_RadioButton_Default(this.rbnWeekDays);
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnWeekDaySaturday, "LEAVE_PAID_ACCUMULATOR_IND", "2");
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnAllDays, "LEAVE_PAID_ACCUMULATOR_IND", "3");
            }
            else
            {
                //Rebind dataView
                clsISUtilities.Re_DataBind_DataView(pvtLeaveDataView);
            }

            Set_Form_For_Read();

            this.Clear_DataGridView(this.dgvNormalSickLeaveCategoryDataGridView);

            if (pvstrPayrollType == "W")
            {
                this.lblLeaveTypeLockDesc.Text = "Some Records are Locked due to Current Wage Run";
            }
            else
            {
                this.lblLeaveTypeLockDesc.Text = "Some Records are Locked due to Current Salary Run";
            }

            this.grbLeaveLock.Visible = false;

            if (pvtLeaveDataView.Count == 0)
            {
                Clear_Form_Fields();
            }
            else
            {
                this.pvtblnNormalSickLeeaveCategoryDataGridViewLoaded = false;

                for (int intRowCount = 0; intRowCount < pvtLeaveDataView.Count; intRowCount++)
                {
                    this.dgvNormalSickLeaveCategoryDataGridView.Rows.Add("",
                                                                         pvtLeaveDataView[intRowCount]["LEAVE_SHIFT_DESC"].ToString(),
                                                                         intRowCount.ToString());

                    if (pvtLeaveDataView[intRowCount]["PAYROLL_LINK"] != System.DBNull.Value)
                    {
                        this.dgvNormalSickLeaveCategoryDataGridView[0, this.dgvNormalSickLeaveCategoryDataGridView.Rows.Count - 1].Style = this.PayrollLinkDataGridViewCellStyle;

                        this.grbLeaveLock.Visible = true;
                    }
                }

                this.pvtblnNormalSickLeeaveCategoryDataGridViewLoaded = true;

                Load_Current_Normal_Leave_Sick_Leave_Category();
            }
        }
Exemplo n.º 3
0
        private void Load_CurrentForm_Records()
        {
            this.grbDeductionLock.Visible = false;

            this.Clear_DataGridView(this.dgvDeductionDataGridView);

            pvtDeductionDataView = null;

            pvtDeductionDataView = new DataView(pvtDataSet.Tables["Deduction"],
                                                "COMPANY_NO = " + AppDomain.CurrentDomain.GetData("CompanyNo").ToString() + " AND PAY_CATEGORY_TYPE = '" + pvtstrPayrollType + "'",
                                                "DEDUCTION_DESC",
                                                DataViewRowState.CurrentRows);

            clsISUtilities.DataViewIndex = 0;

            if (clsISUtilities.DataBind_Form_And_DataView_To_Class() == false)
            {
                clsISUtilities.DataBind_DataView_And_Index(this, pvtDeductionDataView, "DEDUCTION_NO");

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtDeduction, "DEDUCTION_DESC", true, "Enter Deduction Description.", true);

                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnUserToEnter, "DEDUCTION_TYPE_IND", "U");
                clsISUtilities.DataBind_RadioButton_Default(this.rbnUserToEnter);
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnFixedAmount, "DEDUCTION_TYPE_IND", "F");
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnPercentageOfEarnings, "DEDUCTION_TYPE_IND", "P");

                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnEachPayPeriod, "DEDUCTION_PERIOD_IND", "E");
                clsISUtilities.DataBind_RadioButton_Default(this.rbnEachPayPeriod);
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnMonthly, "DEDUCTION_PERIOD_IND", "M");

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtValue, "DEDUCTION_VALUE", 2, false, "", false, 0, false);
                clsISUtilities.DataBind_Control_Required_If_Enabled(this.txtValue, "Enter Value.");

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtMinValue, "DEDUCTION_MIN_VALUE", 2, false, "", false, 0, false);
                //clsISUtilities.DataBind_Control_Required_If_Enabled(this.txtMinValue, "Enter Minimum Value.");

                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtMaxValue, "DEDUCTION_MAX_VALUE", 2, false, "", false, 0, false);
                //clsISUtilities.DataBind_Control_Required_If_Enabled(this.txtMaxValue, "Enter Maximum Value.");

                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnNoLoanType, "DEDUCTION_LOAN_TYPE_IND", "N");
                clsISUtilities.DataBind_RadioButton_Default(this.rbnNoLoanType);
                clsISUtilities.DataBind_DataView_To_RadioButton(this.rbnYesLoanType, "DEDUCTION_LOAN_TYPE_IND", "Y");

                clsISUtilities.DataBind_DataView_To_ComboBox(this.cboNumberSubAccount, "DEDUCTION_SUB_ACCOUNT_COUNT", false, "", false);
                clsISUtilities.DataBind_Control_Required_If_Enabled(this.cboNumberSubAccount, "Select Number of Sub-Account.");

                //clsISUtilities.DataBind_DataView_To_TextBox(this.txtIRP5Code, "IRP5_CODE", false, "", false);
                clsISUtilities.DataBind_DataView_To_Numeric_TextBox(this.txtIRP5Code, "IRP5_CODE", 0, false, "", false, 0, true);

                clsISUtilities.DataBind_DataView_To_TextBox(this.txtHeader1, "DEDUCTION_REPORT_HEADER1", true, "Enter Spreadsheet Report Header Line 1.", true);
                clsISUtilities.DataBind_DataView_To_TextBox(this.txtHeader2, "DEDUCTION_REPORT_HEADER2", false, "", true);
            }
            else
            {
                clsISUtilities.Re_DataBind_DataView(pvtDeductionDataView);
            }

            if (pvtstrPayrollType == "W")
            {
                this.rbnMonthly.Visible = true;
                this.cboDay.Visible     = true;
            }
            else
            {
                this.rbnMonthly.Visible = false;
                this.cboDay.Visible     = false;
            }

            if (pvtDeductionDataView.Count == 0)
            {
                Clear_Form_Fields();

                this.btnUpdate.Enabled = false;
                this.btnDelete.Enabled = false;

                Set_Form_For_Read();
            }
            else
            {
                int intComboSelectedIndex = 0;

                Set_Form_For_Read();

                if (this.pvtDataSet.Tables["Company"].Rows[0]["ACCESS_IND"].ToString() == "R")
                {
                    this.btnUpdate.Enabled = false;
                }
                else
                {
                    this.btnUpdate.Enabled = true;
                }

                pvtblnDeductionDataGridViewLoaded = false;

                for (int intRowCount = 0; intRowCount < pvtDeductionDataView.Count; intRowCount++)
                {
                    this.dgvDeductionDataGridView.Rows.Add("",
                                                           pvtDeductionDataView[intRowCount]["IRP5_CODE"].ToString(),
                                                           pvtDeductionDataView[intRowCount]["DEDUCTION_DESC"].ToString(),
                                                           intRowCount.ToString());

                    if (Convert.ToInt32(pvtDeductionDataView[intRowCount]["DEDUCTION_NO"]) == pvtintDeductionNo)
                    {
                        intComboSelectedIndex = intRowCount;
                    }

                    if (pvtDeductionDataView[intRowCount]["PAYROLL_LINK"] != System.DBNull.Value)
                    {
                        this.dgvDeductionDataGridView[0, this.dgvDeductionDataGridView.Rows.Count - 1].Style = LockedPayrollRunDataGridViewCellStyle;
                        this.grbDeductionLock.Visible = true;

                        this.btnNew.Enabled    = false;
                        this.btnUpdate.Enabled = false;
                        this.btnDelete.Enabled = false;
                    }
                }

                pvtblnDeductionDataGridViewLoaded = true;

                this.Set_DataGridView_SelectedRowIndex(this.dgvDeductionDataGridView, intComboSelectedIndex);
            }
        }