/// <summary> /// 显示明细 /// </summary> /// <param name="MaterialCode"></param> /// <param name="labelCode"></param> /// <returns></returns> public async Task <ActionResult> Detail(string MaterialCode, string labelCode) { using (MaterialPrintSetServiceClient client = new MaterialPrintSetServiceClient()) { MaterialPrintSetKey key = new MaterialPrintSetKey() { MaterialCode = MaterialCode, LabelCode = labelCode }; MethodReturnResult <MaterialPrintSet> result = await client.GetAsync(key); if (result.Code == 0) { MaterialPrintSetViewModel viewModel = new MaterialPrintSetViewModel() { MaterialCode = result.Data.Key.MaterialCode, LabelCode = result.Data.Key.LabelCode, Qty = result.Data.Qty, CreateTime = result.Data.CreateTime, Creator = result.Data.Creator, 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(MaterialPrintSetViewModel model) { using (MaterialPrintSetServiceClient client = new MaterialPrintSetServiceClient()) { MaterialPrintSet obj = new MaterialPrintSet() { Key = new MaterialPrintSetKey() { MaterialCode = model.MaterialCode, LabelCode = model.LabelCode }, Qty = model.Qty, CreateTime = model.CreateTime, Creator = model.Creator, EditTime = DateTime.Now, Editor = User.Identity.Name, }; MethodReturnResult result = await client.ModifyAsync(obj); if (result.Code == 0) { result.Message = string.Format(FMMResources.StringResource.MaterialPrintSet_SaveModify_Success , obj.Key); } return(Json(result)); } }
/// <summary> /// 取得产品打印标签数量 /// </summary> /// <param name="materialCode">产品物料代码</param> /// <param name="labelCode">标签代码</param> /// <returns></returns> public ActionResult GetPrintLabelQty(string materialCode, string labelCode) { MaterialPrintSetViewModel viewModel = new MaterialPrintSetViewModel(); int qty = 0; using (MaterialPrintSetServiceClient client = new MaterialPrintSetServiceClient()) { MethodReturnResult <MaterialPrintSet> result = client.Get(new MaterialPrintSetKey() { MaterialCode = materialCode, LabelCode = labelCode }); if (result.Code == 0) { qty = result.Data.Qty; } } return(Json(qty, JsonRequestBehavior.AllowGet)); }