コード例 #1
0
        private bool CheckForExistingImport(string projNumber)
        {
            DataSet ds;
            int     rwCnt = 0;
            bool    retVal;

            try
            {
                ds    = CBProjectBudget.GetExistingVisionPlan(projNumber);
                rwCnt = ds.Tables[0].Rows.Count;

                if (rwCnt > 0)
                {
                    retVal = true;
                }
                else
                {
                    retVal = false;
                }
            }
            catch
            {
                retVal = false;
            }

            return(retVal);
        }
コード例 #2
0
        private void SaveBudgets(int projID)
        {
            CBProjectBudget pb;

            foreach (DataRow d in mdsBudget.Tables[0].Rows)
            {
                pb = new CBProjectBudget();

                pb.ID           = Convert.ToInt32(d["ID"]);
                pb.ProjectID    = projID;
                pb.DepartmentID = Convert.ToInt32(d["DepartmentID"]);
                pb.BudgetHrs    = Convert.ToDecimal(d["BudgetHrs"]);

                pb.Save();
            }
        }
コード例 #3
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);
        }
コード例 #4
0
        private void CreateBudgetDS()
        {
            mdsBudget = CBProjectBudget.GetListDSByProjID(0);

            tdbgBudget.SetDataBinding(mdsBudget, "Table", true);
        }
コード例 #5
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;
            }
        }
コード例 #6
0
        public void ClearForm()
        {
            moPCN = new CBBudgetPCN();
            moPCN.Clear();

            txtInitiatedBy.Text               = "";
            lblProjectNumber.Text             = "";
            lblProjectTitle.Text              = "";
            txtPCNTitle.Text                  = "";
            dtpDateInitiated.Value            = DateTime.Now;
            txtRequestedBy.Text               = "";
            dtpDateRequested.Value            = DateTime.Now;
            txtDescription.Text               = "";
            chkDesignError.Checked            = false;
            chkVendorError.Checked            = false;
            chkEstimatingError.Checked        = false;
            chkContractorError.Checked        = false;
            chkScheduleDelay.Checked          = false;
            chkScopeAdd.Checked               = false;
            chkScopeDel.Checked               = false;
            chkDesignChange.Checked           = false;
            chkOther.Checked                  = false;
            txtOtherReason.Text               = "";
            txtOtherReason.Enabled            = false;
            txtEstimatedHrs.Text              = "";
            txtEstimatedDollars.Text          = "";
            txtEstimTIC.Text                  = "";
            txtEstimateAccuracy.Text          = "";
            txtScheduleImpact.Text            = "";
            chkApproved.Checked               = false;
            chkDisapproved.Checked            = false;
            chkPrepareControlEstimate.Checked = false;
            txtProjMngr.Text                  = "";
            lblDateApproved.Text              = "";
            txtPCNNumber.Text                 = "";

            tdbgHours.SetDataBinding(moPCN.PCNData, "PCNHours", true);
            tdbgExpenses.SetDataBinding(moPCN.PCNData, "PCNExpenses", true);

            SqlDataReader dr = CBActivityCode.GetListForBudget();
            DataRow       d;

            mdsAccnts      = new dsAccts();
            mdsExpensAccts = new dsAccts();
            mdsDeptGroup   = new dsAccts();
            while (dr.Read())
            {
                d                = mdsAccnts.Tables["Accounts"].NewRow();
                d["Code"]        = dr["Code"];
                d["Description"] = dr["Description"];
                mdsAccnts.Tables["Accounts"].Rows.Add(d);
            }

            dr.Close();

            tdbdActivities.SetDataBinding(mdsAccnts, "Accounts", true);

            dr = CBProjectBudget.GetExpenseGroupByDiscipline(0);

            while (dr.Read())
            {
                d                = mdsExpensAccts.Tables["Accounts"].NewRow();
                d["Code"]        = dr["Code"];
                d["Description"] = dr["Description"];
                d["DefaultMU"]   = dr["DefaultMU"];

                mdsExpensAccts.Tables["Accounts"].Rows.Add(d);
            }
            dr.Close();
            tdbdExpenseAccts.SetDataBinding(mdsExpensAccts, "Accounts", true);


            dr = CBActivityCode.GetDeptGroup();

            while (dr.Read())
            {
                d                = mdsDeptGroup.Tables["Accounts"].NewRow();
                d["Code"]        = dr["Code"];
                d["Description"] = dr["Description"];
                //d["DefaultMU"] = dr["DefaultMU"];

                mdsDeptGroup.Tables["Accounts"].Rows.Add(d);
            }
            dr.Close();
            tdbdDeptGroup.SetDataBinding(mdsDeptGroup, "Accounts", true);
        }