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(); }
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); }
private void bttOK_Click(object sender, EventArgs e) { if (txtCity.Text.Length > 0 && cboState.Text.Length > 0) { moLoc.City = txtCity.Text; moLoc.StateID = ((RSLib.COListItem)cboState.SelectedItem).ID; if (mbFreeEdit == true) { moLoc.Save(); string tmpLoc = moLoc.City + ", " + CBState.GetAbbrev(moLoc.StateID); if (OnChangeLocation != null) { OnChangeLocation(moLoc.ID, ""); } } else { string tmpLoc = moLoc.City + ", " + CBState.GetAbbrev(moLoc.StateID); if (OnChangeLocation != null) { OnChangeLocation(moLoc.StateID, moLoc.City); } } this.Close(); } }
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(); }
void floc_OnAddLocation(int itmID, string description) { RSLib.COListItem li = new RSLib.COListItem(); li.ID = 0; li.Description = description + ", " + CBState.GetAbbrev(itmID); li.Meta = itmID.ToString(); li.Meta1 = description; lstLocations.Items.Add(li); mbItemChanged = true; SetSaveButtons(); }
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); }
void floc_OnChangeLocation(int itmID, string description) { RSLib.COListItem li = new RSLib.COListItem(); li.ID = ((RSLib.COListItem)lstLocations.SelectedItem).ID; li.Description = description + ", " + CBState.GetAbbrev(itmID); li.Meta = itmID.ToString(); li.Meta1 = description; //lstLocations.Items[lstLocations.SelectedIndex] = description + ", " + CBState.GetAbbrev(itmID); lstLocations.Items[lstLocations.SelectedIndex] = li; //((RSLib.COListItem)lstLocations.SelectedItem).Description = description + ", " + CBState.GetAbbrev(itmID); //((RSLib.COListItem)lstLocations.SelectedItem).Meta = itmID.ToString(); //((RSLib.COListItem)lstLocations.SelectedItem).Meta1 = description; mbItemChanged = true; SetSaveButtons(); }
private void LoadStatesBox() { SqlDataReader dr; RSLib.COListItem li; dr = CBState.GetList(); cboState.Items.Clear(); while (dr.Read()) { li = new RSLib.COListItem(); li.ID = Convert.ToInt32(dr["ID"]); li.Description = dr["Name"].ToString(); li.Meta = dr["Abbrev"].ToString(); cboState.Items.Add(li); } dr.Close(); }
private void ClearForm(int custID, int locID) { LoadStatesBox(); moLoc = new CBLocation(); if (locID == 0) { moLoc.CustomerID = custID; txtCity.Text = ""; cboState.Text = ""; } else { CBState st = new CBState(); moLoc.Load(locID); st.Load(moLoc.StateID); txtCity.Text = moLoc.City; cboState.Text = st.Name; } }
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 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 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); } }