/// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();

            user        = UserBLL.ReadUserMore(base.UserId);
            userGradeId = UserGradeBLL.Read(base.GradeID).Id;
            string action = RequestHelper.GetQueryString <string>("Action");

            if (action == "Delete")
            {
                string deleteID = RequestHelper.GetQueryString <string>("ID");
                ProductCollectBLL.Delete(Array.ConvertAll(deleteID.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), k => Convert.ToInt32(k)), base.UserId);
                ResponseHelper.Write("ok");
                ResponseHelper.End();
            }

            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 20;
            int count    = 0;

            productCollectList = ProductCollectBLL.ReadList(currentPage, pageSize, ref count, base.UserId);
            //commonPagerClass.CurrentPage = currentPage;
            //commonPagerClass.PageSize = pageSize;
            //commonPagerClass.Count = count;
            //commonPagerClass.FirstPage = "<<首页";
            //commonPagerClass.PreviewPage = "<<上一页";
            //commonPagerClass.NextPage = "下一页>>";
            //commonPagerClass.LastPage = "末页>>";
            //commonPagerClass.ListType = false;
            //commonPagerClass.DisCount = false;
            //commonPagerClass.PrenextType = true;
            commonPagerClass.Init(currentPage, pageSize, count, !string.IsNullOrEmpty(isMobile));

            string strProductID = string.Empty;

            foreach (ProductCollectInfo productCollect in productCollectList)
            {
                if (strProductID == string.Empty)
                {
                    strProductID = productCollect.ProductId.ToString();
                }
                else
                {
                    strProductID += "," + productCollect.ProductId.ToString();
                }
            }

            if (strProductID != string.Empty)
            {
                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.InProductId = strProductID;
                productList = ProductBLL.SearchList(productSearch);
            }
        }
Example #2
0
 private void CheckAdminLogin()
 {
     if (Cookies.Admin.GetAdminID(true) == 0)
     {
         ResponseHelper.Write("<script language='javascript'>window.parent.location.href='Login.aspx';</script>");
         ResponseHelper.End();
     }
 }
Example #3
0
 ///<summary>
 /// 验证用户是否登陆
 ///</summary>
 protected void CheckUserLogin()
 {
     if (UserId == 0)
     {
         ResponseHelper.Write("<script language='javascript'>window.location.href='/user/login.html?RedirectUrl=" + Request.RawUrl + "';</script>");
         ResponseHelper.End();
     }
 }
Example #4
0
 protected void CheckUserLogin()
 {
     if (this.UserID == 0)
     {
         ResponseHelper.Write("<script language='javascript'>window.location.href='/User/Login.aspx';</script>");
         ResponseHelper.End();
     }
 }
Example #5
0
 private void ClearCart()
 {
     CartBLL.ClearCart(base.UserID);
     Sessions.ProductBuyCount    = 0;
     Sessions.ProductTotalPrice  = 0M;
     Sessions.ProductTotalWeight = 0M;
     ResponseHelper.End();
 }
Example #6
0
        /// <summary>
        /// 删除发信箱
        /// </summary>
        protected void DeleteSendMessage()
        {
            string selectID = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("SelectID"));

            SendMessageBLL.DeleteSendMessage(selectID, base.UserID);
            ResponseHelper.Write("ok");
            ResponseHelper.End();
        }
Example #7
0
 ///<summary>
 /// 验证用户是否登陆
 ///</summary>
 private void CheckAdminLogin()
 {
     if (Cookies.Admin.GetAdminID(true) == 0)
     {
         ResponseHelper.Write("<script language='javascript'>window.parent.location.href='/MobileAdmin/Login.html?redirecturl=" + RequestHelper.RawUrl + "';</script>");
         ResponseHelper.End();
     }
 }
