Exemplo n.º 1
0
 public ConsultantDashboard()
 {
     // populate some dummy data test test
     this.dates = new TimeSlipDates(System.DateTime.Parse("5/14/2017"));
     this.vacation_days_available = 15;
     this.vacation_days_remaining = 13;
     this.hours_this_week         = 38;
     this.hours_last_week         = 41;
     this.hours_mtd        = 63;
     this.hours_last_month = 161;
 }
Exemplo n.º 2
0
        // Constructors
        public ConsultantDashboard(int consultant_id)
        {
            this.dates = new TimeSlipDates(System.DateTime.Now);

            meradia_db db = new meradia_db();

            // get vacation days available for the current year
            this.vacation_days_available = (
                db.consultants.Where(c => c.ID == consultant_id).
                Select(c => c.vacation_available).First()) ?? 0M;

            this.vacation_days_remaining = CalcVacationDaysRemaining(consultant_id, db);
            this.hours_this_week         = SumHours(db, consultant_id, dates.this_week_start_dt, dates.this_week_end_dt);
            this.hours_last_week         = SumHours(db, consultant_id, dates.last_week_start_dt, dates.last_week_end_dt);
            this.hours_mtd        = SumHours(db, consultant_id, dates.mtd_start_dt, dates.mtd_end_dt);
            this.hours_last_month = SumHours(db, consultant_id, dates.last_month_start_dt, dates.last_month_end_dt);
        }