public ActionResult FollowUpStatusCreate(FollowUpStatusCreate model) { if (!ModelState.IsValid) { return(View(model)); } var userId = Guid.Parse(User.Identity.GetUserId()); var service = new FollowUpStatusService(userId); service.CreateFollowUpStatus(model); return(RedirectToAction("FollowUpStatusIndex")); }
public bool CreateFollowUpStatus(FollowUpStatusCreate model) { var entity = new FollowUpStatusType() { OwnerId = _userId, Status = model.Status, Description = model.Description, }; using (var ctx = new ApplicationDbContext()) { ctx.FollowUpStatusTypes.Add(entity); return(ctx.SaveChanges() == 1); } }