private void BindOrderInfo(PurchaseOrderInfo order)
        {
            litAddress.Text = order.ShippingRegion + order.Address;
            litCellPhone.Text = order.CellPhone;
            litTelPhone.Text = order.TelPhone;
            litZipCode.Text = order.ZipCode;
            litOrderId.Text = order.OrderId;
            litOrderDate.Text = order.PurchaseDate.ToString();
            litRemark.Text = order.Remark;
            litShipperMode.Text = order.RealModeName;
            litShippNo.Text = order.ShipOrderNumber;
            litSkipTo.Text = order.ShipTo;
            switch (order.PurchaseStatus)
            {
                case OrderStatus.WaitBuyerPay:
                    litOrderStatus.Text = "等待付款";
                    break;

                case OrderStatus.BuyerAlreadyPaid:
                    litOrderStatus.Text = "已付款等待发货";
                    break;

                case OrderStatus.SellerAlreadySent:
                    litOrderStatus.Text = "已发货";
                    break;

                case OrderStatus.Closed:
                    litOrderStatus.Text = "已关闭";
                    break;

                case OrderStatus.Finished:
                    litOrderStatus.Text = "已完成";
                    break;
            }
        }
Ejemplo n.º 2
0
        private void BindOrderInfo(PurchaseOrderInfo order)
        {
            litAddress.Text = order.ShippingRegion + order.Address;
            litCellPhone.Text = order.CellPhone;
            litTelPhone.Text = order.TelPhone;
            litZipCode.Text = order.ZipCode;
            litOrderId.Text = order.OrderId;
            litOrderDate.Text = order.PurchaseDate.ToString();
            litRemark.Text = order.Remark;
            litShipperMode.Text = order.RealModeName;
            litShippNo.Text = order.ShipOrderNumber;
            litSkipTo.Text = order.ShipTo;
            string str = string.Empty;
            if (order.PurchaseOrderOptions.Count > 0)
            {
                IList<PurchaseOrderOptionInfo> purchaseOrderOptions = order.PurchaseOrderOptions;
                str = str + "(";
                foreach (PurchaseOrderOptionInfo info in purchaseOrderOptions)
                {
                    string str2 = str;
                    str = str2 + info.ListDescription + ":" + info.ItemDescription + ";" + info.CustomerTitle + ":" + info.CustomerDescription;
                }
                str = str + ")";
                litOptionDes.Text = str;
            }
            switch (order.PurchaseStatus)
            {
                case OrderStatus.WaitBuyerPay:
                    litOrderStatus.Text = "等待付款";
                    break;

                case OrderStatus.BuyerAlreadyPaid:
                    litOrderStatus.Text = "已付款等待发货";
                    break;

                case OrderStatus.SellerAlreadySent:
                    litOrderStatus.Text = "已发货";
                    break;

                case OrderStatus.Closed:
                    litOrderStatus.Text = "已关闭";
                    break;

                case OrderStatus.Finished:
                    litOrderStatus.Text = "已完成";
                    break;
            }
            litOptionMoney.Money = order.GetOptionPrice();
            litShippMoney.Money = order.AdjustedFreight;
            litTotalMoney.Money = order.OrderTotal;
            litDiscountMoney.Money = order.AdjustedDiscount;
            decimal num = 0M;
            foreach (PurchaseOrderItemInfo info2 in order.PurchaseOrderItems)
            {
                num += info2.ItemListPrice * info2.Quantity;
            }
            litItemsMoney.Money = num;
        }
 private void BindOrderItems(PurchaseOrderInfo order)
 {
     grdOrderItems.DataSource = order.PurchaseOrderItems;
     grdOrderItems.DataBind();
     if (order.PurchaseOrderGifts.Count > 0)
     {
         grdOrderGifts.DataSource = order.PurchaseOrderGifts;
         grdOrderGifts.DataBind();
     }
     else
     {
         grdOrderGifts.Visible = false;
     }
 }
Ejemplo n.º 4
0
 private void BindCharges(PurchaseOrderInfo purchaseOrder)
 {
     lblModeName.Text = purchaseOrder.ModeName;
     litFreight.Text = Globals.FormatMoney(purchaseOrder.AdjustedFreight);
     litOptionPrice.Text = Globals.FormatMoney(purchaseOrder.GetOptionPrice());
     litDiscount.Text = Globals.FormatMoney(purchaseOrder.AdjustedDiscount);
     litTotalPrice.Text = Globals.FormatMoney(purchaseOrder.GetPurchaseTotal());
     string str = string.Empty;
     if (purchaseOrder.PurchaseOrderOptions.Count > 0)
     {
         foreach (PurchaseOrderOptionInfo info in purchaseOrder.PurchaseOrderOptions)
         {
             string str2 = str;
             str = str2 + info.ListDescription + ":" + info.ItemDescription + ";" + info.CustomerTitle + ":" + info.CustomerDescription;
         }
     }
     if (!string.IsNullOrEmpty(str))
     {
         litOderItem.Text = "(" + str + ")";
     }
 }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     btnConfirmPay.Click += new EventHandler(btnConfirmPay_Click);
     btnBack.Click += new EventHandler(btnBack_Click);
     btnBack1.Click += new EventHandler(btnBack_Click);
     imgBtnBack.Click += new System.Web.UI.ImageClickEventHandler(btnBack_Click);
     if (string.IsNullOrEmpty(base.Request.QueryString["PurchaseOrderId"]))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         purchaseOrderId = base.Request.QueryString["PurchaseOrderId"];
         purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId);
         if (!base.IsPostBack)
         {
             if (purchaseOrder == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 if (purchaseOrder.IsManualPurchaseOrder)
                 {
                     litorder.Visible = false;
                     litOrderId.Visible = false;
                 }
                 else
                 {
                     litOrderId.Text = purchaseOrder.OrderId;
                 }
                 litPurchaseOrderId.Text = purchaseOrder.PurchaseOrderId;
                 lblPurchaseDate.Time = purchaseOrder.PurchaseDate;
                 lblTotalPrice.Money = purchaseOrder.GetPurchaseTotal();
                 AccountSummaryInfo myAccountSummary = SubsiteStoreHelper.GetMyAccountSummary();
                 lblUseableBalance.Money = myAccountSummary.UseableBalance;
             }
         }
     }
 }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.Request.QueryString["PurchaseOrderId"] == null)
     {
         base.GotoResourceNotFound();
     }
     else
     {
         purchaseOrderId = Page.Request.QueryString["PurchaseOrderId"];
         purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId);
         btnSearch.Click += new EventHandler(btnSearch_Click);
         btnClear.Click += new EventHandler(btnClear_Click);
         dlstGifts.ItemCommand += new DataListCommandEventHandler(dlstGifts_ItemCommand);
         dlstOrderGifts.DeleteCommand += new DataListCommandEventHandler(dlstOrderGifts_DeleteCommand);
         btnReturn.Click += new EventHandler(btnReturn_Click);
         if (!base.IsPostBack)
         {
             if (purchaseOrder == null)
             {
                 base.GotoResourceNotFound();
             }
             else if (purchaseOrder.PurchaseStatus != OrderStatus.WaitBuyerPay)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 if (purchaseOrder.PurchaseOrderGifts.Count > 0)
                 {
                     litPageTitle.Text = "编辑采购单礼品";
                 }
                 BindGifts();
                 BindOrderGifts();
             }
         }
     }
 }
