示例#1
0
        protected void LoadLists()
        {
            DataTable dt = new DataTable();

            dt = Nss_archive.select_list("select_payroll_summary", cboPaymentYearSearch.Text != string.Empty?cboPaymentYearSearch.Text:string.Empty,
                                         cboPaymentMonthSearch.Text != string.Empty?cboPaymentMonthSearch.Text:string.Empty,
                                         txt_guard_name_search.Text != string.Empty ? txt_guard_name_search.Text : string.Empty);
            gdv_guards.DataSource = dt;
            gdv_guards.Columns["record_id"].Visible        = false;
            gdv_guards.Columns["payment_year"].HeaderText  = "Payment Year";
            gdv_guards.Columns["payment_month"].HeaderText = "Payment Year";
            gdv_guards.Columns["branch_name"].HeaderText   = "Payment Year";
            gdv_guards.Columns["guard_number"].HeaderText  = "Payment Year";
            gdv_guards.Columns["guard_name"].HeaderText    = "Payment Year";
            gdv_guards.Columns["nss_number"].HeaderText    = "Payment Year";

            this.gdv_guards.RowsDefaultCellStyle.BackColor            = Color.LightGray;
            this.gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
            this.gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor   = Color.White;
            this.gdv_guards.ColumnHeadersDefaultCellStyle.BackColor   = Color.Black;
            this.gdv_guards.RowHeadersDefaultCellStyle.BackColor      = Color.Black;
            this.gdv_guards.DefaultCellStyle.SelectionBackColor       = Color.Cyan;
            this.gdv_guards.DefaultCellStyle.SelectionForeColor       = Color.Black;
            this.gdv_guards.BorderStyle = BorderStyle.FixedSingle;
            foreach (DataGridViewColumn c in this.gdv_guards.Columns)
            {
                c.DefaultCellStyle.Font = new System.Drawing.Font("Arial", 11f, GraphicsUnit.Pixel);
            }
            this.gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.CadetBlue;
            this.gdv_guards.EnableHeadersVisualStyles = false;
        }
