Пример #1
0
        public async Task <ActionResult <ApiResult> > Add(ActionInfo action)
        {
            await _ActionService.Add(action);

            ApiResult resp = new ApiResult();

            resp.code = 0;
            return(resp);
        }
Пример #2
0
 public ActionResult Create(ActionVm actionVm)
 {
     if (ModelState.IsValid)
     {
         var newAction = new Model.Models.Action();
         newAction.UpdateAction(actionVm);
         newAction.CreatedDate = DateTime.Now;
         newAction.CreatedBy   = 1;
         _actionService.Add(newAction);
         _actionService.Save();
         TempData["MessageSuccess"] = Message.CreateSuccess;
         return(RedirectToAction("Index"));
     }
     TempData["MessageError"] = Message.CreateError;
     ViewBag.ParentId         = new SelectList(_actionService.GetAll(), "Id", "Name");
     return(View());
 }