public async Task <ActionResult> Save(WorkOrderDecayViewModel model) { using (WorkOrderDecayServiceClient client = new WorkOrderDecayServiceClient()) { WorkOrderDecay obj = new WorkOrderDecay() { Key = new WorkOrderDecayKey() { MaterialCode = model.MaterialCode, OrderNumber = model.OrderNumber, MaxPower = model.MaxPower.Value, MinPower = model.MinPower.Value }, DecayCode = model.DecayCode, IsUsed = model.IsUsed, Editor = User.Identity.Name, EditTime = DateTime.Now, CreateTime = DateTime.Now, Creator = User.Identity.Name }; MethodReturnResult rst = await client.AddAsync(obj); if (rst.Code == 0) { rst.Message = string.Format(ZPVMResources.StringResource.WorkOrderDecay_Save_Success , obj.Key); } return(Json(rst)); } }