public async Task <ActionResult <ApiResult> > Add(ActionInfo action) { await _ActionService.Add(action); ApiResult resp = new ApiResult(); resp.code = 0; return(resp); }
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()); }