Ejemplo n.º 1
0
        public bool AdminActionCreate(AdminActionCreate model)
        {
            var entity =
                new AdminAction()
            {
                OrderType      = model.OrderType,
                InvestigatorID = model.InvestigatorID,
                AgentID        = model.AgentID,
                InsurerID      = model.InsurerID
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.AdminActions.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Ejemplo n.º 2
0
        public ActionResult AdminActionCreate(AdminActionCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = new AdminActionService();

            if (service.AdminActionCreate(model))
            {
                TempData["SaveResult"] = "The AdminAction was created.";
                return(RedirectToAction("Index"));
            }
            ;

            ModelState.AddModelError("", "The AdminAction could not be created.");
            return(View(model));
        }