public TaskFormViewModel(Task task , Sprint sprint , User user, Code code, Story story) { TimeforingRepository repo = new TimeforingRepository(); Task = task; Sprint = SelectListMaker.SprintsWithSelected(Task); User = SelectListMaker.UsersWithSelected(Task); Code = SelectListMaker.CodesWithSelected(Task); Story = SelectListMaker.StoriesWithSelected(Task); }
public static List<SelectListItem> UsersWithSelected(User u) { var items = _repo.FindAllUsers(); List<SelectListItem> list = new List<SelectListItem>(); foreach (var item in items) { SelectListItem i; i = new SelectListItem { Value = item.UserID.ToString(), Text = item.Name, Selected = u.UserID == item.UserID }; list.Add(i); } return list; }
partial void UpdateUser(User instance);
partial void DeleteUser(User instance);
partial void InsertUser(User instance);