public ActionResult Add(AddDefectModel model) { if (!ModelState.IsValid) { return(PartialView(model)); } var service = CurrentAccountDbContext.GetDefectService(); var createUser = GetUserById(CurrentUser.Id); var responsibleUser = GetUserById(model.ResponsibleUserId.Value); service.CreateDefect(CurrentUser.AccountId, model.Title, createUser, responsibleUser, model.Notes); CurrentAccountDbContext.SaveChanges(); return(GetSuccessJsonResponse()); }
public ActionResult Add() { var model = new AddDefectModel(); return(PartialView(model)); }