Ejemplo n.º 7
0
 protected override void OnInit(EventArgs e)
 {
     if (string.IsNullOrEmpty(Page.Request.QueryString["PurchaseOrderId"]))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         purchaseOrderId = Page.Request.QueryString["PurchaseOrderId"];
         purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId);
         if (purchaseOrder == null)
         {
             base.GotoResourceNotFound();
         }
         else if (purchaseOrder.PurchaseStatus != pagePurchaseStatus)
         {
             Redirect();
         }
         else
         {
             base.OnInit(e);
         }
     }
 }
Ejemplo n.º 8
0
 public static bool ClosePurchaseOrder(PurchaseOrderInfo purchaseOrder)
 {
     ManagerHelper.CheckPrivilege(Privilege.EditPurchaseorder);
     bool flag = SalesProvider.Instance().ClosePurchaseOrder(purchaseOrder);
     if (flag)
     {
         EventLogs.WriteOperationLog(Privilege.EditPurchaseorder, string.Format(CultureInfo.InvariantCulture, "关闭了编号为\"{0}\"的采购单", new object[] { purchaseOrder.PurchaseOrderId }));
     }
     return flag;
 }
Ejemplo n.º 9
0
 PurchaseOrderInfo ConvertOrderToPurchaseOrder(OrderInfo order)
 {
     if (order == null)
     {
         return null;
     }
     StringBuilder builder = new StringBuilder();
     string query = "";
     foreach (LineItemInfo info in order.LineItems.Values)
     {
         builder.AppendFormat("'" + info.SkuId + "',", new object[0]);
     }
     if (builder.Length > 0)
     {
         builder = builder.Remove(builder.Length - 1, 1);
         query = string.Format("SELECT S.SkuId, S.CostPrice, p.ProductName FROM Hishop_Products P JOIN Hishop_SKUs S ON P.ProductId = S.ProductId WHERE S.SkuId IN({0});", builder);
     }
     if (order.Gifts.Count > 0)
     {
         StringBuilder builder2 = new StringBuilder();
         foreach (OrderGiftInfo info2 in order.Gifts)
         {
             builder2.AppendFormat(info2.GiftId.ToString() + ",", new object[0]);
         }
         builder2.Remove(builder2.Length - 1, 1);
         query = query + string.Format(" SELECT GiftId, CostPrice FROM Hishop_Gifts WHERE GiftId IN({0});", builder2.ToString());
     }
     DbCommand sqlStringCommand = database.GetSqlStringCommand(query);
     Dictionary<string, PurchaseOrderItemInfo> dictionary = new Dictionary<string, PurchaseOrderItemInfo>();
     Dictionary<int, decimal> dictionary2 = new Dictionary<int, decimal>();
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         if (order.LineItems.Values.Count > 0)
         {
             while (reader.Read())
             {
                 PurchaseOrderItemInfo info3 = new PurchaseOrderItemInfo();
                 if (reader["CostPrice"] != DBNull.Value)
                 {
                     info3.ItemCostPrice = (decimal)reader["CostPrice"];
                 }
                 info3.ItemHomeSiteDescription = (string)reader["ProductName"];
                 dictionary.Add((string)reader["SkuId"], info3);
             }
         }
         if (order.Gifts.Count > 0)
         {
             if (order.LineItems.Count > 0)
             {
                 reader.NextResult();
             }
             while (reader.Read())
             {
                 dictionary2.Add((int)reader["GiftId"], (DBNull.Value == reader["CostPrice"]) ? 0M : Convert.ToDecimal(reader["CostPrice"]));
             }
         }
     }
     IUser user = Users.GetUser(HiContext.Current.SiteSettings.UserId.Value, false);
     if ((user == null) || (user.UserRole != UserRole.Distributor))
     {
         return null;
     }
     Distributor distributor = user as Distributor;
     PurchaseOrderInfo info4 = new PurchaseOrderInfo();
     info4.PurchaseOrderId = "PO" + order.OrderId;
     info4.OrderId = order.OrderId;
     info4.Remark = order.Remark;
     info4.PurchaseStatus = OrderStatus.WaitBuyerPay;
     info4.DistributorId = distributor.UserId;
     info4.Distributorname = distributor.Username;
     info4.DistributorEmail = distributor.Email;
     info4.DistributorRealName = distributor.RealName;
     info4.DistributorQQ = distributor.QQ;
     info4.DistributorWangwang = distributor.Wangwang;
     info4.DistributorMSN = distributor.MSN;
     info4.ShippingRegion = order.ShippingRegion;
     info4.Address = order.Address;
     info4.ZipCode = order.ZipCode;
     info4.ShipTo = order.ShipTo;
     info4.TelPhone = order.TelPhone;
     info4.CellPhone = order.CellPhone;
     info4.ShippingModeId = order.ShippingModeId;
     info4.ModeName = order.ModeName;
     info4.RegionId = order.RegionId;
     info4.Freight = order.Freight;
     info4.AdjustedFreight = order.Freight;
     info4.ShipOrderNumber = order.ShipOrderNumber;
     info4.Weight = order.Weight;
     info4.RefundStatus = RefundStatus.None;
     info4.OrderTotal = order.GetTotal();
     info4.ExpressCompanyName = order.ExpressCompanyName;
     info4.ExpressCompanyAbb = order.ExpressCompanyAbb;
     foreach (LineItemInfo info5 in order.LineItems.Values)
     {
         PurchaseOrderItemInfo item = new PurchaseOrderItemInfo();
         item.PurchaseOrderId = info4.PurchaseOrderId;
         item.SkuId = info5.SkuId;
         item.ProductId = info5.ProductId;
         item.SKU = info5.SKU;
         item.Quantity = info5.ShipmentQuantity;
         foreach (KeyValuePair<string, PurchaseOrderItemInfo> pair in dictionary)
         {
             if (pair.Key == info5.SkuId)
             {
                 item.ItemCostPrice = pair.Value.ItemCostPrice;
                 item.ItemHomeSiteDescription = pair.Value.ItemHomeSiteDescription;
             }
         }
         item.ItemPurchasePrice = info5.ItemCostPrice;
         item.ItemListPrice = info5.ItemListPrice;
         item.ItemDescription = info5.ItemDescription;
         item.SKUContent = info5.SKUContent;
         item.ThumbnailsUrl = info5.ThumbnailsUrl;
         item.ItemWeight = info5.ItemWeight;
         if (string.IsNullOrEmpty(item.ItemHomeSiteDescription))
         {
             item.ItemHomeSiteDescription = item.ItemDescription;
         }
         info4.PurchaseOrderItems.Add(item);
     }
     foreach (OrderGiftInfo info7 in order.Gifts)
     {
         PurchaseOrderGiftInfo info8 = new PurchaseOrderGiftInfo();
         info8.PurchaseOrderId = info4.PurchaseOrderId;
         foreach (KeyValuePair<int, decimal> pair2 in dictionary2)
         {
             if (pair2.Key == info7.GiftId)
             {
                 info8.CostPrice = pair2.Value;
             }
         }
         info8.PurchasePrice = info7.CostPrice;
         info8.GiftId = info7.GiftId;
         info8.GiftName = info7.GiftName;
         info8.Quantity = info7.Quantity;
         info8.ThumbnailsUrl = info7.ThumbnailsUrl;
         info4.PurchaseOrderGifts.Add(info8);
     }
     foreach (OrderOptionInfo info9 in order.OrderOptions)
     {
         PurchaseOrderOptionInfo info10 = new PurchaseOrderOptionInfo();
         info10.PurchaseOrderId = info4.PurchaseOrderId;
         info10.LookupListId = info9.LookupListId;
         info10.LookupItemId = info9.LookupItemId;
         info10.ListDescription = info9.ListDescription;
         info10.ItemDescription = info9.ItemDescription;
         info10.AdjustedPrice = info9.AdjustedPrice;
         info10.CustomerTitle = info9.CustomerTitle;
         info10.CustomerDescription = info9.CustomerDescription;
         info4.PurchaseOrderOptions.Add(info10);
     }
     return info4;
 }
