public async Task <ActionResult> SaveModify(WorkOrderGroupDetailViewModel model)
        {
            using (WorkOrderGroupDetailServiceClient client = new WorkOrderGroupDetailServiceClient())
            {
                WorkOrderGroupDetailKey key = new WorkOrderGroupDetailKey()
                {
                    WorkOrderGroupNo = model.WorkOrderGroupNo.ToString().Trim().ToUpper(),
                    ProductCode      = model.ProductCode.ToString().Trim().ToUpper(),
                    OrderNumber      = model.OrderNumber.ToString().Trim().ToUpper()
                };
                MethodReturnResult <WorkOrderGroupDetail> result = await client.GetAsync(key);

                if (result.Code == 0)
                {
                    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("混工单组{0}规则修改成功!", model.WorkOrderGroupNo);
                    }
                    return(Json(rst));
                }
                return(Json(result));
            }
        }
        // GET: /PPM/WorkOrderGroupDetail/Detail
        public async Task <ActionResult> Detail(string WorkOrderGroupNo, string orderNumber, string productCode)
        {
            using (WorkOrderGroupDetailServiceClient client = new WorkOrderGroupDetailServiceClient())
            {
                WorkOrderGroupDetailKey key = new WorkOrderGroupDetailKey()
                {
                    WorkOrderGroupNo = WorkOrderGroupNo,
                    OrderNumber      = orderNumber,
                    ProductCode      = productCode
                };
                MethodReturnResult <WorkOrderGroupDetail> result = await client.GetAsync(key);

                if (result.Code == 0)
                {
                    WorkOrderGroupDetailViewModel viewModel = new WorkOrderGroupDetailViewModel()
                    {
                        WorkOrderGroupNo = result.Data.Key.WorkOrderGroupNo,
                        OrderNumber      = result.Data.Key.OrderNumber,
                        ProductCode      = result.Data.Key.ProductCode,
                        ItemNo           = result.Data.ItemNo,
                        CreateTime       = result.Data.CreateTime,
                        Creator          = result.Data.Creator,
                        Editor           = result.Data.Editor,
                        EditTime         = result.Data.EditTime,
                        Description      = result.Data.Description
                    };
                    return(PartialView("_InfoPartial", viewModel));
                }
                else
                {
                    ModelState.AddModelError("", result.Message);
                }
            }
            return(PartialView("_InfoPartial"));
        }
        //

        public async Task <ActionResult> Modify(string workOrderGroupNo, string orderNumber, string productCode)
        {
            WorkOrderGroupDetailViewModel viewModel = new WorkOrderGroupDetailViewModel();

            using (WorkOrderGroupDetailServiceClient client = new WorkOrderGroupDetailServiceClient())
            {
                MethodReturnResult <WorkOrderGroupDetail> result = await client.GetAsync(new WorkOrderGroupDetailKey()
                {
                    WorkOrderGroupNo = workOrderGroupNo,
                    OrderNumber      = orderNumber,
                    ProductCode      = productCode
                });

                if (result.Code == 0)
                {
                    viewModel = new WorkOrderGroupDetailViewModel()
                    {
                        WorkOrderGroupNo = result.Data.Key.WorkOrderGroupNo,
                        ProductCode      = result.Data.Key.ProductCode,
                        OrderNumber      = result.Data.Key.OrderNumber,
                        Description      = result.Data.Description
                    };
                    return(PartialView("_ModifyPartial", viewModel));
                }
                else
                {
                    ModelState.AddModelError("", result.Message);
                }
            }
            return(PartialView("_ModifyPartial", viewModel));
        }