예제 #1
0
        // GET: Calendar
        public ActionResult Index(string showName)
        {
            using (EscapeRoomDBEntities entities = new EscapeRoomDBEntities())
            {
                CalendarSearchModel model = new CalendarSearchModel
                {
                    game  = HttpUtility.UrlDecode(showName),
                    games = entities.Games.Select(x => x.Title).ToArray()
                };

                return(View(model));
            }
        }
예제 #2
0
        private CalendarSearchModel GetCalendarTaskModel(UserPersonTaskDto userPersonTask = null)
        {
            var model = new UserSearchModel {
                PageSize = int.MaxValue
            };

            model = _employeeFacadeApiClient.GetUsers(model).Result;
            //var personSearch = new PersonSearchModel { PageSize = int.MaxValue };
            //personSearch = _personApiClient.GetPersons(personSearch).Result;
            var taskTypeSearchmodel = new TaskTypeSearchModel {
                PageSize = int.MaxValue
            };

            taskTypeSearchmodel = _taskTypeApiClient.GetTaskTypes(taskTypeSearchmodel).Result;
            var selectedTaskTypeId = taskTypeSearchmodel.TaskTypeSearchResult.FirstOrDefault(x => x.Name == userPersonTask?.TaskTypeSelected)?.Id;
            var taskTypes          = taskTypeSearchmodel.TaskTypeSearchResult?.ConvertAll(x => (BaseLookupDto)x);

            var applications = new WebApplicationSearchModel {
                PageSize = int.MaxValue
            };

            applications = _employeeFacadeApiClient.GetWebApplications(applications).Result;



            var userCalendarModel = new CalendarSearchModel
            {
                ApplicationList = SelectedListHelper.GetApplicationSelectList(applications.WebApplicationSearchResult, userPersonTask?.ApplicationId.ToString()),
                EmployeeList    = SelectedListHelper.GetUserSelectList(model.UserSearchResult, userPersonTask?.UserId.ToString()),
                TaskTypes       = taskTypeSearchmodel.TaskTypeSearchResult,
                TaskTypeList    = SelectedListHelper.GetSelectListForItems(taskTypes, selectedTaskTypeId?.ToString()),
                TaskTypeId      = selectedTaskTypeId,
                //PersonList = SelectedListHelper.GetPersonSelectList(personSearch.PersonSearchResult, userPersonTask?.PersonId.ToString())
            };

            return(userCalendarModel);
        }