Ejemplo n.º 1
0
 public async static Task <SearchViewModel> Create(
     IScheduleSevice services,
     IMapper mapper)
 {
     return(new SearchViewModel()
     {
         // Giving some start values for the SearchModel dates.
         To = DateTime.Now,
         From = DateTime.Now.AddDays(-7),
         ProjectOptions = await services.GetShdeduleProjectOptions(),
         ScheduleOptions = services.GetScheduleOptions(),
         EmployeeOptions = await services.GetShdeduleEmployeeOptions(),
         Employees = new HashSet <EmployeeViewModel>()
     });
 }
Ejemplo n.º 2
0
        public async static Task <SearchViewModel> ReBuild(
            SearchViewModel model,
            IScheduleSevice services,
            IMapper mapper)
        {
            model.To             = DateTime.Now;
            model.From           = model.To.AddDays(-7);
            model.ProjectOptions = await services.GetShdeduleProjectOptions();

            model.ScheduleOptions = services.GetScheduleOptions();
            model.EmployeeOptions = await services.GetShdeduleEmployeeOptions();

            model.Employees = new HashSet <EmployeeViewModel>();

            return(model);
        }
Ejemplo n.º 3
0
 public async static Task <SearchViewModel> Create(
     IScheduleSevice services,
     IMapper mapper,
     IEnumerable <EmployeeViewModel> employees)
 {
     return(new SearchViewModel()
     {
         // Giving some start values for the SearchModel dates.
         To = DateTime.Now,
         From = DateTime.Now.AddDays(-7),
         ProjectOptions = await services.GetShdeduleProjectOptions(),
         ScheduleOptions = services.GetScheduleOptions(),
         EmployeeOptions = await services.GetShdeduleEmployeeOptions(),
         Employees = employees.Where(e => e.Schedules != null && e.Schedules.Count() > 0)
     });
 }