Ejemplo n.º 10
0
 public override bool ConfirmPayPurchaseOrder(PurchaseOrderInfo purchaseOrder)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_PurchaseOrders SET PurchaseStatus=@PurchaseStatus WHERE PurchaseOrderId = @PurchaseOrderId ");
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     database.AddInParameter(sqlStringCommand, "CloseReason", DbType.String, purchaseOrder.CloseReason);
     database.AddInParameter(sqlStringCommand, "PurchaseStatus", DbType.Int32, 2);
     return (database.ExecuteNonQuery(sqlStringCommand) == 1);
 }
Ejemplo n.º 11
0
 public static bool UpdatePurchaseOrder(PurchaseOrderInfo purchaseOrder)
 {
     return SalesProvider.Instance().UpdatePurchaseOrder(purchaseOrder);
 }
Ejemplo n.º 12
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;
 }
Ejemplo n.º 13
0
 public static bool RefundPurchaseOrder(PurchaseOrderInfo purchaseOrder)
 {
     ManagerHelper.CheckPrivilege(Privilege.PurchaseorderRefund);
     bool flag = SalesProvider.Instance().RefundPurchaseOrder(purchaseOrder);
     if (flag)
     {
         if (purchaseOrder.PurchaseStatus == OrderStatus.Closed)
         {
             SalesProvider.Instance().UpdateRefundSubmitPurchaseOrderStock(purchaseOrder);
         }
         Users.ClearUserCache(Users.GetUser(purchaseOrder.DistributorId));
         EventLogs.WriteOperationLog(Privilege.PurchaseorderRefund, string.Format(CultureInfo.InvariantCulture, "对编号为\"{0}\"的采购单退款", new object[] { purchaseOrder.PurchaseOrderId }));
     }
     return flag;
 }
        private PurchaseOrderInfo GetPurchaseOrder(Trade trade)
        {
            PurchaseOrderInfo info = new PurchaseOrderInfo();

            info.PurchaseOrderId = "MPO" + trade.Tid.ToString();
            info.TaobaoOrderId = trade.Tid.ToString();
            info.ShipTo = trade.ReceiverName;
            info.ShippingRegion = trade.ReceiverState + trade.ReceiverCity + trade.ReceiverDistrict;
            info.RegionId = RegionHelper.GetRegionIdByName(trade.ReceiverState, trade.ReceiverCity, trade.ReceiverDistrict);
            info.Address = trade.ReceiverAddress;
            info.TelPhone = trade.ReceiverPhone;
            info.ZipCode = trade.ReceiverZip;
            info.CellPhone = trade.ReceiverMobile;
            info.ShippingModeId = shippingMode.ModeId;
            info.ModeName = shippingMode.Name;
            info.RealShippingModeId = shippingMode.ModeId;
            info.RealModeName = shippingMode.Name;
            info.AdjustedDiscount = 0M;
            info.OrderTotal = decimal.Parse(trade.Payment);
            int totalWeight = 0;

            foreach (Order order in trade.Orders)
            {

                DataTable skuContent = SubSiteProducthelper.GetSkuContent(order.NumIid, order.OuterSkuId);

                if ((skuContent != null) && (skuContent.Rows.Count > 0))
                {
                    PurchaseOrderItemInfo item = new PurchaseOrderItemInfo();

                    foreach (DataRow row in skuContent.Rows)
                    {
                        if (!(string.IsNullOrEmpty(row["AttributeName"].ToString()) || string.IsNullOrEmpty(row["ValueStr"].ToString())))
                        {
                            object sKUContent = item.SKUContent;
                            item.SKUContent = string.Concat(new object[] { sKUContent, row["AttributeName"], ":", row["ValueStr"], "; " });
                        }
                    }
                    item.PurchaseOrderId = info.PurchaseOrderId;
                    item.SkuId = (string)skuContent.Rows[0]["SkuId"];
                    item.ProductId = (int)skuContent.Rows[0]["ProductId"];
                    if (skuContent.Rows[0]["SKU"] != DBNull.Value)
                    {
                        item.SKU = (string)skuContent.Rows[0]["SKU"];
                    }
                    if (skuContent.Rows[0]["Weight"] != DBNull.Value)
                    {
                        item.ItemWeight = (int)skuContent.Rows[0]["Weight"];
                    }
                    item.ItemPurchasePrice = (decimal)skuContent.Rows[0]["PurchasePrice"];
                    item.Quantity = int.Parse(order.Num.ToString());
                    item.ItemListPrice = (decimal)skuContent.Rows[0]["SalePrice"];
                    if (skuContent.Rows[0]["CostPrice"] != DBNull.Value)
                    {
                        item.ItemCostPrice = (decimal)skuContent.Rows[0]["CostPrice"];
                    }
                    item.ItemDescription = (string)skuContent.Rows[0]["ProductName"];
                    item.ItemHomeSiteDescription = (string)skuContent.Rows[0]["ProductName"];
                    if (skuContent.Rows[0]["ThumbnailUrl40"] != DBNull.Value)
                    {
                        item.ThumbnailsUrl = (string)skuContent.Rows[0]["ThumbnailUrl40"];
                    }
                    totalWeight += item.ItemWeight * item.Quantity;
                    info.PurchaseOrderItems.Add(item);
                }
            }
            if (info.PurchaseOrderItems.Count <= 0)
            {
                return null;
            }
            info.Weight = totalWeight;
            info.AdjustedFreight = SubsiteSalesHelper.CalcFreight(info.RegionId, totalWeight, shippingMode);
            info.Freight = info.AdjustedFreight;
            info.PurchaseStatus = OrderStatus.WaitBuyerPay;
            info.RefundStatus = RefundStatus.None;
            info.DistributorId = distributor.UserId;
            info.Distributorname = distributor.Username;
            info.DistributorEmail = distributor.Email;
            info.DistributorRealName = distributor.RealName;
            info.DistributorQQ = distributor.QQ;
            info.DistributorWangwang = distributor.Wangwang;
            info.DistributorMSN = distributor.MSN;
            return info;
        }