Example #8
0
        /// <summary>
        /// 统一编辑
        /// </summary>
        protected void UnionEdit()
        {
            string      productIDList = RequestHelper.GetQueryString <string>("ProductIDList");
            ProductInfo product       = new ProductInfo();

            if (RequestHelper.GetQueryString <string>("Weight") != string.Empty)
            {
                product.Weight = RequestHelper.GetQueryString <int>("Weight");
            }
            else
            {
                product.Weight = -2;
            }
            if (RequestHelper.GetQueryString <string>("MarketPrice") != string.Empty)
            {
                product.MarketPrice = RequestHelper.GetQueryString <decimal>("MarketPrice");
            }
            else
            {
                product.MarketPrice = -2;
            }
            if (RequestHelper.GetQueryString <string>("SendPoint") != string.Empty)
            {
                product.SendPoint = RequestHelper.GetQueryString <int>("SendPoint");
            }
            else
            {
                product.SendPoint = -2;
            }
            if (RequestHelper.GetQueryString <string>("TotalStorageCount") != string.Empty)
            {
                product.TotalStorageCount = RequestHelper.GetQueryString <int>("TotalStorageCount");
            }
            else
            {
                product.TotalStorageCount = -2;
            }
            if (RequestHelper.GetQueryString <string>("LowerCount") != string.Empty)
            {
                product.LowerCount = RequestHelper.GetQueryString <int>("LowerCount");
            }
            else
            {
                product.LowerCount = -2;
            }
            if (RequestHelper.GetQueryString <string>("UpperCount") != string.Empty)
            {
                product.UpperCount = RequestHelper.GetQueryString <int>("UpperCount");
            }
            else
            {
                product.UpperCount = -2;
            }
            ProductBLL.UnionUpdateProduct(productIDList, product);

            ResponseHelper.Write(ShopLanguage.ReadLanguage("UpdateOK"));
            ResponseHelper.End();
        }