示例#2
0
        protected void save_payroll()
        {
            #region variables

            Nss_archive.payment_year      = cboPaymentYear.Text;
            Nss_archive.payment_month     = cboPaymentMonth.Text;
            Nss_archive.branch_name       = cbo_branch.Text;
            Nss_archive.guard_number      = txt_guard_num.Text;
            Nss_archive.guard_name        = txt_guard_name.Text;
            Nss_archive.nss_number        = txt_nssf.Text;
            Nss_archive.days_worked       = txt_days_worked.Text != string.Empty ? Convert.ToInt32(txt_days_worked.Text) : 0;
            Nss_archive.basic_amt         = decimal.Parse(txt_basic_amt.Text);
            Nss_archive.overtime_amt      = txt_over_time_amt.Text != string.Empty ? decimal.Parse(txt_over_time_amt.Text) : 0;
            Nss_archive.transport_amt     = txt_transport_amt.Text != string.Empty ? decimal.Parse(txt_transport_amt.Text) : 0;
            Nss_archive.housing_amt       = txt_housing_amt.Text != string.Empty ? decimal.Parse(txt_housing_amt.Text) : 0;
            Nss_archive.resident_amt      = txt_resident_amt.Text != string.Empty ? decimal.Parse(txt_resident_amt.Text) : 0;
            Nss_archive.special_amt       = txt_special_amt.Text != string.Empty ? decimal.Parse(txt_special_amt.Text) : 0;
            Nss_archive.bonus_amt         = txt_bonus_amt.Text != string.Empty ? decimal.Parse(txt_bonus_amt.Text) : 0;
            Nss_archive.arrears_amt       = txt_arrears_amt.Text != string.Empty ? decimal.Parse(txt_arrears_amt.Text) : 0;
            Nss_archive.leave_amt         = txt_leave_amt.Text != string.Empty ? decimal.Parse(txt_leave_amt.Text) : 0;
            Nss_archive.gross_pay_amt     = txt_gross_amt.Text != string.Empty ? decimal.Parse(txt_gross_amt.Text) : 0;
            Nss_archive.advance_amt       = txt_advance_amt.Text != string.Empty ? decimal.Parse(txt_advance_amt.Text) : 0;
            Nss_archive.loan_amt          = 0;
            Nss_archive.absentism_amt     = txt_absentism_amt.Text != string.Empty ? decimal.Parse(txt_absentism_amt.Text) : 0;
            Nss_archive.uniform_amt       = txt_uniform_amt.Text != string.Empty ? decimal.Parse(txt_uniform_amt.Text) : 0;
            Nss_archive.penalty_amt       = txt_penalty_amt.Text != string.Empty ? decimal.Parse(txt_penalty_amt.Text) : 0;
            Nss_archive.lst_amt           = txt_lst_amt.Text != string.Empty ? decimal.Parse(txt_lst_amt.Text) : 0;
            Nss_archive.paye_amt          = txt_paye_amt.Text != string.Empty ? decimal.Parse(txt_paye_amt.Text) : 0;
            Nss_archive.nssf_amt          = txt_nssf_amt.Text != string.Empty ? decimal.Parse(txt_nssf_amt.Text) : 0;
            Nss_archive.employer_nssf_amt = txt_nss_employer.Text != string.Empty ? decimal.Parse(txt_nss_employer.Text) : 0;
            Nss_archive.nssf_total_amt    = Nss_archive.nssf_amt + Nss_archive.employer_nssf_amt;

            Nss_archive.net_pay_amt = Nss_archive.gross_pay_amt - (Nss_archive.advance_amt + Nss_archive.loan_amt + Nss_archive.absentism_amt + Nss_archive.uniform_amt + Nss_archive.penalty_amt + Nss_archive.lst_amt +
                                                                   Nss_archive.paye_amt + Nss_archive.nssf_amt);
            Nss_archive.usr_id_create   = SystemConst._username;
            Nss_archive.usr_id_update   = SystemConst._username;
            Nss_archive.usr_date_create = DateTime.Today;
            Nss_archive.usr_date_update = DateTime.Today;
            #endregion

            #region save
            if (txt_record_guid.Text == string.Empty)
            {
                Nss_archive.record_id = Guid.NewGuid().ToString();
                Nss_archive.QueryName = "save_payroll_details";
                Nss_archive.save_guard_payroll_details();
                txt_record_guid.Text = Nss_archive.record_id;
                MessageBox.Show("Saved successfully", "save", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                Nss_archive.record_id = txt_record_guid.Text;
                Nss_archive.QueryName = "update_payroll_details";
                Nss_archive.save_guard_payroll_details();
                MessageBox.Show("Updated successfully", "update", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            #endregion
        }
示例#3
0
 protected void LoadDetails(string id)
 {
     if (gdv_guards.Rows.Count > 0)
     {
         dt = Nss_archive.select_payroll_details("select_payroll_details", id);
         if (dt.Rows.Count > 0)
         {
             DataRow dtRow = dt.Rows[0];
             cboPaymentYear.Text    = dtRow["payment_year"].ToString();
             cboPaymentMonth.Text   = dtRow["payment_month"].ToString();
             cbo_branch.Text        = dtRow["branch_name"].ToString();
             txt_guard_num.Text     = dtRow["guard_number"].ToString();
             txt_guard_name.Text    = dtRow["guard_name"].ToString();
             txt_nssf.Text          = dtRow["nss_number"].ToString();
             txt_days_worked.Text   = Convert.ToInt32(dtRow["days_worked"].ToString()).ToString();
             txt_basic_amt.Text     = decimal.Parse(dtRow["basic_amt"].ToString()).ToString();
             txt_over_time_amt.Text = decimal.Parse(dtRow["overtime_amt"].ToString()).ToString();
             txt_transport_amt.Text = decimal.Parse(dtRow["transport_amt"].ToString()).ToString();
             txt_housing_amt.Text   = decimal.Parse(dtRow["housing_amt"].ToString()).ToString();
             txt_resident_amt.Text  = decimal.Parse(dtRow["resident_amt"].ToString()).ToString();
             txt_special_amt.Text   = decimal.Parse(dtRow["special_amt"].ToString()).ToString();
             txt_bonus_amt.Text     = decimal.Parse(dtRow["bonus_amt"].ToString()).ToString();
             txt_arrears_amt.Text   = decimal.Parse(dtRow["arrears_amt"].ToString()).ToString();
             txt_leave_amt.Text     = decimal.Parse(dtRow["leave_amt"].ToString()).ToString();
             txt_gross_amt.Text     = decimal.Parse(dtRow["gross_pay_amt"].ToString()).ToString();
             txt_advance_amt.Text   = decimal.Parse(dtRow["advance_amt"].ToString()).ToString();
             txt_absentism_amt.Text = decimal.Parse(dtRow["absentism_amt"].ToString()).ToString();
             txt_uniform_amt.Text   = decimal.Parse(dtRow["uniform_amt"].ToString()).ToString();
             txt_penalty_amt.Text   = decimal.Parse(dtRow["penalty_amt"].ToString()).ToString();
             txt_lst_amt.Text       = decimal.Parse(dtRow["lst_amt"].ToString()).ToString();
             txt_paye_amt.Text      = decimal.Parse(dtRow["paye_amt"].ToString()).ToString();
             txt_nssf_amt.Text      = decimal.Parse(dtRow["nssf_amt"].ToString()).ToString();
             txt_nss_employer.Text  = decimal.Parse(dtRow["employer_nssf_amt"].ToString()).ToString();
             txt_record_guid.Text   = id;
         }
     }
 }
示例#4
0
        private void frm_finance_detailed_guard_pay_roll_report_Load(object sender, EventArgs e)
        {
            if (SystemConst._finance_crystal_report_type == "DEPLOY" || SystemConst._finance_crystal_report_type == "CLIENT" || SystemConst._finance_crystal_report_type == "GUARD")
            {
                this.Text = SystemConst.ClientName + "-Deployment Reporting";
            }
            else
            {
                this.Text = SystemConst.ClientName + "-Finance Reporting";
            }
            if (SystemConst._finance_crystal_report_type == "Detailed")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    finance_detailed_guard_pay_roll_report report = new finance_detailed_guard_pay_roll_report();
                    ParameterFields        paramFields            = new ParameterFields();
                    ParameterField         parameterField         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_guard_payroll_summary_details_by_station("select_guard_payroll_summary_details_by_station", Convert.ToInt32(SystemConst._active_deployment_id), SystemConst._station_code, SystemConst._station_name, SystemConst._guard_rank));
                    report.SetParameterValue("QueryName", "select_guard_payroll_summary_details_by_station");
                    report.SetParameterValue("guard_number", string.Empty);
                    report.SetParameterValue("station_code", SystemConst._station_code);
                    report.SetParameterValue("station_name", SystemConst._station_name);

                    report.SetParameterValue("guard_rank", SystemConst._guard_rank);
                    report.SetParameterValue("rank_name", SystemConst._rank_name);
                    report.SetParameterValue("deploy_period_id", Convert.ToInt32(SystemConst._active_deployment_id));
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "bank_payment")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    finance_bank_salary_payment_report report      = new finance_bank_salary_payment_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField1         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue1 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_bank_payment_report("select_bank_payment_report", SystemConst._station_name, Convert.ToInt32(SystemConst._payment_deployment_id)));
                    report.SetParameterValue("QueryName", "select_bank_payment_report");
                    report.SetParameterValue("station_name", SystemConst._station_name);
                    report.SetParameterValue("deploy_period_id", Convert.ToInt32(SystemConst._payment_deployment_id));
                    report.SetParameterValue("bank_branch", "STANBIC BANK-" + SystemConst._bank_branch);
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception1)
                {
                    MessageBox.Show(exception1.ToString());
                }
            }

            else if (SystemConst._finance_crystal_report_type == "Payroll_Archive")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    finance_detailed_guard_pay_roll_report_archive report = new finance_detailed_guard_pay_roll_report_archive();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField1         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue1 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Nss_archive.select_payroll_report());
                    report.SetParameterValue("QueryName", "select_payroll_report");
                    report.SetParameterValue("branch_name", Nss_archive.Rbranch_name);
                    report.SetParameterValue("payment_year", Nss_archive.Rpayment_year);
                    report.SetParameterValue("payment_month", Nss_archive.Rpayment_month);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    //Set_current_deployment_periods();
                }
                catch (Exception exception1)
                {
                    MessageBox.Show(exception1.ToString());
                }
            }

            else if (SystemConst._finance_crystal_report_type == "NSSF_Archive")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    finance_employee_nssf_report_archive report    = new finance_employee_nssf_report_archive();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField1         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue1 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Nss_archive.select_nssf_report());
                    report.SetParameterValue("QueryName", "select_nssf_report");
                    report.SetParameterValue("branch_name", Nss_archive.Rbranch_name);
                    report.SetParameterValue("payment_year", Nss_archive.Rpayment_year);
                    report.SetParameterValue("payment_month", Nss_archive.Rpayment_month);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    //Set_current_deployment_periods();
                }
                catch (Exception exception1)
                {
                    MessageBox.Show(exception1.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "LST")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    finance_local_service_tax_report report        = new finance_local_service_tax_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField2         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue2 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_local_service_tax_nssf_andpaye_report("select_local_service_tax_report", SystemConst._station_name, SystemConst._station_code, Convert.ToInt32(SystemConst._active_deployment_id)));
                    report.SetParameterValue("QueryName", "select_local_service_tax_report");
                    report.SetParameterValue("station_name", SystemConst._station_name);
                    report.SetParameterValue("deploy_period_id", Convert.ToInt32(SystemConst._active_deployment_id));
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception2)
                {
                    MessageBox.Show(exception2.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "NSSF")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    finance_employee_nssf_report report            = new finance_employee_nssf_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField3         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue3 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_local_service_tax_nssf_andpaye_report("select_nssf_report", SystemConst._station_name, SystemConst._station_code, Convert.ToInt32(SystemConst._active_deployment_id)));
                    report.SetParameterValue("QueryName", "select_nssf_report");
                    report.SetParameterValue("station_name", SystemConst._station_name);
                    report.SetParameterValue("branch_name", SystemConst._station_name);
                    report.SetParameterValue("deploy_period_id", Convert.ToInt32(SystemConst._active_deployment_id));
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception3)
                {
                    MessageBox.Show(exception3.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "PAYE")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    finance_employee_paye_report report            = new finance_employee_paye_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField4         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue4 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_local_service_tax_nssf_andpaye_report("select_paye_tax_report", SystemConst._station_name, SystemConst._station_code, Convert.ToInt32(SystemConst._active_deployment_id)));
                    report.SetParameterValue("QueryName", "select_paye_tax_report");
                    report.SetParameterValue("station_name", SystemConst._station_name);
                    report.SetParameterValue("deploy_period_id", Convert.ToInt32(SystemConst._active_deployment_id));
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception4)
                {
                    MessageBox.Show(exception4.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "DEPLOY")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_deployment_summary_report report            = new cr_deployment_summary_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField5         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue5 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_local_service_tax_nssf_andpaye_report("select_deployment_summary_report", SystemConst._station_name, SystemConst._station_code, Convert.ToInt32(SystemConst._active_deployment_id)));
                    report.SetParameterValue("QueryName", "select_paye_tax_report");
                    report.SetParameterValue("station_name", SystemConst._station_name);
                    report.SetParameterValue("deploy_period_id", Convert.ToInt32(SystemConst._active_deployment_id));
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception5)
                {
                    MessageBox.Show(exception5.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "CLIENT")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_deployment_client_guard_mapping_report report = new cr_deployment_client_guard_mapping_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField6         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue6 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_client_guard_mapping_report("select_client_guard_mapping_report", SystemConst._client_code, SystemConst._deployment_start_date, SystemConst._deployment_end_date));
                    report.SetParameterValue("QueryName", "select_client_guard_mapping_report");
                    report.SetParameterValue("client_code", SystemConst._client_code);
                    report.SetParameterValue("deploy_date_from", SystemConst._deployment_start_date);
                    report.SetParameterValue("deploy_date_to", SystemConst._deployment_end_date);
                    report.SetParameterValue("date_from", SystemConst._deployment_start_date);
                    report.SetParameterValue("date_to", SystemConst._deployment_end_date);
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception6)
                {
                    MessageBox.Show(exception6.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "GUARD")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_deployment_guard_client_mapping_report report = new cr_deployment_guard_client_mapping_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField7         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue7 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_guard_client_mapping_report("select_guard_client_mapping_report", SystemConst.guard_number, SystemConst._deployment_start_date, SystemConst._deployment_end_date));
                    report.SetParameterValue("QueryName", "select_guard_client_mapping_report");
                    report.SetParameterValue("guard_number", SystemConst.guard_number);
                    report.SetParameterValue("deploy_date_from", SystemConst._deployment_start_date);
                    report.SetParameterValue("deploy_date_to", SystemConst._deployment_end_date);
                    report.SetParameterValue("date_from", SystemConst._deployment_start_date);
                    report.SetParameterValue("date_to", SystemConst._deployment_end_date);
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception7)
                {
                    MessageBox.Show(exception7.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "DEPLOYMENT_SCHEDULE")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_guard_deployment_schedule_report report     = new cr_guard_deployment_schedule_report();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField7         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue7 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }
                    report.SetDataSource(Finance_Reports.select_guard_deployment_schedule_report("select_deployment_schedule_report_by_branch", SystemConst._station_name, Convert.ToInt32(SystemConst._active_deployment_id)));
                    report.SetParameterValue("QueryName", "select_deployment_schedule_report_by_branch");
                    report.SetParameterValue("branch_name", SystemConst._station_name);
                    report.SetParameterValue("deploy_id", Convert.ToInt32(SystemConst._active_deployment_id));
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception7)
                {
                    MessageBox.Show(exception7.ToString());
                }
            }
            else if (SystemConst._finance_crystal_report_type == "customer_bill")
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_client_billing      report                  = new cr_client_billing();
                    ParameterFields        paramFields             = new ParameterFields();
                    ParameterField         parameterField7         = new ParameterField();
                    ParameterDiscreteValue parameterDiscreteValue7 = new ParameterDiscreteValue();
                    foreach (Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }

                    report.SetDataSource(Finance_Reports.select_client_billing_report("select_client_billing_report", SystemConst._station_name, Convert.ToInt32(SystemConst._active_deployment_id)));
                    report.SetParameterValue("QueryName", "select_client_billing_report");
                    report.SetParameterValue("station_name", SystemConst._station_name);
                    report.SetParameterValue("deploy_period_id", Convert.ToInt32(SystemConst._active_deployment_id));
                    report.SetParameterValue("client_name", SystemConst.ClientName);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;

                    Set_current_deployment_periods();
                }
                catch (Exception exception7)
                {
                    MessageBox.Show(exception7.ToString());
                }
            }
        }