public IIssue CreateIssue(string title, string description) { var issue = new BaseIssue { Title = title, Description = description }; return(issue); }
public static BaseIssueViewModel ToViewModel(this BaseIssue i) => new BaseIssueViewModel { Id = i.Id, User = i.User, IssueTS = i.IssueTS, IssueTypeId = i.IssueTypeId, CategoryId = i.CategoryId, LongDescr = i.LongDescr, IssueStatusId = i.IssueStatusId, SolveTS = i.SolveTS, SolveDescr = i.SolveDescr, SolveUser = i.SolveUser };
public IActionResult Edit(BaseIssue baseIssue) { if (baseIssue is null) { throw new System.ArgumentNullException(nameof(baseIssue)); } //ПШ Делаем проверку модели, если не соответствует отправляем пользователю обратно if (!ModelState.IsValid) { return(View(baseIssue)); } //var id = baseIssue.Id; //ПШ если Id нулевой, то это новый сотрудник и мы его добавляем, иначе редактируем //if (id != 0) _BaseIssuesData.CreateBaseIssueAsync(baseIssue); return(RedirectToAction("Index")); }
public async Task <BaseIssue> CreateBaseIssueAsync(BaseIssue baseIssue) { return(new BaseIssue()); }