Ejemplo n.º 15
0
 public override void UpdateRefundSubmitPurchaseOrderStock(PurchaseOrderInfo purchaseOrder)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("Update Hishop_SKUs Set Stock = Stock + (SELECT SUM(oi.Quantity) FROM Hishop_PurchaseOrderItems oi  Where oi.SkuId =Hishop_SKUs.SkuId AND PurchaseOrderId =@PurchaseOrderId) WHERE Hishop_SKUs.SkuId  IN (Select SkuId FROM Hishop_PurchaseOrderItems Where PurchaseOrderId =@PurchaseOrderId)");
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     database.ExecuteNonQuery(sqlStringCommand);
 }
Ejemplo n.º 16
0
 public override bool UpdatePurchaseOrderShippingMode(PurchaseOrderInfo purchaseOrder)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_PurchaseOrders SET ShippingModeId=@ShippingModeId ,ModeName=@ModeName WHERE PurchaseOrderId = @PurchaseOrderId");
     database.AddInParameter(sqlStringCommand, "ShippingModeId", DbType.Int32, purchaseOrder.ShippingModeId);
     database.AddInParameter(sqlStringCommand, "ModeName", DbType.String, purchaseOrder.ModeName);
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     return (database.ExecuteNonQuery(sqlStringCommand) == 1);
 }
Ejemplo n.º 17
0
 public override bool ConfirmPurchaseOrderFinish(PurchaseOrderInfo purchaseOrder)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_PurchaseOrders SET  PurchaseStatus = @PurchaseStatus, FinishDate=@FinishDate WHERE PurchaseOrderId = @PurchaseOrderId");
     database.AddInParameter(sqlStringCommand, "PurchaseStatus", DbType.Int32, 5);
     database.AddInParameter(sqlStringCommand, "FinishDate", DbType.DateTime, DateTime.Now);
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     return (database.ExecuteNonQuery(sqlStringCommand) >= 1);
 }
