Example #1
0
 public void btnSave_Click(object sender, EventArgs e)
 {
     Maticsoft.Model.Shop.Shipping.ShippingType model = new Maticsoft.Model.Shop.Shipping.ShippingType {
         AddPrice = new decimal?(Globals.SafeDecimal(this.tAddPrice.Text, (decimal) 0M)),
         Price = Globals.SafeDecimal(this.tPrice.Text, (decimal) 0M),
         Weight = Globals.SafeInt(this.tWeight.Text, 0),
         AddWeight = new int?(Globals.SafeInt(this.tAddWeight.Text, 0)),
         Description = this.tDesc.Text,
         DisplaySequence = -1,
         ExpressCompanyName = this.ddlType.SelectedItem.Text,
         ExpressCompanyEn = this.ddlType.SelectedValue,
         Name = this.tName.Text
     };
     int num = this.typeBll.Add(model);
     if (num > 0)
     {
         for (int i = 0; i < this.ckPayType.Items.Count; i++)
         {
             if (this.ckPayType.Items[i].Selected)
             {
                 Maticsoft.Model.Shop.Shipping.ShippingPayment payment = new Maticsoft.Model.Shop.Shipping.ShippingPayment {
                     PaymentModeId = Globals.SafeInt(this.ckPayType.Items[i].Value, 0),
                     ShippingModeId = num
                 };
                 this.payBll.Add(payment);
             }
         }
         base.Response.Redirect("ShippingType.aspx");
     }
     else
     {
         MessageBox.ShowFailTip(this, "添加失败!请重试。");
     }
 }
Example #2
0
 public Maticsoft.Model.Shop.Shipping.ShippingType DataRowToModel(DataRow row)
 {
     Maticsoft.Model.Shop.Shipping.ShippingType type = new Maticsoft.Model.Shop.Shipping.ShippingType();
     if (row != null)
     {
         if ((row["ModeId"] != null) && (row["ModeId"].ToString() != ""))
         {
             type.ModeId = int.Parse(row["ModeId"].ToString());
         }
         if (row["Name"] != null)
         {
             type.Name = row["Name"].ToString();
         }
         if ((row["Weight"] != null) && (row["Weight"].ToString() != ""))
         {
             type.Weight = int.Parse(row["Weight"].ToString());
         }
         if ((row["AddWeight"] != null) && (row["AddWeight"].ToString() != ""))
         {
             type.AddWeight = new int?(int.Parse(row["AddWeight"].ToString()));
         }
         if ((row["Price"] != null) && (row["Price"].ToString() != ""))
         {
             type.Price = decimal.Parse(row["Price"].ToString());
         }
         if ((row["AddPrice"] != null) && (row["AddPrice"].ToString() != ""))
         {
             type.AddPrice = new decimal?(decimal.Parse(row["AddPrice"].ToString()));
         }
         if (row["Description"] != null)
         {
             type.Description = row["Description"].ToString();
         }
         if ((row["DisplaySequence"] != null) && (row["DisplaySequence"].ToString() != ""))
         {
             type.DisplaySequence = int.Parse(row["DisplaySequence"].ToString());
         }
         if (row["ExpressCompanyName"] != null)
         {
             type.ExpressCompanyName = row["ExpressCompanyName"].ToString();
         }
         if (row["ExpressCompanyEn"] != null)
         {
             type.ExpressCompanyEn = row["ExpressCompanyEn"].ToString();
         }
     }
     return type;
 }
