public async Task <ActionResult> EditProcedure(ProcedureEditModel model) { if (!ModelState.IsValid) { ViewBag.Error = CreateError(); return(View("Error")); } try { var procedureDto = Mapper.Map <ProcedureEditModel, ProcedureDTO>(model); await SenEmailAboutUpdateProcedure(model); _procedureService.Update(procedureDto); _procedureService.Commit(); _currentUser = GetCurrentUser(); TempData["Success"] = Resources.Messages.ProcedureUpdatedSuccess; Logger.Log.Info($"{_currentUser.Email} Edited Procedure #{model.Id} for Product #{model.ProductId} "); return(RedirectToAction("ProductProcedures", new { id = model.ProductId })); } catch (Exception ex) { @ViewBag.Error = ex.ToString(); return(View("Error")); } }
public void Update() { if (mLevelLoaded) { if (mLoading) { mCurrentProduce.onEnter(); mLoading = false; } mLevelLoaded = false; } else if (mCurrentProduce != null) { mCurrentProduce.Update(); } }
public async Task <int> Update(ProcedureModel procedure) { var procedureEntity = _mapper.Map <Procedure>(procedure); return(await _procedureRepository.Update(procedureEntity)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(MesWeb.Model.Procedure model) { return(dal.Update(model)); }