コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }
コード例 #3
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);
        }
コード例 #4
0
        private void LoadProjects()
        {
            SqlDataReader dr;

            RSLib.COListItem li;

            //SSS 20131105 dr = CBProject.GetList();
            dr = CBProject.GetListProj();

            clstProjects.Items.Clear();

            li             = new RSLib.COListItem();
            li.ID          = 0;
            li.Description = "All";
            clstProjects.Items.Add(li);

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

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

                clstProjects.Items.Add(li);
            }

            clstProjects.SetItemChecked(0, true);

            dr.Close();
        }
コード例 #5
0
        private void LoadMasterBox()
        {
            SqlDataReader dr;

            RSLib.COListItem li;

            dr = CBProject.GetListMaster();

            cboMasterJobs.Items.Clear();

            li             = new RSLib.COListItem();
            li.ID          = 0;
            li.Description = "";
            cboMasterJobs.Items.Add(li);

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

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

                cboMasterJobs.Items.Add(li);
            }

            dr.Close();
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        private void LoadProjects()
        {
            SqlDataReader dr;
            ListViewItem  lvi;

            this.Cursor = Cursors.WaitCursor;

            //SSS 20131105 dr = CBProject.GetList();
            dr = CBProject.GetListProj();
            lvwProjects.Items.Clear();

            while (dr.Read())
            {
                lvi = new ListViewItem();

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

                lvwProjects.Items.Add(lvi);
            }

            dr.Close();
            dr = null;

            this.Cursor = Cursors.Default;
        }
コード例 #9
0
        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;
        }
コード例 #10
0
        private void LoadItemList()
        {
            SqlDataReader dr;
            ListViewItem  lvi;

            this.Cursor = Cursors.WaitCursor;

            //SSS 20131105 dr = CBProject.GetList();
            dr = CBProject.GetListProj();
            lvwItems.Items.Clear();
            while (dr.Read())
            {
                lvi = new ListViewItem();

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

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

            dr.Close();
            dr = null;

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

            this.Cursor = Cursors.Default;
        }
コード例 #11
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();
        }
コード例 #12
0
        private void FCopyBudget_Load(object sender, EventArgs e)
        {
            RevSol.RSListItem li;
            RevSol.RSListItem liTarg;

            cboProjects.Items.Clear();
            lstBudgets.Items.Clear();
            cboTargetProj.Items.Clear();
            txtRevision.Text = "";

            //SSS 20131105 SqlDataReader dr = CBProject.GetList();
            SqlDataReader dr = CBProject.GetList();

            while (dr.Read())
            {
                li     = new RevSol.RSListItem();
                liTarg = new RevSol.RSListItem();

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

                cboProjects.Items.Add(li);
                cboTargetProj.Items.Add(liTarg);
            }

            dr.Close();
        }
コード例 #13
0
        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();
        }
コード例 #14
0
        void ProjectSelected(int itmID)
        {
            CBProject p = new CBProject();

            p.Load(itmID);

            txtProject.Text = p.Number + " - " + p.Description;
            txtProject.Tag  = itmID;
            mProjectID      = itmID;
        }
コード例 #15
0
        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);
        }
コード例 #16
0
        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;
        }
コード例 #17
0
        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);
        }
コード例 #18
0
        void ProjectSelected(int itmID)
        {
            CBProject p = new CBProject();

            miCurrProj = itmID;
            p.Load(itmID);

            txtProject.Tag  = itmID;
            txtProject.Text = p.Number;

            EnableSave();
        }
コード例 #19
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();
        }
コード例 #20
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);
        }
コード例 #21
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;
            }
        }
コード例 #22
0
        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();
        }
コード例 #23
0
        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();
        }
コード例 #24
0
        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();
        }
コード例 #25
0
        private void ClearForm()
        {
            moProj = new CBProject();

            txtNumber.Text         = "";
            txtDescription.Text    = "";
            cboCustomer.Text       = "";
            txtCustomerNumber.Text = "";
            cboManager.Text        = "";
            cboManagerLead.Text    = "";
            lblMultiplier.Visible  = false;
            txtMultiplier.Visible  = false;
            txtMultiplier.Text     = "1.85";
            lblOverlay.Visible     = false;
            txtOverlay.Visible     = false;
            txtOverlay.Text        = "6.00";
            txtPOAmount.Text       = "";

            dtpStart.Value            = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            dtpEnd.Value              = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            chkActiveProposal.Checked = false;
            chkIsBooked.Checked       = false;
            chkIsActive.Checked       = false;
            chkIsMaster.Checked       = false;
            cboMasterJobs.Text        = "";

            rtbNotes.Text = "";

            LoadCustomerBox();
            LoadManagerBox();
            LoadRelationshipBox();
            LoadRateSchedBox();
            LoadMasterBox();
            LoadReportStatusBox();

            CreateBudgetDS();

            TotalBudget();
        }
コード例 #26
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);
        }
コード例 #27
0
        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();
        }
コード例 #28
0
        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();
            }
        }
コード例 #29
0
        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;
        }
コード例 #30
0
        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;
        }