// // GET: /ZPVM/SupplierToManufacturer/Detail public async Task <ActionResult> Detail(string materialCode, string orderNumber, string supplierCode) { using (SupplierToManufacturerServiceClient client = new SupplierToManufacturerServiceClient()) { SupplierToManufacturerKey key = new SupplierToManufacturerKey() { MaterialCode = materialCode, OrderNumber = orderNumber, SupplierCode = supplierCode }; MethodReturnResult <SupplierToManufacturer> result = await client.GetAsync(key); if (result.Code == 0) { SupplierToManufacturerViewModel viewModel = new SupplierToManufacturerViewModel() { MaterialCode = result.Data.Key.MaterialCode, OrderNumber = result.Data.Key.OrderNumber, SupplierCode = result.Data.Key.SupplierCode, ManufacturerCode = result.Data.ManufacturerCode, Creator = result.Data.Creator, CreateTime = result.Data.CreateTime, 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(SupplierToManufacturerViewModel model) { DateTime now = DateTime.Now; using (SupplierToManufacturerServiceClient client = new SupplierToManufacturerServiceClient()) { SupplierToManufacturerKey key = new SupplierToManufacturerKey() { MaterialCode = model.MaterialCode.ToString().Trim().ToUpper(), OrderNumber = model.OrderNumber.ToString().Trim().ToUpper(), SupplierCode = model.SupplierCode.ToString().Trim().ToUpper() }; MethodReturnResult <SupplierToManufacturer> result = await client.GetAsync(key); if (result.Code == 0) { result.Data.ManufacturerCode = model.ManufacturerCode; result.Data.EditTime = now; result.Data.Editor = User.Identity.Name; MethodReturnResult rst = await client.ModifyAsync(result.Data); if (rst.Code == 0) { rst.Message = string.Format("供应商转换生产厂商规则修改成功!"); } return(Json(rst)); } return(Json(result)); } }
public async Task <ActionResult> Delete(string materialCode, string orderNumber, string supplierCode) { MethodReturnResult result = new MethodReturnResult(); SupplierToManufacturerKey key = new SupplierToManufacturerKey() { MaterialCode = materialCode, OrderNumber = orderNumber, SupplierCode = supplierCode }; using (SupplierToManufacturerServiceClient client = new SupplierToManufacturerServiceClient()) { result = await client.DeleteAsync(key); if (result.Code == 0) { result.Message = string.Format("删除{0}成功", key); } return(Json(result)); } }