Beispiel #1
0
        private void SetGridByDateRange(DateTime sDate, DateTime eDate, bool selDept, bool selProj)
        {
            int numWeeks;
            int numWeekCols;

            mdsWeeks = CBWeekList.GetList(sDate, eDate);

            // initialize
            fgSchedule.Styles.Normal.WordWrap = true;
            //numWeeks = RSLib.COUtility.NumberWeeksInRange(sDate, eDate);
            numWeeks    = mdsWeeks.Tables[0].Rows.Count;
            numWeekCols = numWeeks * 3;

            fgSchedule.Cols.Count   = WEEKCOLSTART + numWeekCols + TOTALCOLS;
            fgSchedule.Rows.Fixed   = 2;
            fgSchedule.AllowMerging = AllowMergingEnum.FixedOnly;

            // create row headers
            fgSchedule.Rows[0].AllowMerging = true;

            fgSchedule.Cols[1].Width = 100;
            fgSchedule.Cols[2].Width = 100;
            fgSchedule.Cols[3].Width = 100;

            CreateWeekHeaders();

            fgSchedule.Cols[0].AllowMerging   = true;
            fgSchedule.Styles.Fixed.TextAlign = TextAlignEnum.CenterCenter;
            fgSchedule.AutoSizeCols(6, fgSchedule.Cols.Count - 1, 15);

            LoadGridByRange(0, sDate, eDate, selDept, selProj);
        }
Beispiel #2
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);
        }