// // GET: /FMM/ReasonCode/Detail public async Task <ActionResult> Detail(string key) { using (EquipmentReasonCodeServiceClient client = new EquipmentReasonCodeServiceClient()) { MethodReturnResult <EquipmentReasonCode> result = await client.GetAsync(key); if (result.Code == 0) { EquipmentReasonCodeViewModel viewModel = new EquipmentReasonCodeViewModel() { Name = result.Data.Key, Type = result.Data.Type, Class = result.Data.Class, CreateTime = result.Data.CreateTime, Creator = result.Data.Creator, Description = result.Data.Description, Editor = result.Data.Editor, EditTime = result.Data.EditTime }; return(PartialView("_InfoPartial", viewModel)); } else { ModelState.AddModelError("", result.Message); } } return(PartialView("_InfoPartial")); }
public async Task <ActionResult> SaveModify(EquipmentReasonCodeViewModel model) { using (EquipmentReasonCodeServiceClient client = new EquipmentReasonCodeServiceClient()) { MethodReturnResult <EquipmentReasonCode> result = await client.GetAsync(model.Name); if (result.Code == 0) { result.Data.Class = model.Class; result.Data.Type = model.Type; result.Data.Description = model.Description; result.Data.Editor = User.Identity.Name; result.Data.EditTime = DateTime.Now; MethodReturnResult rst = await client.ModifyAsync(result.Data); if (rst.Code == 0) { rst.Message = string.Format(FMMResources.StringResource.ReasonCode_SaveModify_Success , model.Name); } return(Json(rst)); } return(Json(result)); } }