public ViewResult Create() { var taskViewModel = new TaskViewModel(); taskViewModel.Statuses = statuses.GetStatuses().Select(s => new SelectListItem() { Value = s.StatusId.ToString(), Text = s.Name }); taskViewModel.Locations = locations.GetLocations().Select(l => new SelectListItem() { Value = l.LocationId.ToString(), Text = l.Description }); taskViewModel.Users = identity.GetAspNetUsers().Select(u => new SelectListItem() { Value = u.Id, Text = u.UserName }); return(View(taskViewModel)); }
public double GetSelfExtinguishChance() { var result = SelfExtinguishChance; var burningRelatesStatuses = Statuses.GetStatuses <IBurningRelatedStatus>(); foreach (var burningRelatesStatus in burningRelatesStatuses) { result += burningRelatesStatus.SelfExtinguishChanceModifier; } return(result); }
public ViewResult List(int page = 1) { var statusesListViewModel = new StatusesListViewModel(); statusesListViewModel.Statuses = statuses.GetStatuses(page, PageSize); statusesListViewModel.PagingInfo = new PagingInfo { CurrentPage = page, ItemsPerPage = PageSize, TotalItems = statuses.GetStatusesCount() }; return(View(statusesListViewModel)); }