/// <summary>
 /// Creates an instance of the DepartmentMeasurementPerformanceWidget
 /// </summary>
 /// <param name="repository">Existing DashboardRepository to fetch data</param>
 public DepartmentMeasurementPerformanceWidget(DashboardRepository repository)
 {
     this.repo = repository;
     this.currentMonth = DateTime.UtcNow.Month;
     this.currentYear = DateTime.UtcNow.Year;
     this.CurrentPerformanceLevel = "Meets";
 }
        /// <summary>
        /// Creates an instance of the SingleMeasurementChartWidget
        /// </summary>
        /// <param name="repository"></param>
        public SingleMeasurementChartWidget(DashboardRepository repository)
        {
            this.repo = repository;

            //get default measurement
            this.Measurement = repo.Departments[0].Measurements[0];
        }
        /// <summary>
        /// Creates an instance of the SingleMeasurementValueWidget
        /// </summary>
        /// <param name="repository"></param>
        public SingleMeasurementValueWidget(DashboardRepository repository)
        {
            this.repo = repository;
            this.currentMonth = DateTime.UtcNow.Month;
            this.currentYear = DateTime.UtcNow.Year;

            //get default measurement
            this.Measurement = repo.Departments[0].Measurements[0];
        }
 /// <summary>
 /// Gets all departments
 /// </summary>
 /// <returns>List of all departments</returns>
 public static List<string> GetDepartments(DashboardRepository repo)
 {
     //repo.RefreshDepartments();
     var depts = new List<string>();
     foreach (var dept in repo.Departments)
     {
         depts.Add(dept.ViewModel.DepartmentName);
     }
     return depts;
 }
        /// <summary>
        /// Gets all measurements in all departments
        /// </summary>
        /// <returns>List of all measurements in all departments</returns>
        public static List<string> GetMeasurements(DashboardRepository repo)
        {
            var measurements = new List<string>();
            foreach (var dept in repo.Departments)
            {
                foreach (var meas in dept.Measurements)
                {
                    measurements.Add(measurementToString(meas));
                }
            }

            return measurements;
        }
Ejemplo n.º 6
0
        public DashboardController(Repository r, IMonthlySubmissionRepository m)
        {
            _monthly_submission_repo = m;
            _repository = r;

            dRepo = new DashboardRepository(r);

            if (DOWidget == null)
            {
                DOWidget = new DepartmentalOverviewWidget(dRepo);
            }

            if (MLSWidget == null)
            {
                MLSWidget = new MultiLevelScoreWidget(dRepo);
            }

            if (SMCWidget == null)
            {
                SMCWidget = new SingleMeasurementChartWidget(dRepo);
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates new instance of MultiLevelScoreWidget
 /// </summary>
 /// <param name="repository">Existing DashboardRepository to fetch data</param>
 public MultiLevelScoreWidget(DashboardRepository repository)
 {
     this.repo = repository;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a new instance of the DDepartment class
 /// </summary>
 /// <param name="parent">DashboardRepository hosting this DDepartment</param>
 /// <param name="model">Model providing data for this DDepartment</param>
 public DDepartment(DashboardRepository parent, Department model)
 {
     this.Parent = parent;
     this.db = parent.db;
     this.Model = model;
     this.ViewModel = new DepartmentViewModel();
     ViewModel.DepartmentId = model.Department_ID;
     ViewModel.DepartmentName = model.NM;
     ViewModel.AdGroupId = model.ADGroup_ID;
 }
 /// <summary>
 /// Creates an instance of the DepartmentalOverviewWidget
 /// </summary>
 /// <param name="repository">Existing DashboardRepository to fetch data</param>
 public DepartmentalOverviewWidget(DashboardRepository repository)
 {
     this.repo = repository;
     this.ChangeDepartment("Department");
 }