Example #3
0
 public ActionResult ShowPayAndShip(int payId = -1, int shipId = -1, string sku = new string(), int count = 1, int c = -1, string viewName = "_ShowPayAndShip")
 {
     ShoppingCartInfo shoppingCart;
     PayAndShip model = new PayAndShip {
         ListPaymentMode = PaymentModeManage.GetPaymentModes()
     };
     if (payId > 0)
     {
         model.CurrentPaymentMode = PaymentModeManage.GetPaymentModeById(payId);
     }
     else if ((model.ListPaymentMode != null) && (model.ListPaymentMode.Count > 0))
     {
         model.CurrentPaymentMode = model.ListPaymentMode[0];
         model.ListShippingType = this._shippingTypeManage.GetListByPay(model.CurrentPaymentMode.ModeId);
     }
     else
     {
         PaymentModeInfo info = new PaymentModeInfo {
             ModeId = -1,
             Name = "未选择支付方式"
         };
         model.CurrentPaymentMode = info;
     }
     if (shipId > 0)
     {
         model.CurrentShippingType = this._shippingTypeManage.GetModelByCache(shipId);
     }
     else if ((model.ListShippingType != null) && (model.ListShippingType.Count > 0))
     {
         model.CurrentShippingType = model.ListShippingType[0];
     }
     else
     {
         Maticsoft.Model.Shop.Shipping.ShippingType type = new Maticsoft.Model.Shop.Shipping.ShippingType {
             ModeId = -1,
             Name = "未选择配送方式"
         };
         model.CurrentShippingType = type;
     }
     if (string.IsNullOrWhiteSpace(sku))
     {
         int userId = (base.currentUser == null) ? -1 : base.currentUser.UserID;
         shoppingCart = new ShoppingCartHelper(userId).GetShoppingCart();
     }
     else
     {
         Maticsoft.BLL.Shop.Products.SKUInfo info3 = new Maticsoft.BLL.Shop.Products.SKUInfo();
         Maticsoft.BLL.Shop.Products.ProductInfo info4 = new Maticsoft.BLL.Shop.Products.ProductInfo();
         Maticsoft.Model.Shop.Products.SKUInfo modelBySKU = info3.GetModelBySKU(sku);
         if (modelBySKU == null)
         {
             ((dynamic) base.ViewBag).Freight = 0;
             return base.View(viewName, model);
         }
         Maticsoft.Model.Shop.Products.ProductInfo productInfo = info4.GetModel(modelBySKU.ProductId);
         if (productInfo == null)
         {
             ((dynamic) base.ViewBag).Freight = 0;
             return base.View(viewName, model);
         }
         Maticsoft.Model.Shop.Products.ProductInfo proSaleInfo = null;
         if (c > 0)
         {
             proSaleInfo = info4.GetProSaleModel(c);
             if (proSaleInfo == null)
             {
                 ((dynamic) base.ViewBag).Freight = 0;
                 return base.View(viewName, model);
             }
         }
         shoppingCart = this.GetCartInfo4SKU(productInfo, modelBySKU, count, proSaleInfo);
     }
     ((dynamic) base.ViewBag).Freight = shoppingCart.CalcFreight(model.CurrentShippingType);
     return base.View(viewName, model);
 }
Example #4
0
 public ActionResult PayAndShipInfo(int payId = -1, int shipId = -1, string viewName = "_PayAndShipInfo")
 {
     PayAndShip model = new PayAndShip {
         ListPaymentMode = PaymentModeManage.GetPaymentModes()
     };
     if (payId > 0)
     {
         model.CurrentPaymentMode = PaymentModeManage.GetPaymentModeById(payId);
         model.ListShippingType = this._shippingTypeManage.GetListByPay(payId);
     }
     else if ((model.ListPaymentMode != null) && (model.ListPaymentMode.Count > 0))
     {
         model.CurrentPaymentMode = model.ListPaymentMode[0];
         model.ListShippingType = this._shippingTypeManage.GetListByPay(model.CurrentPaymentMode.ModeId);
     }
     else
     {
         PaymentModeInfo info = new PaymentModeInfo {
             ModeId = -1,
             Name = "当前网站未设置任何支付方式"
         };
         model.CurrentPaymentMode = info;
         model.ListPaymentMode = new List<PaymentModeInfo> { model.CurrentPaymentMode };
     }
     if (shipId > 0)
     {
         model.CurrentShippingType = this._shippingTypeManage.GetModelByCache(shipId);
     }
     else if ((model.ListShippingType != null) && (model.ListShippingType.Count > 0))
     {
         model.CurrentShippingType = model.ListShippingType[0];
     }
     else
     {
         Maticsoft.Model.Shop.Shipping.ShippingType type = new Maticsoft.Model.Shop.Shipping.ShippingType {
             ModeId = -1,
             Name = "当前支付方式未设置任何配送",
             Description = "请选择其它支付方式"
         };
         model.CurrentShippingType = type;
         model.ListShippingType = new List<Maticsoft.Model.Shop.Shipping.ShippingType> { model.CurrentShippingType };
     }
     return base.View(viewName, model);
 }