Example #9
0
        protected void Paste()
        {
            string queryString = RequestHelper.GetQueryString <string>("FileList");
            string str2        = RequestHelper.GetQueryString <string>("SourceAction");
            string str3        = ServerHelper.MapPath(RequestHelper.GetQueryString <string>("Path"));

            if (RequestHelper.GetQueryString <string>("Path").ToLower().StartsWith("/upload/harddisk/"))
            {
                try
                {
                    if (queryString != string.Empty)
                    {
                        foreach (string str4 in queryString.Split(new char[] { '|' }))
                        {
                            if (str4.ToLower().StartsWith("/upload/harddisk/"))
                            {
                                string path = ServerHelper.MapPath(str4);
                                if (File.Exists(path))
                                {
                                    string str6 = path.Substring(path.LastIndexOf(@"\"));
                                    if (str2 == "Cut")
                                    {
                                        File.Move(path, str3 + str6);
                                    }
                                    else
                                    {
                                        File.Copy(path, str3 + str6);
                                    }
                                }
                                else if (Directory.Exists(path))
                                {
                                    string str7 = path.Substring(0, path.Length - 1);
                                    str7 = str7.Substring(str7.LastIndexOf(@"\"));
                                    if (str2 == "Cut")
                                    {
                                        Directory.Move(path, str3 + str7 + @"\");
                                    }
                                    else
                                    {
                                        FileHelper.CopyDirectory(path, str3 + str7 + @"\");
                                    }
                                }
                            }
                        }
                    }
                    ResponseHelper.Write("ok");
                }
                catch
                {
                    ResponseHelper.Write("error");
                }
            }
            else
            {
                ResponseHelper.Write("error");
            }
            ResponseHelper.End();
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClearCache();

            //订单产品操作
            string action = RequestHelper.GetQueryString <string>("Action");

            if (!string.IsNullOrEmpty(action))
            {
                int       tempOrderId = RequestHelper.GetQueryString <int>("OrderId");
                OrderInfo tempOrder   = OrderBLL.Read(tempOrderId);
                int       isCod       = PayPlugins.ReadPayPlugins(tempOrder.PayKey).IsCod;
                if ((tempOrder.OrderStatus == (int)OrderStatus.WaitPay || tempOrder.OrderStatus == (int)OrderStatus.WaitCheck && isCod == (int)BoolType.True) && (tempOrder.IsActivity == (int)OrderKind.Common || tempOrder.IsActivity == (int)OrderKind.GroupBuy))
                {
                    switch (action)
                    {
                    case "DeleteOrderProduct":
                        DeleteOrderProduct();
                        break;

                    case "ChangeOrderProductBuyCount":
                        ChangeOrderProductBuyCount();
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    ResponseHelper.Write("订单已经审核,无法修改");
                    ResponseHelper.End();
                }
            }

            //读取订单产品
            int orderId = RequestHelper.GetQueryString <int>("Id");

            if (orderId != int.MinValue)
            {
                CheckAdminPower("ReadOrder", PowerCheckType.Single);
                order = OrderBLL.Read(orderId);
                int isCod = PayPlugins.ReadPayPlugins(order.PayKey).IsCod;
                if ((order.OrderStatus == (int)OrderStatus.WaitPay || order.OrderStatus == (int)OrderStatus.WaitCheck && isCod == (int)BoolType.True) && (order.IsActivity == (int)OrderKind.Common || order.IsActivity == (int)OrderKind.GroupBuy))
                {
                    canEdit = true;
                }
                orderDetailList = OrderDetailBLL.ReadList(orderId);

                foreach (OrderDetailInfo orderDetail in orderDetailList)
                {
                    totalProductCount += orderDetail.BuyCount;
                    totalWeight       += orderDetail.BuyCount * orderDetail.ProductWeight;
                    totalPoint        += orderDetail.BuyCount * orderDetail.SendPoint;
                }
            }
        }
Example #11
0
        //计算商品优惠金额
        protected void SelectProductFavor()
        {
            decimal favorMoney = 0;
            int     favorId    = RequestHelper.GetQueryString <int>("favorId");

            if (favorId > 0)
            {
                var theFavor = FavorableActivityBLL.Read(favorId);
                checkCart = HttpUtility.UrlDecode(CookiesHelper.ReadCookieValue("CheckCart"));
                int[] cartIds = Array.ConvertAll <string, int>(checkCart.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), k => Convert.ToInt32(k));
                cartList = CartBLL.ReadList(base.UserId);
                cartList = cartList.Where(k => cartIds.Contains(k.Id)).ToList();
                //关联的商品
                int   count       = 0;
                int[] ids         = cartList.Select(k => k.ProductId).ToArray();
                var   productList = ProductBLL.SearchList(1, ids.Length, new ProductSearchInfo {
                    InProductId = string.Join(",", ids)
                }, ref count);
                decimal tmoney = 0;
                foreach (var tmpcart in cartList)
                {
                    tmpcart.Product = productList.FirstOrDefault(k => k.Id == tmpcart.ProductId) ?? new ProductInfo();
                    if (tmpcart.Product.ClassId.IndexOf(theFavor.ClassIds) > -1)
                    {
                        if (!string.IsNullOrEmpty(tmpcart.StandardValueList))
                        {
                            //使用规格的库存
                            var standardRecord = ProductTypeStandardRecordBLL.Read(tmpcart.ProductId, tmpcart.StandardValueList);
                            tmpcart.LeftStorageCount = standardRecord.Storage - standardRecord.OrderCount;
                            tmpcart.Price            = ProductBLL.GetCurrentPrice(standardRecord.SalePrice, base.GradeID);
                            tmoney += tmpcart.Price * tmpcart.BuyCount;
                        }
                        else
                        {
                            tmpcart.Price = ProductBLL.GetCurrentPrice(tmpcart.Product.SalePrice, base.GradeID);
                            tmoney       += tmpcart.Price * tmpcart.BuyCount;
                        }
                    }
                }
                switch (theFavor.ReduceWay)
                {
                case (int)FavorableMoney.Money:
                    favorMoney += theFavor.ReduceMoney;
                    break;

                case (int)FavorableMoney.Discount:
                    favorMoney += tmoney * (100 - theFavor.ReduceDiscount) / 100;
                    break;

                default:
                    break;
                }
                ResponseHelper.Write("ok|" + Math.Round(favorMoney, 2));
            }
            ResponseHelper.End();
        }
Example #12
0
        protected override void PageLoad()
        {
            base.PageLoad();

            if (CurrentUser.UserType != (int)UserType.Provider)
            {
                ResponseHelper.Write("<script language='javascript'>alert('您不是供应商。');</script>");
                ResponseHelper.End();
            }
        }
Example #13
0
        private void GetStandardPrice()
        {
            int    id        = RequestHelper.GetQueryString <int>("id");
            string valueList = RequestHelper.GetQueryString <string>("value");

            var entity = ProductTypeStandardRecordBLL.Read(id, valueList);

            ResponseHelper.Write(entity.SalePrice.ToString("C") + "|" + (entity.Storage - entity.OrderCount));
            ResponseHelper.End();
        }
Example #14
0
        private void SelectShipping()
        {
            int shippingId = RequestHelper.GetQueryString <int>("shippingId");
            int addressId  = RequestHelper.GetQueryString <int>("addressId");

            string checkCart = HttpUtility.UrlDecode(CookiesHelper.ReadCookieValue("CheckCart"));

            int[] cartIds = Array.ConvertAll <string, int>(checkCart.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), k => Convert.ToInt32(k));
            if (string.IsNullOrEmpty(checkCart) || cartIds.Length < 1)
            {
                ResponseHelper.Write("error|请选择需要购买的商品");
                ResponseHelper.End();
            }

            var address = UserAddressBLL.Read(addressId, base.UserId);

            //计算配送费用
            List <CartInfo> cartList = CartBLL.ReadList(base.UserId).Where(k => cartIds.Contains(k.Id)).ToList();

            if (cartList.Count < 1)
            {
                ResponseHelper.Write("error|请选择需要购买的商品");
                ResponseHelper.End();
            }

            int count = 0;

            int[] ids         = cartList.Select(k => k.ProductId).ToArray();
            var   productList = ProductBLL.SearchList(1, ids.Length, new ProductSearchInfo {
                InProductId = string.Join(",", ids)
            }, ref count);

            cartList.ForEach(k => k.Product = productList.FirstOrDefault(k2 => k2.Id == k.ProductId) ?? new ProductInfo());

            decimal shippingMoney = 0;
            //首先根据ShopId分组,根据供应商的不同来分别计算运费
            //然后将分拆后的供应商商品,按单个商品独立计算运费(相同商品购买多个则叠加计算)
            ShippingInfo       shipping       = ShippingBLL.Read(shippingId);
            ShippingRegionInfo shippingRegion = ShippingRegionBLL.SearchShippingRegion(shippingId, address.RegionId);

            var shopIds = cartList.GroupBy(k => k.Product.ShopId).Select(k => k.Key).ToList();

            foreach (var shopId in shopIds)
            {
                var shopCartList = cartList.Where(k => k.Product.ShopId == shopId).ToList();
                foreach (var shopCartSplit in shopCartList)
                {
                    shippingMoney += ShippingRegionBLL.ReadShippingMoney(shipping, shippingRegion, shopCartSplit);
                }
            }

            //decimal shippingMoney = ShippingRegionBLL.ReadShippingMoney(shippingId, address.RegionId, cartList);
            ResponseHelper.Write("ok|" + Math.Round(shippingMoney, 2).ToString());
            ResponseHelper.End();
        }
Example #15
0
        /// <summary>
        /// 增加一条地区数据
        /// </summary>
        protected void AddRegion()
        {
            CheckAdminPower("ReadProduct", PowerCheckType.Single);
            RegionInfo region = new RegionInfo();

            region.FatherID   = RequestHelper.GetQueryString <int>("FatherID");
            region.RegionName = RequestHelper.GetQueryString <string>("RegionName");
            int id = RegionBLL.AddRegion(region);

            AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Region"), id);
            ResponseHelper.End();
        }
Example #16
0
        /// <summary>
        /// 删除订单中的商品
        /// </summary>
        protected void DeleteOrderProduct()
        {
            int strOrderDetailID = RequestHelper.GetQueryString <int>("StrOrderDetailID");
            int strProductID     = RequestHelper.GetQueryString <int>("StrProductID");
            int oldCount         = RequestHelper.GetQueryString <int>("OldCount");
            int orderId          = RequestHelper.GetQueryString <int>("OrderID");

            ProductBLL.ChangeOrderCount(strProductID, oldCount);
            OrderDetailBLL.Delete(strOrderDetailID);
            OrderUpdateHanlder(orderId);
            ResponseHelper.End();
        }
Example #17
0
        private void ReceiveShipping()
        {
            int id = RequestHelper.GetQueryString <int>("orderId");
            var pointProductOrder = PointProductOrderBLL.Read(id);

            if (pointProductOrder.OrderStatus == (int)PointProductOrderStatus.HasShipping)
            {
                pointProductOrder.OrderStatus = (int)PointProductOrderStatus.ReceiveShipping;
                PointProductOrderBLL.Update(pointProductOrder);
            }

            ResponseHelper.End();
        }
Example #18
0
        private void CheckSafeCode()
        {
            string result   = string.Empty;
            string safeCode = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("safecode"));

            if (safeCode.ToLower() != Cookies.Common.CheckCode.ToLower())
            {
                result = "验证码不正确";
            }
            result = string.Format(@"""{0}"": ""{1}""", string.IsNullOrEmpty(result) ? "ok" : "error", result);
            ResponseHelper.Write("{" + result + "}");
            ResponseHelper.End();
        }
Example #19
0
        private void CheckMobile()
        {
            string mobile = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("value"));

            if (!UserBLL.UniqueUser(mobile))
            {
                ResponseHelper.Write(JsonConvert.SerializeObject(new { error = "手机号码已被占用" }));
                ResponseHelper.End();
            }

            ResponseHelper.Write(JsonConvert.SerializeObject(new { ok = "" }));
            ResponseHelper.End();
        }
Example #20
0
        /// <summary>
        /// 添加留言
        /// </summary>
        protected void AddUserMessage()
        {
            string result             = string.Empty;
            int    messageClass       = RequestHelper.GetQueryString <int>("MessageClass");
            string title              = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Title"));
            string content            = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Content"));
            string userMessageCookies = CookiesHelper.ReadCookieValue("UserMessageCookies" + base.UserId.ToString());

            if (content == string.Empty || content == string.Empty)
            {
                result = "请填写标题和内容";
            }
            else
            {
                if (ShopConfig.ReadConfigInfo().CommentRestrictTime > 0 && !string.IsNullOrEmpty(userMessageCookies))
                {
                    string[] strArray = userMessageCookies.Split(new char[] { '|' });
                    string   _userId  = strArray[0];
                    string   _title   = strArray[1];
                    string   _content = strArray[2];
                    //如果该用户在限制时间内提交过相同title或content的内容,则不能再频繁提交
                    if (_userId == base.UserId.ToString() && (title == Server.UrlDecode(_title) || content == (Server.UrlDecode(_content))))
                    {
                        result = "请不要频繁提交相似留言";
                    }
                }
            }
            if (string.IsNullOrEmpty(result))
            {
                UserMessageInfo userMessage = new UserMessageInfo();
                userMessage.MessageClass      = messageClass;
                userMessage.Title             = title;
                userMessage.Content           = content;
                userMessage.UserIP            = ClientHelper.IP;
                userMessage.PostDate          = RequestHelper.DateNow;
                userMessage.IsHandler         = (int)BoolType.False;
                userMessage.AdminReplyContent = string.Empty;
                userMessage.AdminReplyDate    = RequestHelper.DateNow;
                userMessage.UserId            = base.UserId;
                userMessage.UserName          = base.UserName;
                UserMessageBLL.Add(userMessage);
                if (ShopConfig.ReadConfigInfo().CommentRestrictTime > 0)
                {
                    string cookieValue = base.UserId + "|" + Server.UrlEncode(title) + "|" + Server.UrlEncode(content);
                    CookiesHelper.AddCookie("UserMessageCookies" + base.UserId.ToString(), cookieValue, ShopConfig.ReadConfigInfo().CommentRestrictTime, TimeType.Second);
                }
            }

            ResponseHelper.Write(result);
            ResponseHelper.End();
        }
Example #21
0
        /// <summary>
        /// 隐藏订单
        /// </summary>
        private void DeleteOrder()
        {
            string result = "ok";

            int       orderID = RequestHelper.GetQueryString <int>("OrderID");
            int       userID  = RequestHelper.GetQueryString <int>("UserID");
            OrderInfo order   = OrderBLL.Read(orderID);

            order.IsDelete = 1;//隐藏订单
            OrderBLL.Update(order);

            ResponseHelper.Write(result);
            ResponseHelper.End();
        }
Example #22
0
        protected override void PageLoad()
        {
            base.PageLoad();
            if ((ShopConfig.ReadConfigInfo().AllowAnonymousAddCart == 1) && (base.UserID == 0))
            {
                ResponseHelper.Redirect("/User/Login.aspx");
                ResponseHelper.End();
            }
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.order      = OrderBLL.ReadOrder(queryString, base.UserID);
            this.payPlugins = PayPlugins.ReadPayPlugins(this.order.PayKey);
            base.Title      = "¶©µ¥Íê³É";
        }
Example #23
0
        protected void CheckPassword()
        {
            string result      = string.Empty;
            string oldPassword = StringHelper.Password(RequestHelper.GetForm <string>("OldPassword"), (PasswordType)ShopConfig.ReadConfigInfo().PasswordType);

            if (oldPassword != CurrentUser.UserPassword)
            {
                result = "旧密码错误";
            }

            result = string.Format(@"""{0}"": ""{1}""", string.IsNullOrEmpty(result) ? "ok" : "error", result);
            ResponseHelper.Write("{" + result + "}");
            ResponseHelper.End();
        }
Example #24
0
        protected void CheckUser(string field)
        {
            string result = string.Empty;
            string value  = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("value"));

            if (!string.IsNullOrEmpty(value) && !UserBLL.UniqueUser(value, base.UserId))
            {
                result = field + "已被占用";
            }

            result = string.Format(@"""{0}"": ""{1}""", string.IsNullOrEmpty(result) ? "ok" : "error", result);
            ResponseHelper.Write("{" + result + "}");
            ResponseHelper.End();
        }
Example #25
0
        private void Delete()
        {
            int id = RequestHelper.GetQueryString <int>("id");

            if (id < 1)
            {
                ResponseHelper.Write("error|无效的收货地址");
                ResponseHelper.End();
            }

            UserAddressBLL.Delete(id, base.UserId);
            ResponseHelper.Write("ok|");
            ResponseHelper.End();
        }
Example #26
0
        private void Submit()
        {
            int orderId       = RequestHelper.GetQueryString <int>("orderId");
            int orderDetailId = RequestHelper.GetQueryString <int>("orderDetailId");

            int     needRefundCount = RequestHelper.GetForm <int>("refund_count");
            decimal needRefundMoney = RequestHelper.GetForm <decimal>("refund_money");
            string  refundRemark    = StringHelper.AddSafe(RequestHelper.GetForm <string>("refund_remark"));

            OrderRefundInfo orderRefund = new OrderRefundInfo();

            orderRefund.RefundNumber = ShopCommon.CreateOrderRefundNumber();
            orderRefund.OrderId      = orderId;
            if (orderDetailId > 0)
            {
                orderRefund.OrderDetailId = orderDetailId;
                orderRefund.RefundCount   = needRefundCount;
            }
            orderRefund.Status       = (int)OrderRefundStatus.Submit;
            orderRefund.TmCreate     = DateTime.Now;
            orderRefund.RefundRemark = refundRemark;
            orderRefund.UserType     = 1;
            orderRefund.UserId       = base.UserId;
            orderRefund.UserName     = base.UserName;

            var refundMsg = JWRefund.VerifySubmitOrderRefund(orderRefund, needRefundMoney);

            if (refundMsg.CanRefund)
            {
                int id = OrderRefundBLL.Add(orderRefund);
                OrderRefundActionBLL.Add(new OrderRefundActionInfo
                {
                    OrderRefundId = id,
                    Status        = (int)BoolType.True,
                    Tm            = DateTime.Now,
                    UserType      = 1,
                    UserId        = base.UserId,
                    UserName      = base.UserName,
                    Remark        = "用户提交退款申请"
                });
                ResponseHelper.Write("ok|" + id);
                ResponseHelper.End();
            }
            else
            {
                ResponseHelper.Write("error|" + refundMsg.ErrorCodeMsg);
                ResponseHelper.End();
            }
        }
Example #27
0
        private void OrderOperate()
        {
            string content     = string.Empty;
            int    queryString = RequestHelper.GetQueryString <int>("OrderID");
            int    num2        = RequestHelper.GetQueryString <int>("OrderStatus");

            switch (num2)
            {
            case 1:
            case 2:
            case 5:
            {
                OrderInfo order = OrderBLL.ReadOrder(queryString, base.UserID);
                if (order.ID == 0)
                {
                    content = "不是属于当前用户的订单";
                }
                else
                {
                    int orderStatus;
                    if ((num2 == 2) || (num2 == 1))
                    {
                        orderStatus       = order.OrderStatus;
                        order.OrderStatus = 3;
                        ProductBLL.ChangeProductOrderCountByOrder(queryString, ChangeAction.Minus);
                        OrderBLL.UserUpdateOrderAddAction(order, "用户取消订单", 3, orderStatus);
                    }
                    else
                    {
                        int point = OrderBLL.ReadOrderSendPoint(order.ID);
                        if (point > 0)
                        {
                            UserAccountRecordBLL.AddUserAccountRecord(0M, point, ShopLanguage.ReadLanguage("OrderReceived").Replace("$OrderNumber", order.OrderNumber), order.UserID, order.UserName);
                        }
                        orderStatus       = order.OrderStatus;
                        order.OrderStatus = 6;
                        OrderBLL.UserUpdateOrderAddAction(order, "用户确认收货", 5, orderStatus);
                    }
                }
                break;
            }

            default:
                content = "订单状态错误";
                break;
            }
            ResponseHelper.Write(content);
            ResponseHelper.End();
        }
Example #28
0
        /// <summary>
        /// 添加商品到购物车
        /// </summary>
        protected void AddToCart()
        {
            string  result             = "ok";
            int     productID          = RequestHelper.GetQueryString <int>("ProductID");
            string  productName        = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("ProductName"));
            string  standardValueList  = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("StandardValueList"));
            int     buyCount           = RequestHelper.GetQueryString <int>("BuyCount");
            decimal currentMemberPrice = RequestHelper.GetQueryString <decimal>("CurrentMemberPrice");

            if (!CartBLL.IsProductInCart(productID, productName, base.UserId))
            {
                CartInfo cart = new CartInfo();
                cart.ProductId         = productID;
                cart.ProductName       = productName;
                cart.BuyCount          = buyCount;
                cart.StandardValueList = standardValueList;
                cart.RandNumber        = string.Empty;
                cart.UserId            = base.UserId;
                cart.UserName          = base.UserName;
                int cartID = CartBLL.Add(cart, base.UserId);
                Sessions.ProductBuyCount += buyCount;
                //Sessions.ProductTotalPrice += buyCount * currentMemberPrice;
                //添加赠品,赠品另外下单(2016.3.16)
                //ProductInfo product = ProductBLL.Read(productID);
                //if (product.Accessory != string.Empty)
                //{
                //    ProductSearchInfo productSearch = new ProductSearchInfo();
                //    productSearch.InProductId = product.Accessory;
                //    List<ProductInfo> accessoryList = ProductBLL.SearchList(productSearch);
                //    foreach (ProductInfo accessory in accessoryList)
                //    {
                //        cart = new CartInfo();
                //        cart.ProductId = accessory.Id;
                //        cart.ProductName = accessory.Name;
                //        cart.BuyCount = buyCount;
                //        cart.RandNumber = string.Empty;
                //        cart.UserId = base.UserId;
                //        cart.UserName = base.UserName;
                //        CartBLL.Add(cart, base.UserId);
                //    }
                //}
            }
            else
            {
                result = "该产品已经在购物车";
            }
            ResponseHelper.Write(result);
            ResponseHelper.End();
        }
