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); }
public static int GetRprtCase(string proj) { int caseVal = 0; CBProject p = new CBProject(); p.Load(proj); if (proj.Substring(0, 2) == "8.") { caseVal = 1; } else if (proj.Substring(0, 3) == "P.8") { caseVal = 1; } else { caseVal = 0; } if (p.UseAllGroups() == true) { caseVal = 0; } return(caseVal); }
public string GetCleanNumber() { string tmpNumber; string number; CBProject p = new CBProject(); CBBudgetPCN pcn = new CBBudgetPCN(); p.Load(base.ProjectID); pcn.Load(base.PCNID); tmpNumber = p.Number; int test = tmpNumber.IndexOf("-"); if (tmpNumber.IndexOf("-") > 1) { number = tmpNumber.Substring(0, tmpNumber.IndexOf("-")); } else { number = tmpNumber; } if (base.Revision > 0) { number += "-r" + base.Revision.ToString(); } if (pcn.ID > 0) { number += "-PCN" + pcn.PCNNumber; } return(number); }
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(); }
public void EditPreviousPCN(int pcnID) { ClearForm(); moProj = new CBProject(); moBudg = new CBBudget(); moPCN.LoadWithData(pcnID); moProj.Load(moPCN.ProjectID); project_ID = moPCN.ProjectID; List <CBActivityCodeDisc> _Groups = CBActivityCodeDisc.GetAllForProject(project_ID).ToList(); foreach (var group in _Groups) { codes[i] = group.Code; i++; } moBudg.LoadByProject(moProj.ID); LoadFromPCN(); this.Text = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber; SetPCNSecurityLevel(); mbIsFixedRate = moProj.IsFixedRate; SetPCN_RateLevel(); }
public void StartNewPCN(int projID) { ClearForm(); moProj = new CBProject(); moProj.Load(projID); moPCN.PCNNumber = moPCN.GetNextPCNNumber(projID); moPCN.ProjectID = projID; lblProjectNumber.Text = moProj.Number; lblProjectTitle.Text = moProj.Description; txtPCNNumber.Text = moPCN.PCNNumber; this.Text = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber; project_ID = moPCN.ProjectID; List <CBActivityCodeDisc> _Groups = CBActivityCodeDisc.GetAllForProject(project_ID).ToList(); foreach (var group in _Groups) { codes[i] = group.Code; i++; } SetPCNSecurityLevel(); mbIsFixedRate = moProj.IsFixedRate; }
private void MoveObjectToScreen() { CBProject p = new CBProject(); p.Load(moTrans.ProjectID); dtpDateRelease.Value = moTrans.DateIssued; txtIssueBy.Text = moTrans.IssuedBy; txtProject.Tag = moTrans.ProjectID; txtProject.Text = p.Number; rdoRelPreliminary.Checked = moTrans.RelPreliminary; rdoRelApproval.Checked = moTrans.RelApproval; rdoRelBidding.Checked = moTrans.RelBidding; rdoRelConstruction.Checked = moTrans.RelConstruction; rdoRelOther.Checked = moTrans.RelOther; txtRelOther.Text = moTrans.RelOtherTxt; chkSendPickup.Checked = moTrans.SendPickup; chkSendDelivery.Checked = moTrans.SendDelivery; chkSendOther.Checked = moTrans.SendDwg; txtSendOther.Text = moTrans.SendEmailOther; chkSendRegMail.Checked = moTrans.SendRegular; chkSendERoom.Checked = moTrans.SendDwg; chkSendPdf.Checked = moTrans.SendPdf; chkSendDxf.Checked = moTrans.SendDxf; chkSendDwg.Checked = moTrans.SendDwg; chkSendGround.Checked = moTrans.SendGround; chkSendSecDay.Checked = moTrans.SendSecDay; chkSendNextDay.Checked = moTrans.SendNextDay; rtbComments.Text = moTrans.Comments; }
private void LoadCurrentGroups() { RevSol.RSConnection cnn; SqlDataReader dr; SqlCommand cmd; SqlParameter prm; DataRow d; int grpNum; CBProject proj = new CBProject(); proj.Load(msCurrProj); if (CheckForPipeline(msCurrProj) == true) { grpNum = 1; } else { grpNum = 0; } if (proj.UseAllGroups() == true) { grpNum = 0; } CreateNewForecastDS(); cnn = new RevSol.RSConnection("CR"); cmd = new SqlCommand("spAcctGroup_ListAll2", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@SpecialGroup", SqlDbType.Int); prm.Value = grpNum; dr = cmd.ExecuteReader(); while (dr.Read()) { d = mdsForecast.Tables["Forecast"].NewRow(); d["AcctGroup"] = dr["AcctNumber"]; d["FTCHrs"] = 0; d["FTCRate"] = 0; mdsForecast.Tables["ForeCast"].Rows.Add(d); } dr.Close(); cnn.CloseConnection(); LoadExpenseGroups(); }
void ProjectSelected(int itmID) { CBProject p = new CBProject(); p.Load(itmID); txtProject.Text = p.Number + " - " + p.Description; txtProject.Tag = itmID; mProjectID = itmID; }
public void LoadByID(int itmID) { ClearForm(); moProj.Load(itmID); LoadObjectToScreen(); previousPM = moProj.ProjMngrID; mbItemChanged = false; mbPMChanged = false; }
public void InsertWBS1Outline(int budID) { CDbVisionExport db = new CDbVisionExport(); CBBudget bud = new CBBudget(); CBProject proj = new CBProject(); bud.Load(budID); proj.Load(bud.ProjectID); db.InsertWBS1Outline(proj.Number, proj.Description, proj.Number, proj.DateStart, proj.DateEnd); }
public void SetProjectID(int projID) { CBProject proj = new CBProject(); proj.Load(projID); this.Text = "PCI List -- " + proj.Number + proj.Description; miProjID = projID; tmrLoadPCIList.Enabled = true; }
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(); }
public void InsertWBS2Outline(int budID, string OutlineNumber, string Name, string WBS2, string ParentOutlineNumber, DateTime DateStart, DateTime DateEnd, int ChildrenCount) { CDbVisionExport db = new CDbVisionExport(); CBBudget bud = new CBBudget(); CBProject proj = new CBProject(); bud.Load(budID); proj.Load(bud.ProjectID); db.InsertWBS2Outline(proj.Number, OutlineNumber, Name, proj.Number, WBS2, ParentOutlineNumber, DateStart, DateEnd, ChildrenCount); }
void ProjectSelected(int itmID) { CBProject p = new CBProject(); miCurrProj = itmID; p.Load(itmID); txtProject.Tag = itmID; txtProject.Text = p.Number; EnableSave(); }
public void CopyPCN(int projID, int pcnID) { ClearForm(); moProj = new CBProject(); moBudg = new CBBudget(); moPCN.LoadWithCopyData(pcnID); moProj.Load(moPCN.ProjectID); moBudg.LoadByProject(moProj.ID); LoadFromPCN(); this.Text = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber; moProj.Load(projID); moPCN.PCNNumber = moPCN.GetNextPCNNumber(projID); moPCN.ProjectID = projID; lblProjectNumber.Text = moProj.Number; lblProjectTitle.Text = moProj.Description; txtPCNNumber.Text = moPCN.PCNNumber; this.Text = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber; project_ID = moPCN.ProjectID; List <CBActivityCodeDisc> _Groups = CBActivityCodeDisc.GetAllForProject(project_ID).ToList(); foreach (var group in _Groups) { codes[i] = group.Code; i++; } SetPCNSecurityLevel(); mbIsFixedRate = moProj.IsFixedRate; SetPCN_RateLevel(); }
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); }
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; } }
private void ClearForm(int deptID, int projID) { CBProject p = new CBProject(); miCurrDept = deptID; miCurrProj = projID; p.Load(projID); txtNumber.Text = p.Number; txtDescription.Text = p.Description; lstAvailable.Items.Clear(); lstAssigned.Items.Clear(); LoadAvailableEmployees(); }
public static void PrintTransmittal(int transmittalID) { rprtTransmittal1 rprt = new rprtTransmittal1(); DataSet ds; FPreviewAR pv = new FPreviewAR(); CBProject proj = new CBProject(); //***********************************Added 9/30/2015 CBTransmittal t = new CBTransmittal(); t.Load(transmittalID); proj.Load(t.ProjectID); pv.projNumber = proj.Number; ds = CBTransmittal.GetTransmittalForReport(transmittalID); rprt.DataSource = ds; rprt.DataMember = "Table"; pv.ViewReport(rprt); pv.ShowDialog(); }
public static void PrintTransmittalRelease(int releaseID) { rprtTransmittalRelease1 rprt = new rprtTransmittalRelease1(); DataSet ds; FPreviewAR pv = new FPreviewAR(); CBProject proj = new CBProject(); //***********************************Added 9/30/2015 CBTransmittalRelease r = new CBTransmittalRelease(); r.Load(releaseID); proj.Load(r.ProjectID); pv.projNumber = proj.Number; ds = CBTransmittalRelease.GetTransmittalReleaseForReport(releaseID); rprt.DataSource = ds; rprt.DataMember = "Table"; pv.ViewReport(rprt); pv.ShowDialog(); }
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); }
public void ClearForm(bool forceClear) { if (moPci != null && forceClear == false) { return; } moPci = new CBPCIInfo(); txtDiscipline.Text = ""; lblPCINumber.Text = CBPCIInfo.GetNextPCINumber(miDiscipline, miProject); txtInitiatedBy.Text = ""; lblProjectNumber.Text = ""; lblProjectTitle.Text = ""; txtPCITitle.Text = ""; dtpDateInitiated.Value = DateTime.Now; txtRequestedBy.Text = ""; dtpDateRequested.Value = DateTime.Now; txtDescription.Text = ""; rdoDesignError.Checked = false; rdoVendorError.Checked = false; rdoEstimatingError.Checked = false; rdoContractorError.Checked = false; rdoScheduleDelay.Checked = false; rdoScopeAddition.Checked = false; rdoScopeDeletion.Checked = false; rdoDesignChange.Checked = false; rdoOther.Checked = false; txtOtherReason.Text = ""; txtOtherReason.Enabled = false; chkMechPiping.Checked = false; chkCSA.Checked = false; chkProjAdmin.Checked = false; chkProcess.Checked = false; chkElectInst.Checked = false; txtEstimatedHrs.Text = ""; txtEstimatedCost.Text = ""; txtEstimatedTIC.Text = ""; txtEstimatedAccuracy.Text = ""; txtScheduleImpact.Text = ""; chkAppvProceed.Checked = false; chkAppvTrack.Checked = false; chkNotAppvDNP.Checked = false; txtProjMngr.Text = ""; lblDateApproved.Text = ""; if (miDiscipline != 0) { CBDepartment dept = new CBDepartment(); dept.Load(miDiscipline); txtDiscipline.Text = dept.Name; moPci.DepartmentID = miDiscipline; } if (miProject != 0) { CBProject proj = new CBProject(); CBEmployee emp = new CBEmployee(); proj.Load(miProject); emp.Load(proj.ProjMngrID); emp.Load(proj.LeadProjMngrID); lblProjectNumber.Text = proj.Number; lblProjectTitle.Text = proj.Description; txtProjMngr.Text = emp.Name; moPci.ProjectID = miProject; moPci.ProjectManagerID = proj.ProjMngrID; } mbNewPCNNeeded = false; }
private void LoadObjectToScreen() { CBDepartment dept = new CBDepartment(); CBEmployee emp = new CBEmployee(); CBProject proj = new CBProject(); dept.Load(moPci.DepartmentID); emp.Load(moPci.InitiatedByID); proj.Load(moPci.ProjectID); projectNumber = proj.Number; //////*************************************************6/25/15 // MessageBox.Show("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); // MessageBox.Show(projectNumber); txtDiscipline.Text = dept.Name; lblPCINumber.Text = moPci.PCINumber; txtPCITitle.Text = moPci.PCITitle; txtInitiatedBy.Text = emp.Name; dtpDateInitiated.Value = moPci.DateInitiated; lblProjectNumber.Text = proj.Number; lblProjectTitle.Text = proj.Description; txtRequestedBy.Text = moPci.RequestedBy; dtpDateRequested.Value = moPci.DateRequested; txtDescription.Text = moPci.DescOfChange; rdoDesignError.Checked = moPci.ReasonDesignError; rdoVendorError.Checked = moPci.ReasonVendorError; rdoEstimatingError.Checked = moPci.ReasonEstimatingError; rdoContractorError.Checked = moPci.ReasonContractorError; rdoScheduleDelay.Checked = moPci.ReasonSchedule; rdoScopeAddition.Checked = moPci.ReasonScopeAdd; rdoScopeDeletion.Checked = moPci.ReasonScopeDel; rdoDesignChange.Checked = moPci.ReasonDesignChange; rdoOther.Checked = moPci.ReasonOther; txtOtherReason.Text = moPci.OtherReasonDesc; chkMechPiping.Checked = moPci.AffectedMechPipe; chkCSA.Checked = moPci.AffectedCSA; chkProjAdmin.Checked = moPci.AffectedProjAdmin; chkProcess.Checked = moPci.AffectedProcess; chkElectInst.Checked = moPci.AffectedEandI; txtEstimatedHrs.Text = moPci.EstimatedEngrHrs.ToString(); txtEstimatedCost.Text = moPci.EstimatedEngrDlrs.ToString("#,##0"); txtEstimatedTIC.Text = moPci.EstimatedEngrTIC.ToString("#,##0"); txtEstimatedAccuracy.Text = moPci.EstimatedAccuracy; txtScheduleImpact.Text = moPci.ScheduleImpact; chkAppvProceed.Checked = moPci.ApprovedProceed; chkAppvTrack.Checked = moPci.ApprovedTrack; chkNotAppvDNP.Checked = moPci.ApprovedNot; emp.Load(moPci.ProjectManagerID); txtProjMngr.Text = emp.Name; if (moPci.DateApproved == RevSol.RSUtility.DefaultDate()) { lblDateApproved.Text = ""; } else { lblDateApproved.Text = moPci.DateApproved.ToShortDateString(); } mbNewPCNNeeded = false; }
private void bttProcess_Click(object sender, EventArgs e) { string msg = "Export the selected budget " + (lvwBudgets.SelectedItems[0]).SubItems[1].Text; string projNumber = lvwProjects.SelectedItems[0].SubItems[1].Text; if (MessageBox.Show(msg, "Export", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { CBVisionExport ve = new CBVisionExport(); CBBudget bud = new CBBudget(); CBProject proj = new CBProject(); SqlDataReader dr; int budID; ListViewItem l = lvwBudgets.SelectedItems[0]; budID = Convert.ToInt32(l.Text); bud.Load(budID); proj.Load(bud.ProjectID); // prepare teh data tables lblStatus.Visible = true; UpdateStatus("Preparing data tables for export"); ve.ResetStagingTables(); UpdateStatus("Retrieving budget information"); dr = ve.GetBudgetLinesForStaging(budID); UpdateStatus("Loading budget info into staging table"); while (dr.Read()) { ve.InsertLineForStaging( bud.ID, proj.Number, Convert.ToInt32(dr["DeptGroup"]), Convert.ToInt32(dr["Task"]), Convert.ToInt32(dr["Category"]), Convert.ToInt32(dr["Activity"]), dr["WBS"].ToString(), dr["Description"].ToString(), Convert.ToInt32(dr["Quantity"]), Convert.ToInt32(dr["HoursEach"]), Convert.ToInt32(dr["TotalHours"]), Convert.ToDecimal(dr["LoadedRate"]), Convert.ToDecimal(dr["TotalDollars"]), 0, 0, dr["LineGUID"].ToString(), false, "", proj.DateStart, proj.DateEnd, dr["BudgetType"].ToString()); } dr.Close(); UpdateStatus("Loading plan information"); ve.InsertPlanInformation(budID); UpdateStatus("Loading WBS1 outline"); ve.InsertWBS1Outline(budID); UpdateStatus("Loading WBS2 outline"); // load wbs2 with outline numbers int outLvl = 1; int chldCnt = 0; string outlineNumber, deptName, deptNumber; dr = ve.GetWBS2Levels(); while (dr.Read()) { outlineNumber = "001." + outLvl.ToString("000"); deptName = dr["Description"].ToString(); deptNumber = dr["DeptGroup"].ToString(); chldCnt = Convert.ToInt32(dr["Cnt"]); ve.InsertWBS2Outline(budID, outlineNumber, deptName, deptNumber, "001", proj.DateStart, proj.DateEnd, chldCnt); outLvl++; } dr.Close(); UpdateStatus("Loading WBS3 outline"); // load wbs3 with outline numbers outLvl = 0; chldCnt = 0; string currLvl = ""; string activity = ""; int stageID; dr = ve.GetWBS3Levels(); while (dr.Read()) { if (dr["OutlineNumber"].ToString() != currLvl) { currLvl = dr["OutlineNumber"].ToString(); outLvl = 1; } stageID = Convert.ToInt32(dr["ID"]); outlineNumber = currLvl + "." + outLvl.ToString("000"); deptName = dr["Description"].ToString(); deptNumber = dr["DeptGroup"].ToString(); activity = dr["ACtivity"].ToString(); ve.InsertWBS3Outline(budID, outlineNumber, deptName, deptNumber, activity, currLvl, proj.DateStart, proj.DateEnd, chldCnt, stageID); outLvl++; } dr.Close(); UpdateStatus("Update staging with outline"); ve.UpdateStagingWithOutline(); if (CheckForExistingImport(projNumber) == true) { UpdateStatus("Processing as previous Export"); LoadAsPreviousExport(projNumber); } ve.RecordExportedBudgetLInes(); UpdateStatus("Finished Export"); MessageBox.Show("Finished building export tables"); this.Close(); } }
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); } }
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); }
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(); }
private void bttUpdate_Click(object sender, EventArgs e) { RevSol.RSConnection cnn; SqlCommand cmd; SqlParameter prm; int forecastID; int specGrp = 0; CBProject proj = new CBProject(); proj.Load(msCurrProj); cnn = new RevSol.RSConnection("CR"); cmd = new SqlCommand("spForecastUpdate_Insert", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ForecastID", SqlDbType.Int); prm.Direction = ParameterDirection.Output; prm = cmd.Parameters.Add("@Project", SqlDbType.VarChar, 50); prm.Value = msCurrProj; cmd.ExecuteNonQuery(); forecastID = Convert.ToInt32(cmd.Parameters["@ForecastID"].Value); specGrp = 0; if (proj.UseAllGroups() == true) { specGrp = 0; } string acct; decimal hrs, amnt; foreach (DataRow dr in mdsForecast.Tables["Forecast"].Rows) { acct = dr["AcctGroup"].ToString(); hrs = Convert.ToDecimal(dr["FTCHrs"]); amnt = Convert.ToDecimal(dr["FTCRate"]); cmd = new SqlCommand("spForecastToComplete_Insert2_Vision", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ForecastID", SqlDbType.Int); prm.Value = forecastID; prm = cmd.Parameters.Add("@AccountGroup", SqlDbType.VarChar, 50); prm.Value = acct.Replace("E", ""); prm = cmd.Parameters.Add("@ForecastHrs", SqlDbType.Money); prm.Value = hrs; prm = cmd.Parameters.Add("@ForecastRate", SqlDbType.Money); prm.Value = amnt; prm = cmd.Parameters.Add("@SpecialGroup", SqlDbType.Int); prm.Value = specGrp; cmd.ExecuteNonQuery(); } cnn.CloseConnection(); LoadCurrentGroups(); bttUpdate.Enabled = false; bttSetForecast.Enabled = false; LoadReportForProject(FCRMain.GetRprtCase(msCurrProj)); }