Ejemplo n.º 18
0
 public override bool UpdatePurchaseOrderAmount(PurchaseOrderInfo purchaseOrder)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_PurchaseOrders SET PurchaseTotal=@PurchaseTotal, PurchaseProfit=@PurchaseProfit, AdjustedDiscount=@AdjustedDiscount WHERE PurchaseOrderId=@PurchaseOrderId");
     database.AddInParameter(sqlStringCommand, "PurchaseTotal", DbType.Currency, purchaseOrder.GetPurchaseTotal());
     database.AddInParameter(sqlStringCommand, "PurchaseProfit", DbType.Currency, purchaseOrder.GetPurchaseProfit());
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     database.AddInParameter(sqlStringCommand, "AdjustedDiscount", DbType.Currency, purchaseOrder.AdjustedDiscount);
     return (database.ExecuteNonQuery(sqlStringCommand) == 1);
 }
Ejemplo n.º 19
0
 public override bool UpdatePurchaseOrder(PurchaseOrderInfo purchaseOrder)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_PurchaseOrders SET Weight=@Weight,PurchaseProfit=@PurchaseProfit,PurchaseTotal=@PurchaseTotal,AdjustedFreight=@AdjustedFreight WHERE PurchaseOrderId=@PurchaseOrderId");
     database.AddInParameter(sqlStringCommand, "Weight", DbType.Int32, purchaseOrder.Weight);
     database.AddInParameter(sqlStringCommand, "PurchaseProfit", DbType.Decimal, purchaseOrder.GetPurchaseProfit());
     database.AddInParameter(sqlStringCommand, "PurchaseTotal", DbType.Decimal, purchaseOrder.GetPurchaseTotal());
     database.AddInParameter(sqlStringCommand, "AdjustedFreight", DbType.Decimal, purchaseOrder.AdjustedFreight);
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     return (database.ExecuteNonQuery(sqlStringCommand) > 0);
 }
Ejemplo n.º 20
0
 public static bool ConfirmPayPurchaseOrder(PurchaseOrderInfo purchaseOrder)
 {
     ManagerHelper.CheckPrivilege(Privilege.EditPurchaseorder);
     bool flag = SalesProvider.Instance().ConfirmPayPurchaseOrder(purchaseOrder);
     if (flag)
     {
         SalesProvider.Instance().UpdateProductStock(purchaseOrder.PurchaseOrderId);
         SalesProvider.Instance().UpdateDistributorAccount(purchaseOrder.GetPurchaseTotal(), purchaseOrder.DistributorId);
         Users.ClearUserCache(Users.GetUser(purchaseOrder.DistributorId));
         EventLogs.WriteOperationLog(Privilege.EditPurchaseorder, string.Format(CultureInfo.InvariantCulture, "对编号为\"{0}\"的采购单线下收款", new object[] { purchaseOrder.PurchaseOrderId }));
     }
     return flag;
 }
Ejemplo n.º 21
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;
 }
Ejemplo n.º 22
0
 public override PurchaseOrderInfo GetPurchaseOrder(string purchaseOrderId)
 {
     PurchaseOrderInfo info = new PurchaseOrderInfo();
     DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Hishop_PurchaseOrders Where PurchaseOrderId = @PurchaseOrderId");
     this.database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrderId);
     using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
     {
         if (!reader.Read())
         {
             return info;
         }
         info.PurchaseOrderId = (string) reader["PurchaseOrderId"];
         if (DBNull.Value != reader["ExpressCompanyAbb"])
         {
             info.ExpressCompanyAbb = (string) reader["ExpressCompanyAbb"];
         }
         if (DBNull.Value != reader["ExpressCompanyName"])
         {
             info.ExpressCompanyName = (string) reader["ExpressCompanyName"];
         }
         if (DBNull.Value != reader["ShipOrderNumber"])
         {
             info.ShipOrderNumber = (string) reader["ShipOrderNumber"];
         }
         if (DBNull.Value != reader["PurchaseStatus"])
         {
             info.PurchaseStatus = (OrderStatus) reader["PurchaseStatus"];
         }
     }
     return info;
 }
