Esempio n. 1
0
        public void PreviewBudgetDetails(int budID, string wbs)
        {
            FPreviewAR       pv   = new FPreviewAR();
            rprtBudgetDetail rprt = new rprtBudgetDetail();
            DataSet          ds;
            CBBudget         bud   = new CBBudget();
            CBProject        proj  = new CBProject();
            CBCustomer       cust  = new CBCustomer();
            CBLocation       loc   = new CBLocation();
            CBState          state = new CBState();

            bud.Load(budID);
            proj.Load(bud.ProjectID);
            cust.Load(proj.CustomerID);
            loc.Load(proj.LocationID);
            state.Load(loc.StateID);

            ds = CBBudget.GetBudgetDetailsForReport(budID, wbs);


            if (proj.BusinessUnit() == 1)
            {
                rprt.MainReportTitle = "Staffing Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 2)
            {
                rprt.MainReportTitle = "Engineering Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 3)
            {
                rprt.MainReportTitle = "Pipeline Services Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 4)
            {
                rprt.MainReportTitle = "Program Management Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 5)
            {
                rprt.MainReportTitle = "EPC Estimate Loaded Details";
            }


            pv.projNumber = proj.Number; //***************************Added 6/25/15

            // MessageBox.Show(pv.projNumber);

            rprt.SetTitles(cust.Name + " / " + loc.City + "," + state.Abbrev, proj.Description, proj.Number, bud.GetNumber(), wbs);
            rprt.DataSource = ds;
            rprt.DataMember = "Table";
            pv.Title        = rprt.MainReportTitle; //************************Added 10/1/2015
            pv.ViewReport(rprt);
            pv.ShowDialog();
        }
Esempio n. 2
0
        private GrapeCity.ActiveReports.Document.Section.PagesCollection CreatePagesBudgetDetails(int budID, string wbs)
        {
            rprtBudgetDetail rprt = new rprtBudgetDetail();
            DataSet          ds;
            CBBudget         bud   = new CBBudget();
            CBProject        proj  = new CBProject();
            CBCustomer       cust  = new CBCustomer();
            CBLocation       loc   = new CBLocation();
            CBState          state = new CBState();

            bud.Load(budID);
            proj.Load(bud.ProjectID);
            cust.Load(proj.CustomerID);
            loc.Load(proj.LocationID);
            state.Load(loc.StateID);

            ds = CBBudget.GetBudgetDetailsForReport(budID, wbs);


            if (proj.BusinessUnit() == 1)
            {
                rprt.MainReportTitle = "Staffing Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 2)
            {
                rprt.MainReportTitle = "Engineering Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 3)
            {
                rprt.MainReportTitle = "Pipeline Services Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 4)
            {
                rprt.MainReportTitle = "Program Management Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 5)
            {
                rprt.MainReportTitle = "EPC Estimate Loaded Details";
            }

            rprt.SetTitles(cust.Name + " / " + loc.City + "," + state.Abbrev, proj.Description, proj.Number, bud.GetNumber(), wbs);
            rprt.DataSource = ds;
            rprt.DataMember = "Table";

            rprt.Run(false);

            return(rprt.Document.Pages);
        }
Esempio n. 3
0
        public void PreviewBudgetSummary(int budID, string wbs, bool rate) //***********************Added 7/22/2015
        {
            FPreviewAR         pv   = new FPreviewAR();
            rprtBudgetSummary1 rprt = new rprtBudgetSummary1();
            DataSet            ds;


            int        totalHours;
            decimal    totalHourDollars;
            decimal    totalExpenses;
            decimal    contingency;
            CBBudget   bud   = new CBBudget();
            CBProject  proj  = new CBProject();
            CBCustomer cust  = new CBCustomer();
            CBLocation loc   = new CBLocation();
            CBState    state = new CBState();

            bud.Load(budID);
            proj.Load(bud.ProjectID);
            cust.Load(proj.CustomerID);
            loc.Load(proj.LocationID);
            state.Load(loc.StateID);

            totalHours       = CBBudget.GetTotalBudgetHours(budID, wbs);
            totalHourDollars = CBBudget.GetTotalBudgetHourDollars(budID, wbs);
            totalExpenses    = CBBudget.GetTotalBudgetExpenses(budID);
            contingency      = CBBudget.GetContingencyForBudget(budID);

            ds = CBBudget.GetBudgetSummaryForReport(budID, wbs);
            //ds = CBBudget.GetBudgetSummaryForReport(budID, wbs);
            if (proj.BusinessUnit() == 1)
            {
                rprt.MainReportTitle = "Staffing Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 2)
            {
                rprt.MainReportTitle = "Engineering Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 3)
            {
                rprt.MainReportTitle = "Pipeline Services Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 4)
            {
                rprt.MainReportTitle = "Program Management Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 5)
            {
                rprt.MainReportTitle = "EPC Estimate Loaded Summary";
            }



            rprt.SetTitles(proj.Number, proj.Description, bud.GetNumber(), cust.Name, loc.City + "," + state.Abbrev, wbs);
            rprt.TotalHours       = totalHours;
            rprt.TotalHourDollars = totalHourDollars;
            rprt.TotalExpenses    = totalExpenses;
            rprt.Contingency      = contingency;
            rprt.Rate             = rate;
            rprt.DataSource       = ds;
            rprt.DataMember       = "Table";


            pv.projNumber = proj.Number; // **************************Added 6/29/2015 **************************
            if (rate == false)           //************************Added 10/1/2015
            {
                pv.Title = rprt.MainReportTitle + "WO Rate";
            }
            else
            {
                pv.Title = rprt.MainReportTitle;
            }
            pv.ViewReport(rprt);
            pv.ShowDialog();
        }
Esempio n. 4
0
        private GrapeCity.ActiveReports.Document.Section.PagesCollection CreatePagesBudgetSummary(int budID, string wbs)
        {
            rprtBudgetSummary1 rprt = new rprtBudgetSummary1();
            DataSet            ds;

            int        totalHours;
            decimal    totalHourDollars;
            decimal    totalExpenses;
            decimal    contingency;
            CBBudget   bud   = new CBBudget();
            CBProject  proj  = new CBProject();
            CBCustomer cust  = new CBCustomer();
            CBLocation loc   = new CBLocation();
            CBState    state = new CBState();

            bud.Load(budID);
            proj.Load(bud.ProjectID);
            cust.Load(proj.CustomerID);
            loc.Load(proj.LocationID);
            state.Load(loc.StateID);

            totalHours       = CBBudget.GetTotalBudgetHours(budID, wbs);
            totalHourDollars = CBBudget.GetTotalBudgetHourDollars(budID, wbs);
            totalExpenses    = CBBudget.GetTotalBudgetExpenses(budID);
            contingency      = CBBudget.GetContingencyForBudget(budID);
            ds = CBBudget.GetBudgetSummaryForReport(budID, wbs);


            if (proj.BusinessUnit() == 1)
            {
                rprt.MainReportTitle = "Staffing Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 2)
            {
                rprt.MainReportTitle = "Engineering Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 3)
            {
                rprt.MainReportTitle = "Pipeline Services Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 4)
            {
                rprt.MainReportTitle = "Program Management Estimate Loaded Summary";
            }
            if (proj.BusinessUnit() == 5)
            {
                rprt.MainReportTitle = "EPC Estimate Loaded Summary";
            }

            rprt.SetTitles(proj.Number, proj.Description, bud.GetNumber(), cust.Name, loc.City + "," + state.Abbrev, wbs);
            rprt.TotalHours       = totalHours;
            rprt.TotalHourDollars = totalHourDollars;
            rprt.TotalExpenses    = totalExpenses;
            rprt.Contingency      = contingency;
            rprt.DataSource       = ds;
            rprt.DataMember       = "Table";

            rprt.Run(false);

            return(rprt.Document.Pages);
        }
Esempio n. 5
0
        public void Show_BudgetDetails(int budID, string wbs)    //**************************Added 6/22/15
        {
            FPreviewAR       pv   = new FPreviewAR();
            rprtBudgetDetail rprt = new rprtBudgetDetail();
            DataSet          ds;
            CBBudget         bud   = new CBBudget();
            CBProject        proj  = new CBProject();
            CBCustomer       cust  = new CBCustomer();
            CBLocation       loc   = new CBLocation();
            CBState          state = new CBState();

            bud.Load(budID);
            proj.Load(bud.ProjectID);
            cust.Load(proj.CustomerID);
            loc.Load(proj.LocationID);
            state.Load(loc.StateID);

            ds = CBBudget.GetBudgetDetailsForReport(budID, wbs);


            if (proj.BusinessUnit() == 1)
            {
                rprt.MainReportTitle = "Staffing Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 2)
            {
                rprt.MainReportTitle = "Engineering Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 3)
            {
                rprt.MainReportTitle = "Pipeline Services Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 4)
            {
                rprt.MainReportTitle = "Program Management Estimate Loaded Details";
            }
            if (proj.BusinessUnit() == 5)
            {
                rprt.MainReportTitle = "EPC Estimate Loaded Details";
            }

            rprt.SetTitles(cust.Name + " / " + loc.City + "," + state.Abbrev, proj.Description, proj.Number, bud.GetNumber(), wbs);
            rprt.DataSource = ds;
            rprt.DataMember = "Table";

            //pv.ViewReport(rprt);
            //pv.ShowDialog();



            GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport PDFEx = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport();

            pv.Title = rprt.MainReportTitle;  //************************Added 10/1/2015
            rprt.Run();

            SaveFileDialog sv1 = new SaveFileDialog();

            sv1.Filter     = "PDF Files | *.pdf";
            sv1.DefaultExt = "pdf";

            //PDFEx.FileFormat = GrapeCity.ActiveReports.Export.Pdf.Section.FileFormat.Xlsx;


            if (sv1.ShowDialog() == DialogResult.OK)
            {
                //    ee.ExportBudgetForPrimavera(saveFileDialog1.FileName, moPCN.ID);
                PDFEx.Export(rprt.Document, sv1.FileName);
            }
        }