Example #5
0
 public ActionResult ShowPayAndShip(string viewName = "_ShowPayAndShip")
 {
     PayAndShip model = new PayAndShip();
     int modeId = Globals.SafeInt(base.Request.Params["payId"], 0);
     int num2 = Globals.SafeInt(base.Request.QueryString["shipId"], 0);
     model.ListPaymentMode = PaymentModeManage.GetPaymentModes();
     if (modeId > 0)
     {
         model.CurrentPaymentMode = PaymentModeManage.GetPaymentModeById(modeId);
     }
     else if ((model.ListPaymentMode != null) && (model.ListPaymentMode.Count > 0))
     {
         model.CurrentPaymentMode = model.ListPaymentMode[0];
         model.ListShippingType = this._shippingTypeManage.GetListByPay(model.CurrentPaymentMode.ModeId);
     }
     else
     {
         PaymentModeInfo info = new PaymentModeInfo {
             ModeId = -1,
             Name = "未选择支付方式"
         };
         model.CurrentPaymentMode = info;
     }
     if (num2 > 0)
     {
         model.CurrentShippingType = this._shippingTypeManage.GetModelByCache(num2);
     }
     else if ((model.ListShippingType != null) && (model.ListShippingType.Count > 0))
     {
         model.CurrentShippingType = model.ListShippingType[0];
     }
     else
     {
         Maticsoft.Model.Shop.Shipping.ShippingType type = new Maticsoft.Model.Shop.Shipping.ShippingType {
             ModeId = -1,
             Name = "未选择配送方式"
         };
         model.CurrentShippingType = type;
     }
     ShoppingCartInfo shoppingCart = new ShoppingCartInfo();
     int userId = (base.currentUser == null) ? -1 : base.currentUser.UserID;
     shoppingCart = new ShoppingCartHelper(userId).GetShoppingCart();
     ((dynamic) base.ViewBag).Freight = shoppingCart.CalcFreight(model.CurrentShippingType);
     return base.View(viewName, model);
 }
Example #6
0
 public ActionResult PayAndShipInfo(string viewName = "PayAndShipInfo")
 {
     PayAndShip model = new PayAndShip {
         ListPaymentMode = PaymentModeManage.GetPaymentModes()
     };
     int modeId = Globals.SafeInt(base.Request.Params["payId"], 0);
     int num2 = Globals.SafeInt(base.Request.QueryString["shipId"], 0);
     if (modeId > 0)
     {
         model.CurrentPaymentMode = PaymentModeManage.GetPaymentModeById(modeId);
         model.ListShippingType = this._shippingTypeManage.GetListByPay(modeId);
     }
     else if ((model.ListPaymentMode != null) && (model.ListPaymentMode.Count > 0))
     {
         model.CurrentPaymentMode = model.ListPaymentMode[0];
         model.ListShippingType = this._shippingTypeManage.GetListByPay(model.CurrentPaymentMode.ModeId);
     }
     else
     {
         PaymentModeInfo info = new PaymentModeInfo {
             ModeId = -1,
             Name = "当前网站未设置任何支付方式"
         };
         model.CurrentPaymentMode = info;
         model.ListPaymentMode = new List<PaymentModeInfo> { model.CurrentPaymentMode };
     }
     if (num2 > 0)
     {
         model.CurrentShippingType = this._shippingTypeManage.GetModelByCache(num2);
     }
     else if ((model.ListShippingType != null) && (model.ListShippingType.Count > 0))
     {
         model.CurrentShippingType = model.ListShippingType[0];
     }
     else
     {
         Maticsoft.Model.Shop.Shipping.ShippingType type = new Maticsoft.Model.Shop.Shipping.ShippingType {
             ModeId = -1,
             Name = "当前支付方式未设置任何配送",
             Description = "请选择其它支付方式"
         };
         model.CurrentShippingType = type;
         model.ListShippingType = new List<Maticsoft.Model.Shop.Shipping.ShippingType> { model.CurrentShippingType };
     }
     ((dynamic) base.ViewBag).PayId = modeId;
     ((dynamic) base.ViewBag).ShipId = num2;
     return base.View(viewName, model);
 }