Ejemplo n.º 1
0
        //
        // GET: /PPM/WorkOrderRoute/Detail
        public async Task <ActionResult> Detail(string orderNumber, int itemNo)
        {
            using (WorkOrderRouteServiceClient client = new WorkOrderRouteServiceClient())
            {
                MethodReturnResult <WorkOrderRoute> result = await client.GetAsync(new WorkOrderRouteKey()
                {
                    OrderNumber = orderNumber,
                    ItemNo      = itemNo
                });

                if (result.Code == 0)
                {
                    WorkOrderRouteViewModel viewModel = new WorkOrderRouteViewModel()
                    {
                        OrderNumber         = result.Data.Key.OrderNumber,
                        ItemNo              = result.Data.Key.ItemNo,
                        RouteEnterpriseName = result.Data.RouteEnterpriseName,
                        RouteName           = result.Data.RouteName,
                        RouteStepName       = result.Data.RouteStepName,
                        IsRework            = result.Data.IsRework,
                        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"));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> SaveModify(WorkOrderRouteViewModel model)
        {
            using (WorkOrderRouteServiceClient client = new WorkOrderRouteServiceClient())
            {
                MethodReturnResult <WorkOrderRoute> result = await client.GetAsync(new WorkOrderRouteKey()
                {
                    OrderNumber = model.OrderNumber.ToUpper(),
                    ItemNo      = model.ItemNo
                });

                if (result.Code == 0)
                {
                    result.Data.RouteEnterpriseName = model.RouteEnterpriseName;
                    result.Data.RouteName           = model.RouteName;
                    result.Data.RouteStepName       = model.RouteStepName;
                    result.Data.IsRework            = model.IsRework;
                    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(PPMResources.StringResource.WorkOrderRoute_SaveModify_Success
                                                    , result.Data.Key);
                    }
                    return(Json(rst));
                }
                return(Json(result));
            }
        }