Example #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();
        }
Example #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);
        }
Example #3
0
        private void LoadItemList()
        {
            SqlDataReader dr;
            ListViewItem  lvi;

            this.Cursor = Cursors.WaitCursor;

            dr = CBCustomer.GetList();
            lvwItems.Items.Clear();
            while (dr.Read())
            {
                lvi = new ListViewItem();

                lvi.Text = dr["ID"].ToString();
                lvi.SubItems.Add(dr["Number"].ToString());
                lvi.SubItems.Add(dr["Name"].ToString());

                lvwItems.Items.Add(lvi);
            }
            lvwItems.ColumnClick += new ColumnClickEventHandler(lvwItems_ColumnClick);
            dr.Close();
            dr = null;

            sbPanStatus.Text = lvwItems.Items.Count.ToString() + " customer(s)";

            this.Cursor = Cursors.Default;
        }
Example #4
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();
        }
Example #5
0
        private void LoadScreenToObject()
        {
            CBCustomer     c  = new CBCustomer();
            CBEmployee     e  = new CBEmployee();
            CBRateSchedule rs = new CBRateSchedule();

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

            Func <ComboBox, int?> getId = (box) => {
                var selected = ((RSLib.COListItem)box.SelectedItem);
                return((selected != null) ? selected.ID : (int?)null);
            };

            moProj.CustomerID         = getId(cboCustomer) ?? moProj.CustomerID;
            moProj.LocationID         = getId(cboLocation) ?? moProj.LocationID;
            moProj.ProjMngrID         = getId(cboManager) ?? moProj.ProjMngrID;
            moProj.LeadProjMngrID     = getId(cboManagerLead) ?? moProj.LeadProjMngrID;
            moProj.RelationshipMngrID = getId(cboRelationship) ?? moProj.RelationshipMngrID;
            moProj.RateSchedID        = getId(cboRateSched) ?? moProj.RateSchedID;

            moProj.Multiplier = RevSol.RSMath.IsDecimalEx(txtMultiplier.Text);
            moProj.Overlay    = RevSol.RSMath.IsDecimalEx(txtOverlay.Text);

            moProj.POAmount = txtPOAmount.Text;

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

            if (cboMasterJobs.SelectedItem == null)
            {
                moProj.MasterID = 0;
            }
            else
            {
                moProj.MasterID = ((RSLib.COListItem)cboMasterJobs.SelectedItem).ID;
            }

            moProj.ReportingStatus = cboReportStatus.SelectedIndex;

            moProj.Notes       = rtbNotes.Text;
            moProj.IsFixedRate = chkIsFixedRate.Checked;
        }
Example #6
0
        protected override void bttDelete_Click(object sender, EventArgs e)
        {
            base.bttDelete_Click(sender, e);

            int    tmpID = Convert.ToInt32(lvwItems.SelectedItems[0].Text);
            string val   = lvwItems.SelectedItems[0].SubItems[2].Text;

            DialogResult retVal = MessageBox.Show("Are you sure that you wish to remove \"" + val + "\"", "Remove Item", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (retVal == DialogResult.Yes)
            {
                CBCustomer.Delete(tmpID);
                LoadItemList();
            }
        }
Example #7
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);
        }
Example #8
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;
            }
        }
Example #9
0
        private void ClearForm()
        {
            moCust = new CBCustomer();

            txtNumber.Text = "";
            txtName.Text   = "";
            mbItemChanged  = false;
            lstLocations.Items.Clear();

            bttEdit.Enabled   = false;
            bttRemove.Enabled = false;
            bttOK.Enabled     = false;
            bttApply.Enabled  = false;

            //toolTip1.SetToolTip(this.grpLocation, "Save changes for customer to edit locations");
            //toolTip1.Active = true;

            CreateRemovedDS();
        }
Example #10
0
        private void LoadCustomerBox()
        {
            SqlDataReader dr;

            RSLib.COListItem li;

            dr = CBCustomer.GetList();

            cboCustomer.Items.Clear();

            while (dr.Read())
            {
                li = new RSLib.COListItem();

                li.ID          = Convert.ToInt32(dr["ID"]);
                li.Description = dr["Name"].ToString();

                cboCustomer.Items.Add(li);
            }

            dr.Close();
        }
Example #11
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);
        }
Example #12
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;
            }
        }
Example #13
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();
        }
Example #14
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);
        }
Example #15
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);
            }
        }