Ejemplo n.º 23
0
 public static bool SavePurchaseOrderRemark(PurchaseOrderInfo purchaseOrder)
 {
     ManagerHelper.CheckPrivilege(Privilege.PurchaseorderMark);
     bool flag = SalesProvider.Instance().SavePurchaseOrderRemark(purchaseOrder);
     if (flag)
     {
         EventLogs.WriteOperationLog(Privilege.PurchaseorderMark, string.Format(CultureInfo.InvariantCulture, "对编号为\"{0}\"的采购单备注", new object[] { purchaseOrder.PurchaseOrderId }));
     }
     return flag;
 }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (ValidateCreateOrder())
            {
                string str = "";

                PurchaseOrderInfo purchaseOrderInfo = new PurchaseOrderInfo();

                Distributor user = Users.GetUser(HiContext.Current.User.UserId) as Distributor;

                purchaseOrderInfo.PurchaseOrderId = GeneratePurchaseOrderId();

                int totalWeight = 0;

                for (int i = 0; i < rpTaobaoOrder.Items.Count; i++)
                {
                    CheckBox box = (CheckBox)rpTaobaoOrder.Items[i].FindControl("chkTbOrder");

                    if (box.Checked)
                    {
                        str = str + tbOrders[i].orderId + ",";
                        Repeater repeater = (Repeater)rpTaobaoOrder.Items[i].FindControl("reOrderItems");
                        IList<tbOrderItem> items = tbOrders[i].items;
                        for (int j = 0; j < repeater.Items.Count; j++)
                        {
                            if (items[j].localSkuId.Trim() == "")
                            {
                                string msg = string.Format("在授权给分销商的商品中没有找到淘宝商品:{0}!请重新查找", items[j].title);
                                ShowMsg(msg, false);
                                return;
                            }
                            string localSkuId = items[j].localSkuId;
                            TextBox box2 = (TextBox)repeater.Items[j].FindControl("productNumber");
                            int num4 = Convert.ToInt32(box2.Text);
                            bool flag = false;
                            foreach (PurchaseOrderItemInfo info2 in purchaseOrderInfo.PurchaseOrderItems)
                            {
                                if (info2.SKU == localSkuId)
                                {
                                    flag = true;
                                    info2.Quantity += num4;
                                    totalWeight += info2.ItemWeight * num4;
                                }
                            }
                            if (!flag)
                            {
                                DataTable skuContentBySku = SubSiteProducthelper.GetSkuContentBySku(localSkuId);
                                PurchaseOrderItemInfo item = new PurchaseOrderItemInfo();
                                if (num4 > ((int)skuContentBySku.Rows[0]["Stock"]))
                                {
                                    ShowMsg("商品库存不够", false);
                                    return;
                                }
                                foreach (DataRow row in skuContentBySku.Rows)
                                {
                                    if (!(string.IsNullOrEmpty(row["AttributeName"].ToString()) || string.IsNullOrEmpty(row["ValueStr"].ToString())))
                                    {
                                        object sKUContent = item.SKUContent;
                                        item.SKUContent = string.Concat(new object[] { sKUContent, row["AttributeName"], ":", row["ValueStr"], "; " });
                                    }
                                }
                                item.PurchaseOrderId = purchaseOrderInfo.PurchaseOrderId;
                                item.SkuId = localSkuId;
                                item.ProductId = (int)skuContentBySku.Rows[0]["ProductId"];
                                if (skuContentBySku.Rows[0]["SKU"] != DBNull.Value)
                                {
                                    item.SKU = (string)skuContentBySku.Rows[0]["SKU"];
                                }
                                if (skuContentBySku.Rows[0]["Weight"] != DBNull.Value)
                                {
                                    item.ItemWeight = (int)skuContentBySku.Rows[0]["Weight"];
                                }
                                item.ItemPurchasePrice = (decimal)skuContentBySku.Rows[0]["PurchasePrice"];
                                item.Quantity = num4;
                                item.ItemListPrice = (decimal)skuContentBySku.Rows[0]["SalePrice"];
                                if (skuContentBySku.Rows[0]["CostPrice"] != DBNull.Value)
                                {
                                    item.ItemCostPrice = (decimal)skuContentBySku.Rows[0]["CostPrice"];
                                }
                                item.ItemDescription = (string)skuContentBySku.Rows[0]["ProductName"];
                                item.ItemHomeSiteDescription = (string)skuContentBySku.Rows[0]["ProductName"];
                                if (skuContentBySku.Rows[0]["ThumbnailUrl40"] != DBNull.Value)
                                {
                                    item.ThumbnailsUrl = (string)skuContentBySku.Rows[0]["ThumbnailUrl40"];
                                }
                                totalWeight += item.ItemWeight * num4;
                                purchaseOrderInfo.PurchaseOrderItems.Add(item);
                            }
                        }
                    }
                }
                if (str == "")
                {
                    ShowMsg("至少选择一个淘宝订单!!", false);
                }
                else
                {
                    ShippingModeInfo shippingMode = SubsiteSalesHelper.GetShippingMode(radioShippingMode.SelectedValue.Value, true);
                    purchaseOrderInfo.ShipTo = txtShipTo.Text.Trim();
                    if (rsddlRegion.GetSelectedRegionId().HasValue)
                    {
                        purchaseOrderInfo.RegionId = rsddlRegion.GetSelectedRegionId().Value;
                    }
                    purchaseOrderInfo.Address = txtAddress.Text.Trim();
                    purchaseOrderInfo.TelPhone = txtTel.Text.Trim();
                    purchaseOrderInfo.ZipCode = txtZipcode.Text.Trim();
                    purchaseOrderInfo.CellPhone = txtMobile.Text.Trim();
                    purchaseOrderInfo.OrderId = null;
                    purchaseOrderInfo.RealShippingModeId = radioShippingMode.SelectedValue.Value;
                    purchaseOrderInfo.RealModeName = shippingMode.Name;
                    purchaseOrderInfo.ShippingModeId = radioShippingMode.SelectedValue.Value;
                    purchaseOrderInfo.ModeName = shippingMode.Name;
                    purchaseOrderInfo.AdjustedFreight = SubsiteSalesHelper.CalcFreight(purchaseOrderInfo.RegionId, totalWeight, shippingMode);
                    purchaseOrderInfo.Freight = purchaseOrderInfo.AdjustedFreight;
                    purchaseOrderInfo.ShippingRegion = rsddlRegion.SelectedRegions;
                    purchaseOrderInfo.PurchaseStatus = OrderStatus.WaitBuyerPay;
                    purchaseOrderInfo.DistributorId = user.UserId;
                    purchaseOrderInfo.Distributorname = user.Username;
                    purchaseOrderInfo.DistributorEmail = user.Email;
                    purchaseOrderInfo.DistributorRealName = user.RealName;
                    purchaseOrderInfo.DistributorQQ = user.QQ;
                    purchaseOrderInfo.DistributorWangwang = user.Wangwang;
                    purchaseOrderInfo.DistributorMSN = user.MSN;
                    purchaseOrderInfo.RefundStatus = RefundStatus.None;
                    purchaseOrderInfo.Weight = totalWeight;
                    purchaseOrderInfo.Remark = null;
                    purchaseOrderInfo.TaobaoOrderId = str;
                    if (purchaseOrderInfo.PurchaseOrderItems.Count == 0)
                    {
                        ShowMsg("您暂时未选择您要添加的商品", false);
                    }
                    else if (SubsiteSalesHelper.CreatePurchaseOrder(purchaseOrderInfo))
                    {
                        SubsiteSalesHelper.ClearPurchaseShoppingCart();
                        ResponseCookies();
                        base.Response.Redirect(Globals.ApplicationPath + "/Shopadmin/purchaseOrder/Pay.aspx?PurchaseOrderId=" + purchaseOrderInfo.PurchaseOrderId);
                    }
                    else
                    {
                        ShowMsg("提交采购单失败", false);
                    }
                }
            }
        }
Ejemplo n.º 25
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;
 }
