Пример #1
0
        protected void Load_Report()
        {
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

            guard_employment_record_report report = new guard_employment_record_report();

            ParameterFields        paramFields        = new ParameterFields();
            ParameterField         paramField         = new ParameterField();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

            //set report connection details
            //ConnectionInfo myconnectioninfo = new ConnectionInfo();
            //myconnectioninfo.ServerName = "Thadeous";
            //myconnectioninfo.DatabaseName = "guard_profiles_db";
            //myconnectioninfo.UserID = "sg_admin";
            //myconnectioninfo.Password = "******";
            //SET_CONNECTION_INFO(myconnectioninfo);

            foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
            {
                Set_Report_logons.SetTableLogin(tbCurrent);
            }

            //report.SetDataSource(sg_Reports.RETURN_OFFICER_DETAILS("", SystemConst.guard_number));
            report.SetParameterValue("QueryName", "SELECT_GUARD_EMPLOYMENT_RECORD_REPORT");
            report.SetParameterValue("guard_number", SystemConst.guard_number);
            employment_report_reportviewer.ParameterFieldInfo = paramFields;


            this.employment_report_reportviewer.ReportSource = report;
            //this.crystalReportViewer1.RefreshReport();
        }
Пример #2
0
        private void frm_active_guards_report_Load(object sender, EventArgs e)
        {
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

            cr_active_guards_by_station report = new cr_active_guards_by_station();

            ParameterFields        paramFields        = new ParameterFields();
            ParameterField         paramField         = new ParameterField();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();


            foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
            {
                Set_Report_logons.SetTableLogin(tbCurrent);
            }

            report.SetDataSource(sg_Reports.SELECT_ACTIVE_GUARDS_BY_STATION("", SystemConst._branch));
            report.SetParameterValue("QueryName", "SELECT_ACTIVE_GUARDS_BY_STATION");
            report.SetParameterValue("branch", SystemConst._branch);
            report.SetParameterValue("update_month", SystemConst._Report_update_month);
            cr_active_guards.ParameterFieldInfo = paramFields;


            this.cr_active_guards.ReportSource = report;
            //this.crystalReportViewer1.RefreshReport();
        }
