Пример #1
0
 public static bool UpdatePurchaseOrderShippingMode(PurchaseOrderInfo purchaseOrder)
 {
     ManagerHelper.CheckPrivilege(Privilege.EditPurchaseorder);
     if (purchaseOrder.CheckAction(PurchaseOrderActions.MASTER__MODIFY_SHIPPING_MODE))
     {
         bool flag = SalesProvider.Instance().UpdatePurchaseOrderShippingMode(purchaseOrder);
         if (flag)
         {
             EventLogs.WriteOperationLog(Privilege.EditPurchaseorder, string.Format(CultureInfo.InvariantCulture, "修改了编号为\"{0}\"的采购单的配送方式", new object[] { purchaseOrder.PurchaseOrderId }));
         }
         return flag;
     }
     return false;
 }
Пример #2
0
 public static bool SavePurchaseOrderShippingAddress(PurchaseOrderInfo purchaseOrder)
 {
     ManagerHelper.CheckPrivilege(Privilege.EditPurchaseorder);
     if (purchaseOrder.CheckAction(PurchaseOrderActions.MASTER_MODIFY_DELIVER_ADDRESS))
     {
         bool flag = SalesProvider.Instance().SavePurchaseOrderShippingAddress(purchaseOrder);
         if (flag)
         {
             EventLogs.WriteOperationLog(Privilege.EditPurchaseorder, string.Format(CultureInfo.InvariantCulture, "修改了编号为\"{0}\"的采购单的收货地址", new object[] { purchaseOrder.PurchaseOrderId }));
         }
         return flag;
     }
     return false;
 }
Пример #3
0
 public static bool SendPurchaseOrderGoods(PurchaseOrderInfo purchaseOrder)
 {
     Globals.EntityCoding(purchaseOrder, true);
     ManagerHelper.CheckPrivilege(Privilege.PurchaseorderSendGood);
     if (purchaseOrder.CheckAction(PurchaseOrderActions.MASTER_SEND_GOODS))
     {
         bool flag = SalesProvider.Instance().SendPurchaseOrderGoods(purchaseOrder);
         if (flag)
         {
             EventLogs.WriteOperationLog(Privilege.PurchaseorderSendGood, string.Format(CultureInfo.InvariantCulture, "对编号为\"{0}\"的采购单发货", new object[] { purchaseOrder.PurchaseOrderId }));
         }
         return flag;
     }
     return false;
 }
Пример #4
0
 public static bool ConfirmPurchaseOrderFinish(PurchaseOrderInfo purchaseOrder)
 {
     ManagerHelper.CheckPrivilege(Privilege.EditPurchaseorder);
     if (purchaseOrder.CheckAction(PurchaseOrderActions.MASTER_FINISH_TRADE))
     {
         bool flag = SalesProvider.Instance().ConfirmPurchaseOrderFinish(purchaseOrder);
         if (flag)
         {
             EventLogs.WriteOperationLog(Privilege.EditPurchaseorder, string.Format(CultureInfo.InvariantCulture, "完成编号为\"{0}\"的采购单", new object[] { purchaseOrder.PurchaseOrderId }));
         }
         return flag;
     }
     return false;
 }
Пример #5
0
 public static bool ConfirmPurchaseOrderFinish(PurchaseOrderInfo purchaseOrder)
 {
     return (purchaseOrder.CheckAction(PurchaseOrderActions.DISTRIBUTOR_CONFIRM_GOODS) && SubsiteSalesProvider.Instance().ConfirmPurchaseOrderFinish(purchaseOrder));
 }
Пример #6
0
 public static bool ConfirmPay(BalanceDetailInfo balance, PurchaseOrderInfo purchaseOrder)
 {
     if (!purchaseOrder.CheckAction(PurchaseOrderActions.DISTRIBUTOR_CONFIRM_PAY))
     {
         return false;
     }
     bool flag = SubsiteSalesProvider.Instance().ConfirmPay(balance, purchaseOrder.PurchaseOrderId);
     if (flag)
     {
         SubsiteSalesProvider.Instance().UpdateProductStock(purchaseOrder.PurchaseOrderId);
         SubsiteSalesProvider.Instance().UpdateDistributorAccount(purchaseOrder.GetPurchaseTotal());
         Users.ClearUserCache(Users.GetUser(purchaseOrder.DistributorId));
     }
     return flag;
 }
Пример #7
0
 public static bool ClosePurchaseOrder(PurchaseOrderInfo purchaseOrder)
 {
     return (purchaseOrder.CheckAction(PurchaseOrderActions.DISTRIBUTOR_CLOSE) && SubsiteSalesProvider.Instance().ClosePurchaseOrder(purchaseOrder));
 }
Пример #8
0
 private void SetControl(PurchaseOrderInfo purchaseOrder)
 {
     if (!purchaseOrder.CheckAction(PurchaseOrderActions.MASTER_REJECT_REFUND))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         Distributor distributor = DistributorHelper.GetDistributor(purchaseOrder.DistributorId);
         if (distributor == null)
         {
             base.GotoResourceNotFound();
         }
         else
         {
             litDistributorName.Text = distributor.Username;
             litOrderId.Text = purchaseOrder.OrderId;
             lblOrderDate.Time = purchaseOrder.PurchaseDate;
             litPurchaseOrderId.Text = purchaseOrder.PurchaseOrderId;
             lblTotalPrice.Money = purchaseOrder.GetPurchaseTotal();
             lblPurchaseStatus.PuchaseStatusCode = (int)purchaseOrder.PurchaseStatus;
             if (purchaseOrder.PurchaseStatus == OrderStatus.SellerAlreadySent)
             {
                 lblRefundTotal.Visible = false;
                 litRefundComment.Text = "退款金额不得大于" + lblTotalPrice.Money + "元.已发货订单允许全额或部分退款。";
             }
             else
             {
                 txtRefundTotal.Style.Add(HtmlTextWriterStyle.Display, "none");
                 lblRefundTotal.Money = lblTotalPrice.Money;
                 litRefundComment.Text = "已付款等待发货订单只允许全额退款.退款后采购单自动变为关闭状态。";
             }
         }
     }
 }