示例#1
0
        private void UpdateOrderBinding(OrderBinding orderBinding, OrderMaster orderMaster)
        {
            #region 更新OrderBinding
            orderBinding.BindOrderNo = orderMaster.OrderNo;
            orderBinding.CurrentBindOrderMaster = orderMaster;
            this.genericMgr.Update(orderBinding);
            #endregion

            #region 创建OrderBindingDetail//用OrderTracer代替
            //foreach (OrderDetail bindOrderDetail in orderMaster.OrderDetails)
            //{
            //    OrderBindingDetail orderBindingDetail = new OrderBindingDetail();
            //    orderBindingDetail.OrderBindingId = orderBinding.Id;
            //    orderBindingDetail.OrderNo = orderMaster.OrderNo;
            //    orderBindingDetail.OrderDetailId = bindOrderDetail.BindDemand.OrderDetailId;
            //    orderBindingDetail.OrderBomDetailId = bindOrderDetail.BindDemand.OrderBomDetailId;
            //    orderBindingDetail.BindOrderNo = orderMaster.OrderNo;
            //    orderBindingDetail.BindOrderDetailId = bindOrderDetail.Id;

            //    this.genericMgr.Create(bindOrderDetail);
            //}
            #endregion
        }
示例#2
0
 //
 public void AddOrderBinding(OrderBinding orderBinding)
 {
     if (OrderBindings == null)
     {
         OrderBindings = new List<OrderBinding>();
     }
     OrderBindings.Add(orderBinding);
 }
示例#3
0
        public void ReCreateBindOrder(OrderBinding orderBinding)
        {
            if (!string.IsNullOrEmpty(orderBinding.BindOrderNo))
            {
                var orders = this.genericMgr.FindAll<OrderMaster>(" from OrderMaster where OrderNo=? ", orderBinding.BindOrderNo);
                if (orders != null && orders.Count > 0)
                {
                    OrderMaster bindOrder = orders.First();

                    if (bindOrder.Type == CodeMaster.OrderType.Production)
                    {
                        throw new BusinessException("被绑定订单{0}为生产单,不能重新创建绑定。", bindOrder.OrderNo, systemMgr.GetCodeDetailDescription(com.Sconit.CodeMaster.CodeMaster.OrderStatus, ((int)bindOrder.Status).ToString()));
                    }

                    if (bindOrder.Status == CodeMaster.OrderStatus.Create)
                    {
                        this.DeleteOrder(bindOrder.OrderNo);
                    }
                    else if (bindOrder.Status == CodeMaster.OrderStatus.Submit)
                    {
                        this.CancelOrder(bindOrder);
                    }
                    else
                    {
                        throw new BusinessException("被绑定订单{0}的状态为{1}不能重新创建绑定。", bindOrder.OrderNo, systemMgr.GetCodeDetailDescription(com.Sconit.CodeMaster.CodeMaster.OrderStatus, ((int)bindOrder.Status).ToString()));
                    }
                }
            }

            OrderMaster orderMaster = this.genericMgr.FindById<OrderMaster>(orderBinding.OrderNo);
            IList<OrderBinding> orderBindingList = new List<OrderBinding>();
            orderBindingList.Add(orderBinding);
            DoCreateBindingOrder(orderMaster, orderBindingList);
        }
 public ActionResult _OrderBindingEdit(OrderBinding orderBinding,string controlName)
 {
     OrderBinding newOrderBinding = genericMgr.FindById<OrderBinding>(orderBinding.Id);
     newOrderBinding.BindFlow = orderBinding.BindFlow;
     newOrderBinding.BindType = orderBinding.BindType;
     genericMgr.UpdateWithTrim(newOrderBinding);
     SaveSuccessMessage(Resources.ORD.OrderBinding.OrderBinding_Updated);
     TempData["TabIndex"] = 1;
     return RedirectToAction("Edit/" + orderBinding.OrderNo,controlName);
 }
 public ActionResult _OrderBindingNew(OrderBinding orderBinding)
 {
     if (ModelState.IsValid)
     {
         this.genericMgr.CreateWithTrim(orderBinding);
         SaveSuccessMessage(Resources.ORD.OrderBinding.OrderBinding_Added);
         TempData["TabIndex"] = 1;
         return RedirectToAction("Edit", orderBinding.ControlName, new { orderNo = orderBinding.OrderNo });
     }
     return PartialView(orderBinding);
 }
 public ActionResult _OrderBindingNew(string id,string controlName)
 {
     OrderBinding orderBinding = new OrderBinding();
     orderBinding.OrderNo = id;
     orderBinding.ControlName = controlName;
     return PartialView(orderBinding);
 }
 public ActionResult _OrderBindingEdit(OrderBinding orderBinding, string controlName)
 {
     OrderBinding newOrderBinding = base.genericMgr.FindById<OrderBinding>(orderBinding.Id);
     newOrderBinding.BindFlow = orderBinding.BindFlow;
     newOrderBinding.BindType = orderBinding.BindType;
     newOrderBinding.ControlName = controlName;
     newOrderBinding.BindFlowStrategy = orderBinding.BindFlowStrategy;
     genericMgr.Update(newOrderBinding);
     SaveSuccessMessage(Resources.ORD.OrderBinding.OrderBinding_Updated);
     TempData["TabIndex"] = 1;
     return PartialView(newOrderBinding);
 }