Example #29
0
        /// <summary>
        /// 添加优惠劵
        /// </summary>
        protected void AddUserCoupon()
        {
            string result   = string.Empty;
            string number   = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("Number"));
            string password = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("Password"));

            if (number == string.Empty || password == string.Empty)
            {
                result = "请填写优惠券卡号和密码";
            }
            else
            {
                UserCouponInfo userCoupon = UserCouponBLL.Read(number, password);
                if (userCoupon.Id <= 0)
                {
                    result = "卡号或者密码错误";
                }
                else
                {
                    if (userCoupon.UserId > 0)
                    {
                        result = "该优惠券已经绑定了用户";
                    }
                    else
                    {
                        if (userCoupon.IsUse == (int)BoolType.True)
                        {
                            result = "该优惠券已经使用了";
                        }
                        else
                        {
                            CouponInfo coupon = CouponBLL.Read(userCoupon.CouponId);
                            if (RequestHelper.DateNow >= coupon.UseStartDate && RequestHelper.DateNow <= coupon.UseEndDate)
                            {
                                userCoupon.UserId   = base.UserId;
                                userCoupon.UserName = base.UserName;
                                UserCouponBLL.Update(userCoupon);
                            }
                            else
                            {
                                result = "该优惠券没在使用期限内";
                            }
                        }
                    }
                }
            }
            ResponseHelper.Write(result);
            ResponseHelper.End();
        }
        /// <summary>
        /// 提交评论
        /// </summary>
        public void PostProductComment()
        {
            string result = "ok";

            if (ShopConfig.ReadConfigInfo().AllowAnonymousComment == (int)BoolType.False && base.UserId == 0)
            {
                result = "还未登录";
            }
            else
            {
                AddProductComment(ref result);
            }
            ResponseHelper.Write(result);
            ResponseHelper.End();
        }