Esempio n. 1
0
        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"));
        }
Esempio n. 2
0
        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);
            }
        }