Ejemplo n.º 26
0
 public override bool SavePurchaseOrderShippingAddress(PurchaseOrderInfo purchaseOrder)
 {
     if (purchaseOrder == null)
     {
         return false;
     }
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_PurchaseOrders SET RegionId = @RegionId, ShippingRegion = @ShippingRegion, Address = @Address, ZipCode = @ZipCode,ShipTo = @ShipTo, TelPhone = @TelPhone, CellPhone = @CellPhone WHERE PurchaseOrderId = @PurchaseOrderId");
     database.AddInParameter(sqlStringCommand, "RegionId", DbType.String, purchaseOrder.RegionId);
     database.AddInParameter(sqlStringCommand, "ShippingRegion", DbType.String, purchaseOrder.ShippingRegion);
     database.AddInParameter(sqlStringCommand, "Address", DbType.String, purchaseOrder.Address);
     database.AddInParameter(sqlStringCommand, "ZipCode", DbType.String, purchaseOrder.ZipCode);
     database.AddInParameter(sqlStringCommand, "ShipTo", DbType.String, purchaseOrder.ShipTo);
     database.AddInParameter(sqlStringCommand, "TelPhone", DbType.String, purchaseOrder.TelPhone);
     database.AddInParameter(sqlStringCommand, "CellPhone", DbType.String, purchaseOrder.CellPhone);
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     return (database.ExecuteNonQuery(sqlStringCommand) == 1);
 }
Ejemplo n.º 27
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;
 }
Ejemplo n.º 28
0
 public static PurchaseOrderInfo PopulatePurchaseOrder(IDataReader reader)
 {
     if (reader == null)
     {
         return null;
     }
     PurchaseOrderInfo info = new PurchaseOrderInfo();
     info.PurchaseOrderId = (string) reader["PurchaseOrderId"];
     if (DBNull.Value != reader["OrderId"])
     {
         info.OrderId = (string) reader["OrderId"];
     }
     if (DBNull.Value != reader["ManagerMark"])
     {
         info.ManagerMark = new OrderMark?((OrderMark) reader["ManagerMark"]);
     }
     if (DBNull.Value != reader["Remark"])
     {
         info.Remark = (string) reader["Remark"];
     }
     if (DBNull.Value != reader["ManagerRemark"])
     {
         info.ManagerRemark = (string) reader["ManagerRemark"];
     }
     if (DBNull.Value != reader["AdjustedDiscount"])
     {
         info.AdjustedDiscount = (decimal) reader["AdjustedDiscount"];
     }
     if (DBNull.Value != reader["PurchaseStatus"])
     {
         info.PurchaseStatus = (OrderStatus) reader["PurchaseStatus"];
     }
     if (DBNull.Value != reader["CloseReason"])
     {
         info.CloseReason = (string) reader["CloseReason"];
     }
     info.PurchaseDate = (DateTime) reader["PurchaseDate"];
     if (DBNull.Value != reader["PayDate"])
     {
         info.PayDate = (DateTime) reader["PayDate"];
     }
     if (DBNull.Value != reader["ShippingDate"])
     {
         info.ShippingDate = (DateTime) reader["ShippingDate"];
     }
     if (DBNull.Value != reader["FinishDate"])
     {
         info.FinishDate = (DateTime) reader["FinishDate"];
     }
     info.DistributorId = (int) reader["DistributorId"];
     info.Distributorname = (string) reader["Distributorname"];
     if (DBNull.Value != reader["DistributorEmail"])
     {
         info.DistributorEmail = (string) reader["DistributorEmail"];
     }
     if (DBNull.Value != reader["DistributorRealName"])
     {
         info.DistributorRealName = (string) reader["DistributorRealName"];
     }
     if (DBNull.Value != reader["DistributorQQ"])
     {
         info.DistributorQQ = (string) reader["DistributorQQ"];
     }
     if (DBNull.Value != reader["DistributorWangwang"])
     {
         info.DistributorWangwang = (string) reader["DistributorWangwang"];
     }
     if (DBNull.Value != reader["DistributorMSN"])
     {
         info.DistributorMSN = (string) reader["DistributorMSN"];
     }
     if (DBNull.Value != reader["ShippingRegion"])
     {
         info.ShippingRegion = (string) reader["ShippingRegion"];
     }
     if (DBNull.Value != reader["Address"])
     {
         info.Address = (string) reader["Address"];
     }
     if (DBNull.Value != reader["ZipCode"])
     {
         info.ZipCode = (string) reader["ZipCode"];
     }
     if (DBNull.Value != reader["ShipTo"])
     {
         info.ShipTo = (string) reader["ShipTo"];
     }
     if (DBNull.Value != reader["TelPhone"])
     {
         info.TelPhone = (string) reader["TelPhone"];
     }
     if (DBNull.Value != reader["CellPhone"])
     {
         info.CellPhone = (string) reader["CellPhone"];
     }
     if (DBNull.Value != reader["ShippingModeId"])
     {
         info.ShippingModeId = (int) reader["ShippingModeId"];
     }
     if (DBNull.Value != reader["ModeName"])
     {
         info.ModeName = (string) reader["ModeName"];
     }
     if (DBNull.Value != reader["RealShippingModeId"])
     {
         info.RealShippingModeId = (int) reader["RealShippingModeId"];
     }
     if (DBNull.Value != reader["RealModeName"])
     {
         info.RealModeName = (string) reader["RealModeName"];
     }
     if (DBNull.Value != reader["RegionId"])
     {
         info.RegionId = (int) reader["RegionId"];
     }
     if (DBNull.Value != reader["Freight"])
     {
         info.Freight = (decimal) reader["Freight"];
     }
     if (DBNull.Value != reader["AdjustedFreight"])
     {
         info.AdjustedFreight = (decimal) reader["AdjustedFreight"];
     }
     if (DBNull.Value != reader["ShipOrderNumber"])
     {
         info.ShipOrderNumber = (string) reader["ShipOrderNumber"];
     }
     if (DBNull.Value != reader["Weight"])
     {
         info.Weight = (int) reader["Weight"];
     }
     if (DBNull.Value != reader["RefundStatus"])
     {
         info.RefundStatus = (RefundStatus) reader["RefundStatus"];
     }
     if (DBNull.Value != reader["RefundAmount"])
     {
         info.RefundAmount = (decimal) reader["RefundAmount"];
     }
     if (DBNull.Value != reader["RefundRemark"])
     {
         info.RefundRemark = (string) reader["RefundRemark"];
     }
     if (DBNull.Value != reader["OrderTotal"])
     {
         info.OrderTotal = (decimal) reader["OrderTotal"];
     }
     if (DBNull.Value != reader["ExpressCompanyName"])
     {
         info.ExpressCompanyName = (string) reader["ExpressCompanyName"];
     }
     if (DBNull.Value != reader["ExpressCompanyAbb"])
     {
         info.ExpressCompanyAbb = (string) reader["ExpressCompanyAbb"];
     }
     return info;
 }
