Esempio n. 1
0
        public void PreviewBudgetFormEntry(int budID, string wbs)
        {
            FPreviewAR           pv   = new FPreviewAR();
            rprtBudgetAccounting rprt = new rprtBudgetAccounting();
            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.GetBudgetAccountingEntryForReport(budID, wbs);

            rprt.SetTitles(cust.Name + " / " + loc.City + "," + state.Abbrev, proj.Description, proj.Number, bud.GetNumber(), wbs);
            rprt.DataSource = ds;
            rprt.DataMember = "Table";
            pv.projNumber   = proj.Number; //*************************Added 6/29/15

            pv.ViewReport(rprt);
            pv.ShowDialog();
        }
Esempio n. 2
0
        private GrapeCity.ActiveReports.Document.Section.PagesCollection CreatePagesBudgetFormEntry(int budID, string wbs)
        {
            rprtBudgetAccounting rprt = new rprtBudgetAccounting();
            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.GetBudgetAccountingEntryForReport(budID, wbs);

            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 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. 4
0
        public void LoadByID(int itmID)
        {
            ClearForm();

            moCust.Load(itmID);
            LoadObjectToScreen();
            mbItemChanged = false;
            LoadLocations(itmID);
            grpLocation.Enabled = true;
            bttOK.Enabled       = false;
            bttApply.Enabled    = false;

            //toolTip1.Active = false;
        }
Esempio n. 5
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. 6
0
        private void LoadPCNLog(int projectID)
        {
            CBProject  proj = new CBProject();
            CBCustomer cust = new CBCustomer();
            CBEmployee emp  = new CBEmployee();

            miProjectID = projectID;
            proj.Load(projectID);
            cust.Load(proj.CustomerID);
            emp.Load(proj.ProjMngrID);
            emp.Load(proj.LeadProjMngrID);

            txtClient.Text         = cust.Name;
            txtProjName.Text       = proj.Description;
            txtHGANumber.Text      = proj.Number;
            txtClientNumber.Text   = proj.CustomerProjNumber;
            txtProjectManager.Text = emp.Name;

            mdsPCNLogs = CBBudgetPCN.GetPCNLogByProjID(projectID);
            tdbgPCNLogs.SetDataBinding(mdsPCNLogs, "Table", true);

            int     hours, mh;
            decimal tic, dlr, trend;

            hours = 0;
            tic   = 0;
            mh    = 0;
            dlr   = 0;
            trend = 0;

            CBBudgetPCN.GetPCILogTotalByProjID(projectID, ref hours, ref tic, ref mh, ref dlr, ref trend);

            txtTotalEngHrs.Text  = hours.ToString();
            txtTotalEngrTIC.Text = tic.ToString("#,##0");
            txtBudgetMHAdd.Text  = mh.ToString();
            txtBudgetDlrAdd.Text = dlr.ToString("#,##0");
            txtBudgetTrend.Text  = trend.ToString("#,##0");

            if (mdsPCNLogs.Tables[0].Rows.Count > 0)
            {
                tlbbPrint.Enabled = true;
            }
            else
            {
                tlbbPrint.Enabled = false;
            }
        }
Esempio n. 7
0
        public void SetProject(int deptID, int projID, int weekID, decimal totPlan, decimal totFor, decimal totAct)
        {
            CBProject       p  = new CBProject();
            CBWeekList      w  = new CBWeekList();
            CBCustomer      c  = new CBCustomer();
            CBProjectBudget pb = new CBProjectBudget();
            CBDepartment    d  = new CBDepartment();

            p.Load(projID);
            miProjID = projID;

            w.Load(weekID);
            c.Load(p.CustomerID);

            pb.Load(deptID, projID);
            d.Load(deptID);

            txtNumber.Text      = p.Number;
            txtWeek.Text        = w.StartOfWeek.ToShortDateString();
            txtStartDate.Text   = p.DateStart.ToShortDateString();
            txtEndDate.Text     = p.DateEnd.ToShortDateString();
            txtDescription.Text = p.Description;
            txtCustomer.Text    = c.Name;
            if (d.Name.Length > 5)
            {
                lblBudget.Text = d.Name.Substring(0, 5) + " Bugt.:";
            }
            else
            {
                lblBudget.Text = d.Name + " Bugt.:";
            }
            txtTotBudget.Text   = pb.BudgetHrs.ToString(DISPFORMAT);
            txtTotPlanned.Text  = totPlan.ToString(DISPFORMAT);
            txtTotForecast.Text = totFor.ToString(DISPFORMAT);
            txtTotActual.Text   = totAct.ToString(DISPFORMAT);
            txtRemaining.Text   = ((decimal)(totFor + totAct)).ToString(DISPFORMAT);
        }
Esempio n. 8
0
        private void LoadObjectToScreen()
        {
            CBCustomer     c  = new CBCustomer();
            CBLocation     l  = new CBLocation();
            CBEmployee     e  = new CBEmployee();
            CBRateSchedule rs = new CBRateSchedule();

            txtNumber.Text      = moProj.Number;
            txtDescription.Text = moProj.Description;

            c.Load(moProj.CustomerID);
            cboCustomer.Text       = c.Name;
            txtCustomerNumber.Text = moProj.CustomerProjNumber;

            LoadLocationBox(moProj.CustomerID);
            l.Load(moProj.LocationID);
            cboLocation.Text = l.FullName;

            e.Load(moProj.ProjMngrID);
            cboManager.Text = e.Name;

            e.Load(moProj.LeadProjMngrID);
            cboManagerLead.Text = e.Name;

            e.Load(moProj.RelationshipMngrID);
            cboRelationship.Text = e.Name;

            rs.Load(moProj.RateSchedID);
            cboRateSched.Text = rs.Name;
            if (rs.IsMultiplier == true)
            {
                lblMultiplier.Visible = true;
                txtMultiplier.Visible = true;
                txtMultiplier.Text    = moProj.Multiplier.ToString("#,##0.00");
                lblOverlay.Visible    = true;
                txtOverlay.Visible    = true;
                txtOverlay.Text       = moProj.Overlay.ToString("#,##0.00");
            }
            else
            {
                lblMultiplier.Visible = false;
                txtMultiplier.Visible = false;
                txtMultiplier.Text    = "0.00";
                lblOverlay.Visible    = false;
                txtOverlay.Visible    = false;
                txtOverlay.Text       = "0.00";
            }

            txtPOAmount.Text = moProj.POAmount;

            dtpStart.Value            = moProj.DateStart;
            dtpEnd.Value              = moProj.DateEnd;
            chkActiveProposal.Checked = moProj.IsProposal;
            chkIsBooked.Checked       = moProj.IsBooked;
            chkIsActive.Checked       = moProj.IsActive;
            chkIsGovernment.Checked   = moProj.IsGovernment;
            chkIsMaster.Checked       = moProj.IsMaster;
            chkIsFixedRate.Checked    = moProj.IsFixedRate;



            if (moProj.MasterID > 0)
            {
                cboMasterJobs.Text = CBProject.GetNumberByID(moProj.MasterID);
            }

            cboReportStatus.SelectedIndex = moProj.ReportingStatus;

            rtbNotes.Text = moProj.Notes;

            mdsBudget = CBProjectBudget.GetListDSByProjID(moProj.ID);
            tdbgBudget.SetDataBinding(mdsBudget, "Table", true);

            TotalBudget();

            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

            sec.InitAppSettings();
            u.Load(sec.UserID);

            if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
            {
                chkActiveProposal.Enabled = true;
                chkIsActive.Enabled       = true;
                chkIsBooked.Enabled       = true;
            }
        }
Esempio n. 9
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. 10
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. 11
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);
            }
        }