public async Task <ApiResult> SaveMMoudleItemValue(MaintenanceModuleItemValueParm parm) { ApiResult ret = new ApiResult(); int retData = 0; int listID = parm.MaintenanceModuleItemValues[0].List; try { using (TransactionScope scope = new TransactionScope()) { retData = await _repo.DelMMoudleItemValue(listID); retData = await _repo.SaveMMoudleItemValue(parm.MaintenanceModuleItemValues); int status = (int)PMStatus.Editing; if (parm.IsFinished) { status = (int)PMStatus.Finished; } retData = await _repo.UpdateMList(status, _userID, listID); scope.Complete(); } ret.data = retData; } catch (Exception ex) { ret.code = Code.Failure; ret.msg = ex.Message; } return(ret); }
public ActionResult SaveMMoudleItemValue(MaintenanceModuleItemValueParm parm) { var ret = _service.SaveMMoudleItemValue(parm); return(Ok(ret.Result)); }