Ejemplo n.º 29
0
 private PurchaseOrderInfo GetPurchaseOrderInfo()
 {
     PurchaseOrderInfo info = new PurchaseOrderInfo();
     Distributor user = Users.GetUser(HiContext.Current.User.UserId) as Distributor;
     string orderId = GeneratePurchaseOrderId();
     info.PurchaseOrderId = orderId;
     IList<PurchaseShoppingCartItemInfo> purchaseShoppingCartItemInfos = SubsiteSalesHelper.GetPurchaseShoppingCartItemInfos();
     int totalWeight = 0;
     if (purchaseShoppingCartItemInfos.Count >= 1)
     {
         PurchaseOrderItemInfo item = null;
         foreach (PurchaseShoppingCartItemInfo info2 in purchaseShoppingCartItemInfos)
         {
             item = new PurchaseOrderItemInfo();
             item.PurchaseOrderId = orderId;
             item.SkuId = info2.SkuId;
             item.ThumbnailsUrl = info2.ThumbnailsUrl;
             item.SKUContent = info2.SKUContent;
             item.SKU = info2.SKU;
             item.Quantity = info2.Quantity;
             item.ProductId = info2.ProductId;
             item.ItemWeight = info2.ItemWeight;
             item.ItemCostPrice = info2.CostPrice;
             item.ItemPurchasePrice = info2.ItemPurchasePrice;
             item.ItemListPrice = info2.ItemListPrice;
             item.ItemDescription = info2.ItemDescription;
             item.ItemHomeSiteDescription = info2.ItemDescription;
             totalWeight += info2.ItemWeight * info2.Quantity;
             info.PurchaseOrderItems.Add(item);
         }
         ShippingModeInfo shippingMode = SubsiteSalesHelper.GetShippingMode(radioShippingMode.SelectedValue.Value, true);
         info.ShipTo = txtShipTo.Text.Trim();
         if (rsddlRegion.GetSelectedRegionId().HasValue)
         {
             info.RegionId = rsddlRegion.GetSelectedRegionId().Value;
         }
         info.Address = Globals.HtmlEncode(txtAddress.Value.Trim());
         info.TelPhone = txtTel.Text.Trim();
         info.ZipCode = txtZipcode.Text.Trim();
         info.CellPhone = txtMobile.Text.Trim();
         info.OrderId = null;
         info.RealShippingModeId = radioShippingMode.SelectedValue.Value;
         info.RealModeName = shippingMode.Name;
         info.ShippingModeId = radioShippingMode.SelectedValue.Value;
         info.ModeName = shippingMode.Name;
         info.AdjustedFreight = SubsiteSalesHelper.CalcFreight(info.RegionId, totalWeight, shippingMode);
         info.Freight = info.AdjustedFreight;
         info.ShippingRegion = rsddlRegion.SelectedRegions;
         info.Remark = Globals.HtmlEncode(txtRemark.Text.Trim());
         info.PurchaseStatus = OrderStatus.WaitBuyerPay;
         info.DistributorId = user.UserId;
         info.Distributorname = user.Username;
         info.DistributorEmail = user.Email;
         info.DistributorRealName = user.RealName;
         info.DistributorQQ = user.QQ;
         info.DistributorWangwang = user.Wangwang;
         info.DistributorMSN = user.MSN;
         info.RefundStatus = RefundStatus.None;
         info.Weight = totalWeight;
         info.ExpressCompanyAbb = shippingMode.ExpressCompanyAbb;
         info.ExpressCompanyName = shippingMode.ExpressCompanyName;
     }
     return info;
 }
Ejemplo n.º 30
0
 public override bool SendPurchaseOrderGoods(PurchaseOrderInfo purchaseOrder)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_PurchaseOrders SET ShipOrderNumber = @ShipOrderNumber, RealShippingModeId = @RealShippingModeId, RealModeName = @RealModeName, PurchaseStatus = @PurchaseStatus,ShippingDate=@ShippingDate, ExpressCompanyName = @ExpressCompanyName , ExpressCompanyAbb = @ExpressCompanyAbb WHERE PurchaseOrderId = @PurchaseOrderId");
     database.AddInParameter(sqlStringCommand, "ShipOrderNumber", DbType.String, purchaseOrder.ShipOrderNumber);
     database.AddInParameter(sqlStringCommand, "RealShippingModeId", DbType.Int32, purchaseOrder.RealShippingModeId);
     database.AddInParameter(sqlStringCommand, "RealModeName", DbType.String, purchaseOrder.RealModeName);
     database.AddInParameter(sqlStringCommand, "PurchaseStatus", DbType.Int32, 3);
     database.AddInParameter(sqlStringCommand, "ShippingDate", DbType.DateTime, DateTime.Now);
     database.AddInParameter(sqlStringCommand, "ExpressCompanyName", DbType.String, purchaseOrder.ExpressCompanyName);
     database.AddInParameter(sqlStringCommand, "ExpressCompanyAbb", DbType.String, purchaseOrder.ExpressCompanyAbb);
     database.AddInParameter(sqlStringCommand, "PurchaseOrderId", DbType.String, purchaseOrder.PurchaseOrderId);
     return (database.ExecuteNonQuery(sqlStringCommand) == 1);
 }