private IssueLogListingModel BuildIssueLogForEdit(IssueLog issueLog) { var model = new IssueLogListingModel { Id = issueLog.Id, CompanyId = issueLog.Project.Company.Id, CompanyName = issueLog.Project.Company.Name, ProjectId = issueLog.Project.Id, ProjectName = issueLog.Project.Name, IssueDate = issueLog.IssueDate, Header = issueLog.Header, Body = issueLog.Body, Note = issueLog.Note, EntryBy = issueLog.EntryBy, AssignBy = issueLog.AssignBy, AssignDate = issueLog.AssignDate, AssignRemarks = issueLog.AssignRemarks, IssueLogInvolvedPersons = BuildIssueLogInvolvedPerson(issueLog.IssueLogInvolvedPersons), Priority = issueLog.Priority, TaskHour = issueLog.TaskHour, IssueType = issueLog.IssueType, ApplicationUserListingModels = BuildApplicationUserList(), IsAllCompletedExceptOwn = issueLog.IssueLogInvolvedPersons.Where(y => y.InvolvedPerson.Id != _userManager.GetUserId(User) && y.IsComplete).ToList().Count == (issueLog.IssueLogInvolvedPersons.Count() - 1) }; return(model); }
public IActionResult Create() { var projects = BuildProjectList(); var companies = BuildCompanyList(); var model = new IssueLogListingModel { Projects = projects, Companies = companies, IssueDate = null, Priority = null, IssueType = null, ApplicationUserListingModels = BuildApplicationUserList() }; return(View(model)); }