Пример #3
0
        private void frm_archieved_guard_list_report_Load(object sender, EventArgs e)
        {
            string _guard_status = SystemConst._guard_status;

            if (_guard_status != String.Empty)
            {
                try {
                    this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                    cr_archived_guard_lists report = new cr_archived_guard_lists();

                    ParameterFields        paramFields        = new ParameterFields();
                    ParameterField         paramField         = new ParameterField();
                    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

                    foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
                    {
                        Set_Report_logons.SetTableLogin(tbCurrent);
                    }

                    report.SetDataSource(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS", _guard_status));
                    report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS");
                    report.SetParameterValue("guard_status", SystemConst._guard_status);
                    cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields;


                    this.cr_viewer_archieved_guards_report.ReportSource = report;
                    //this.crystalReportViewer1.RefreshReport();
                }
                catch (Exception ex) {
                    throw ex;
                }
            }
            else
            {
                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                cr_archived_guard_lists report = new cr_archived_guard_lists();

                ParameterFields        paramFields        = new ParameterFields();
                ParameterField         paramField         = new ParameterField();
                ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

                report.SetDatabaseLogon("sg_admin", "sg_admin123"); //hide the password from the code..get it from configuration file...

                report.SetDataSource(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_ALL("SELECT_ARCHIEVED_GUARD_LIST_ALL"));
                report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_ALL");
                // report.SetParameterValue("guard_status", SystemConst._guard_status);
                cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields;


                this.cr_viewer_archieved_guards_report.ReportSource = report;
                //this.crystalReportViewer1.RefreshReport();
            }
        }
Пример #4
0
        private void frmcrystal_report_single_Load(object sender, EventArgs e)
        {
            if (SystemConst._Single_report_type == "Active")
            {
                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                guard_single_report report = new guard_single_report();

                ParameterFields        paramFields        = new ParameterFields();
                ParameterField         paramField         = new ParameterField();
                ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

                foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
                {
                    Set_Report_logons.SetTableLogin(tbCurrent);
                }

                report.SetDataSource(sg_Reports.RETURN_OFFICER_DETAILS("", SystemConst.guard_number));
                report.SetParameterValue("QueryName", "SELECT_GUARD_REPORT_SINGLE");
                report.SetParameterValue("guard_number", SystemConst.guard_number);
                report.SetParameterValue("guard_status", String.Empty);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                crystalReportViewer1.ParameterFieldInfo = paramFields;


                this.crystalReportViewer1.ReportSource = report;
                //this.crystalReportViewer1.RefreshReport();
            }
            else if (SystemConst._Single_report_type == "Archieve")
            {
                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                guard_single_report report = new guard_single_report();

                ParameterFields        paramFields        = new ParameterFields();
                ParameterField         paramField         = new ParameterField();
                ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

                foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
                {
                    Set_Report_logons.SetTableLogin(tbCurrent);
                }

                report.SetDataSource(sg_Reports.RETURN_OFFICER_DETAILS("", SystemConst.guard_number));
                report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_REPORT_SINGLE");
                report.SetParameterValue("guard_number", SystemConst.guard_number);
                report.SetParameterValue("guard_status", String.Empty);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                crystalReportViewer1.ParameterFieldInfo = paramFields;


                this.crystalReportViewer1.ReportSource = report;
                //this.crystalReportViewer1.RefreshReport();
            }
        }
        private void frm_archieved_guard_list_report_Load(object sender, EventArgs e)
        {
            string _guard_status = SystemConst._guard_status;

            if (_guard_status == string.Empty)
            {
                base.WindowState = FormWindowState.Maximized;
                cr_archived_guard_lists report                  = new cr_archived_guard_lists();
                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(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("SELECT_ARCHIEVED_GUARD_LIST_ALL", _guard_status));
                report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_ALL");
                report.SetParameterValue("guard_status", SystemConst._guard_status);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                this.cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields;
                this.cr_viewer_archieved_guards_report.ReportSource       = report;
            }
            else
            {
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_archived_guard_lists report                  = new cr_archived_guard_lists();
                    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(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS", _guard_status));
                    report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS");
                    report.SetParameterValue("guard_status", SystemConst._guard_status);
                    this.cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields;
                    this.cr_viewer_archieved_guards_report.ReportSource       = report;
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
        }
        protected void Load_Report()
        {
            base.WindowState = FormWindowState.Maximized;
            guard_employment_record_report report         = new guard_employment_record_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.SetParameterValue("QueryName", "SELECT_GUARD_EMPLOYMENT_RECORD_REPORT");
            report.SetParameterValue("guard_number", SystemConst.guard_number);
            this.employment_report_reportviewer.ParameterFieldInfo = paramFields;
            this.employment_report_reportviewer.ReportSource       = report;
        }
Пример #7
0
        protected void LoadReport(string tracker_id)
        {
            ReportDocument crystalReport = new ReportDocument();

            crystalReport.Load(Server.MapPath("~/cr_DataEntryTracker.rpt"));

            foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in crystalReport.Database.Tables)
            {
                Set_Report_logons.SetTableLogin(tbCurrent);
            }

            DataSet ds = DataEntryTracker._ReturnDataEntryReport("weekly_tracker_report", tracker_id);

            crystalReport.SetDataSource(ds);
            crystalReport.SetParameterValue("@QueryType", "weekly_tracker_report");
            CrystalReportViewer1.ToolPanelView = ToolPanelViewType.None;
            CrystalReportViewer1.ReportSource  = crystalReport;
        }
Пример #8
0
        private void frm_sg_list_report_Load(object sender, EventArgs e)
        {
            base.WindowState = FormWindowState.Maximized;
            cr_all_guards_list     report                 = new cr_all_guards_list();
            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(sg_Reports.SELECT_GUARD_LIST("SELECT_GUARD_LIST"));
            report.SetParameterValue("QueryName", "SELECT_GUARD_LIST");
            report.SetParameterValue("client_name", SystemConst.ClientName);
            this.report_sg_lists.ParameterFieldInfo = paramFields;
            this.report_sg_lists.ReportSource       = report;
        }
Пример #9
0
        private void frm_officer_large_img_report_Load(object sender, EventArgs e)
        {
            base.WindowState = FormWindowState.Maximized;
            cr_guard_large_img     report                 = new cr_guard_large_img();
            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(sg_Reports.SELECT_GUARD_LARGE_IMAGE_RPT("", SystemConst.guard_number));
            report.SetParameterValue("QueryName", "SELECT_GUARD_LARGE_IMAGE_RPT");
            report.SetParameterValue("guard_number", SystemConst.guard_number);

            this.cr_large_image_report.ParameterFieldInfo = paramFields;
            this.cr_large_image_report.ReportSource       = report;
        }
        private void frm_kampala_active_guards_report_Load(object sender, EventArgs e)
        {
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

            cr_kampala_report report = new cr_kampala_report();

            ParameterFields        paramFields        = new ParameterFields();
            ParameterField         paramField         = new ParameterField();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

            foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
            {
                Set_Report_logons.SetTableLogin(tbCurrent);
            }

            report.SetDataSource(sg_Reports.SELECT_ACTIVE_GUARDS_KAMPALA("", SystemConst._branch));
            //check if user selected kampala
            if (SystemConst._branch == "KAMPALA")
            {
                report.SetParameterValue("QueryName", "SELECT_ACTIVE_GUARDS_KAMPALA_COMBINED");
                report.SetParameterValue("branch", SystemConst._branch);
                report.SetParameterValue("update_month", SystemConst._Report_update_month);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                cr_active_kampala_guards_report.ParameterFieldInfo = paramFields;


                this.cr_active_kampala_guards_report.ReportSource = report;
            }
            else
            {
                report.SetParameterValue("QueryName", "SELECT_ACTIVE_GUARDS_KAMPALA");
                report.SetParameterValue("branch", SystemConst._branch);
                report.SetParameterValue("update_month", SystemConst._Report_update_month);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                cr_active_kampala_guards_report.ParameterFieldInfo = paramFields;


                this.cr_active_kampala_guards_report.ReportSource = report;
            }
        }
Пример #11
0
        protected void LoadBushenyiTrackerReport(string tracker_id)
        {
            cr_DataEntryTracker objRptMain = new cr_DataEntryTracker();
            ReportDocument      objSubRpt  = new ReportDocument();

            objSubRpt.Load(Server.MapPath("~/Bushenyi_sub_report.rpt"));

            //foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in objSubRpt.Database.Tables)
            //{
            //    Set_Report_logons.SetTableLogin(tbCurrent);
            //}

            foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in objRptMain.Database.Tables)
            {
                Set_Report_logons.SetTableLogin(tbCurrent);
            }

            foreach (ReportDocument subreport in objRptMain.Subreports)
            {
                foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in subreport.Database.Tables)
                {
                    Set_Report_logons.SetTableLogin(CrTable);
                }
            }


            DataSet ds = DataEntryTracker._ReturnDataEntryReport("Data_entry_weekly_tracker_report", tracker_id);

            objSubRpt = objRptMain.OpenSubreport("Bushenyi_sub_report.rpt");
            objSubRpt.SetDataSource(ds);
            //objRptMain.SetParameterValue("@QueryType", "weekly_tracker_report");
            objRptMain.SetParameterValue("@QueryType", "Data_entry_weekly_tracker_report", objRptMain.Subreports[0].Name.ToString());
            objRptMain.SetParameterValue("@Tracker_id", tracker_id, objRptMain.Subreports[0].Name.ToString());
            CrystalReportViewer1.ToolPanelView = ToolPanelViewType.None;
            objRptMain.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "Tracker");
            CrystalReportViewer1.ReportSource = objRptMain;
        }
        protected void LoadReports(string ReportType)
        {
            switch (ReportType)
            {
            case "Payroll Report":

                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_staff_payroll       report                 = new cr_staff_payroll();
                    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(StaffPayrollReports.select_staff_payroll("select_staff_payroll", StaffPayrollReports._payment_period_id, StaffPayrollReports._branch_id, StaffPayrollReports._payment_month));
                    report.SetParameterValue("QueryName", "select_staff_payroll");
                    report.SetParameterValue("branch_id", StaffPayrollReports._branch_id);
                    report.SetParameterValue("branch_name", StaffPayrollReports._branch_id);
                    report.SetParameterValue("payment_month", StaffPayrollReports._payment_month);
                    report.SetParameterValue("payment_period_id", StaffPayrollReports._payment_period_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;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }

                break;

            case "Bank Payment Schedule":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_staff_bank_schedule report                 = new cr_staff_bank_schedule();
                    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(StaffPayrollReports.select_staff_payroll("select_staff_bank_schedule", StaffPayrollReports._payment_period_id, StaffPayrollReports._branch_id, StaffPayrollReports._payment_month));
                    report.SetParameterValue("QueryName", "select_staff_bank_schedule");
                    report.SetParameterValue("branch_id", StaffPayrollReports._branch_id);
                    report.SetParameterValue("payment_month", StaffPayrollReports._payment_month);
                    report.SetParameterValue("payment_period_id", StaffPayrollReports._payment_period_id);
                    report.SetParameterValue("bank_name", StaffPayrollReports.bank_name);
                    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;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;

            case "NSSF":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_staff_nssf_report   report                 = new cr_staff_nssf_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(StaffPayrollReports.select_staff_payroll("select_staff_nssf_report", StaffPayrollReports._payment_period_id, StaffPayrollReports._branch_id, StaffPayrollReports._payment_month));
                    report.SetParameterValue("QueryName", "select_staff_nssf_report");
                    report.SetParameterValue("branch_id", StaffPayrollReports._branch_id);
                    report.SetParameterValue("branch_name", StaffPayrollReports._branch_id);
                    report.SetParameterValue("payment_month", StaffPayrollReports._payment_month);
                    report.SetParameterValue("payment_period_id", StaffPayrollReports._payment_period_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;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;

            case "PAYE":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_staff_paye_report   report                 = new cr_staff_paye_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(StaffPayrollReports.select_staff_payroll("select_staff_paye_report", StaffPayrollReports._payment_period_id, StaffPayrollReports._branch_id, StaffPayrollReports._payment_month));
                    report.SetParameterValue("QueryName", "select_staff_paye_report");
                    report.SetParameterValue("branch_id", StaffPayrollReports._branch_id);
                    report.SetParameterValue("payment_month", StaffPayrollReports._payment_month);
                    report.SetParameterValue("payment_period_id", StaffPayrollReports._payment_period_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;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;

            case "LST":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    cr_staff_local_service_tax_report report      = new cr_staff_local_service_tax_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(StaffPayrollReports.select_staff_payroll("select_staff_local_service_tax_report", StaffPayrollReports._payment_period_id, StaffPayrollReports._branch_id, StaffPayrollReports._payment_month));
                    report.SetParameterValue("QueryName", "select_staff_local_service_tax_report");
                    report.SetParameterValue("branch_id", StaffPayrollReports._branch_id);
                    report.SetParameterValue("payment_month", StaffPayrollReports._payment_month);
                    report.SetParameterValue("payment_period_id", StaffPayrollReports._payment_period_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;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;

                #region LegacyReports
            case "Legacy_DebtorsList":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    crDebtorsReport        report                 = new crDebtorsReport();
                    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(AccountsBackEnd.LegacyReports.LoadDebtorsListing("select_debtors_list", LegacyReports.station_code, LegacyReports.begin_date, LegacyReports.end_date));
                    report.SetParameterValue("queryname", "select_debtors_list");
                    report.SetParameterValue("station_code", LegacyReports.station_code);
                    report.SetParameterValue("begin_date", LegacyReports.begin_date);
                    report.SetParameterValue("end_date", LegacyReports.end_date);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;

            case "Legacy_Client_statement":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    crClientstatementReport report                 = new crClientstatementReport();
                    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(AccountsBackEnd.LegacyReports.LoadClientStatement("select_client_account_statement", LegacyReports.client_code, LegacyReports.begin_date, LegacyReports.end_date));
                    report.SetParameterValue("queryname", "select_client_account_statement");
                    report.SetParameterValue("client_code", LegacyReports.client_code);
                    report.SetParameterValue("begin_date", LegacyReports.begin_date);
                    report.SetParameterValue("end_date", LegacyReports.end_date);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;

            case "Legacy_income_and_expenditure_statement":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    crIncomeExpenditureReport report                 = new crIncomeExpenditureReport();
                    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(AccountsBackEnd.LegacyReports.LoadIncomeandExpenditureReport("income_and_expenditure", LegacyReports.station_code, LegacyReports.begin_date, LegacyReports.end_date));
                    report.SetParameterValue("queryname", "income_and_expenditure");
                    report.SetParameterValue("subpcode", LegacyReports.station_code);
                    report.SetParameterValue("begin_date", LegacyReports.begin_date);
                    report.SetParameterValue("end_date", LegacyReports.end_date);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;

            case "Legacy_trial_balance":
                try
                {
                    base.WindowState = FormWindowState.Maximized;
                    crTrialbalance         report                 = new crTrialbalance();
                    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(AccountsBackEnd.LegacyReports.LoadIncomeandExpenditureReport("trial_balance", LegacyReports.station_code, LegacyReports.begin_date, LegacyReports.end_date));
                    report.SetParameterValue("queryname", "trial_balance");
                    report.SetParameterValue("subpcode", LegacyReports.station_code);
                    report.SetParameterValue("begin_date", LegacyReports.begin_date);
                    report.SetParameterValue("end_date", LegacyReports.end_date);
                    this.cr_finance_detailed_guard_pay_roll_report.ParameterFieldInfo = paramFields;
                    this.cr_finance_detailed_guard_pay_roll_report.ReportSource       = report;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.ToString());
                }
                break;
                #endregion
            }
        }
Пример #13
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());
                }
            }
        }