예제 #1
0
 public void AddMemberPrice(MemberPriceInfo memberPrice)
 {
     SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@productID", SqlDbType.Int), new SqlParameter("@gradeID", SqlDbType.Int), new SqlParameter("@price", SqlDbType.Decimal) };
     pt[0].Value = memberPrice.ProductID;
     pt[1].Value = memberPrice.GradeID;
     pt[2].Value = memberPrice.Price;
     ShopMssqlHelper.ExecuteNonQuery(ShopMssqlHelper.TablePrefix + "AddMemberPrice", pt);
 }
예제 #2
0
 public void PrepareMemberPriceModel(SqlDataReader dr, List <MemberPriceInfo> memberPriceList)
 {
     while (dr.Read())
     {
         MemberPriceInfo item = new MemberPriceInfo();
         item.ProductID = dr.GetInt32(0);
         item.GradeID   = dr.GetInt32(1);
         item.Price     = dr.GetDecimal(2);
         memberPriceList.Add(item);
     }
 }
예제 #3
0
        protected void HanderMemberPrice(int productID)
        {
            if (productID > 0)
            {
                MemberPriceBLL.DeleteMemberPriceByProductID(productID.ToString());
            }
            List <UserGradeInfo> list = UserGradeBLL.ReadUserGradeCacheList();
            decimal form = -1M;

            foreach (UserGradeInfo info in list)
            {
                form = RequestHelper.GetForm <decimal>("MemberPrice" + info.ID);
                if (form != -1M)
                {
                    MemberPriceInfo memberPrice = new MemberPriceInfo();
                    memberPrice.ProductID = productID;
                    memberPrice.GradeID   = info.ID;
                    memberPrice.Price     = form;
                    MemberPriceBLL.AddMemberPrice(memberPrice);
                }
            }
        }
예제 #4
0
        protected void SingleEdit()
        {
            int         queryString = RequestHelper.GetQueryString <int>("ProductID");
            ProductInfo product     = ProductBLL.ReadProduct(queryString);

            product.ProductNumber     = RequestHelper.GetQueryString <string>("ProductNumber");
            product.Weight            = RequestHelper.GetQueryString <int>("Weight");
            product.MarketPrice       = RequestHelper.GetQueryString <decimal>("MarketPrice");
            product.SendPoint         = RequestHelper.GetQueryString <int>("SendPoint");
            product.TotalStorageCount = RequestHelper.GetQueryString <int>("TotalStorageCount");
            product.LowerCount        = RequestHelper.GetQueryString <int>("LowerCount");
            product.UpperCount        = RequestHelper.GetQueryString <int>("UpperCount");
            ProductBLL.UpdateProduct(product);
            string str = RequestHelper.GetQueryString <string>("MemberPrice");

            if (str != string.Empty)
            {
                string[] strArray = str.Split(new char[] { ',' });
                MemberPriceBLL.DeleteMemberPriceByProductID(queryString.ToString());
                List <UserGradeInfo> list = UserGradeBLL.ReadUserGradeCacheList();
                decimal num2  = -1M;
                int     index = 0;
                foreach (UserGradeInfo info2 in list)
                {
                    num2 = Convert.ToDecimal(strArray[index]);
                    if (num2 != -1M)
                    {
                        MemberPriceInfo memberPrice = new MemberPriceInfo();
                        memberPrice.ProductID = queryString;
                        memberPrice.GradeID   = info2.ID;
                        memberPrice.Price     = num2;
                        MemberPriceBLL.AddMemberPrice(memberPrice);
                    }
                    index++;
                }
            }
            ResponseHelper.Write(ShopLanguage.ReadLanguage("UpdateOK"));
            ResponseHelper.End();
        }
예제 #5
0
 public static void AddMemberPrice(MemberPriceInfo memberPrice)
 {
     dal.AddMemberPrice(memberPrice);
 }
예제 #6
0
        protected void UnionEdit()
        {
            string      queryString = 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 = -2M;
            }
            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(queryString, product);
            string str2 = RequestHelper.GetQueryString <string>("MemberPrice");

            if (str2 != string.Empty)
            {
                string[]             strArray = str2.Split(new char[] { ',' });
                List <UserGradeInfo> list     = UserGradeBLL.ReadUserGradeCacheList();
                decimal num   = -1M;
                int     index = 0;
                int     num3  = 0;
                foreach (UserGradeInfo info2 in list)
                {
                    if (strArray[index] != string.Empty)
                    {
                        foreach (string str3 in queryString.Split(new char[] { ',' }))
                        {
                            num3 = Convert.ToInt32(str3);
                            MemberPriceBLL.DeleteMemberPriceByProductID(str3);
                            num = Convert.ToDecimal(strArray[index]);
                            if (num != -1M)
                            {
                                MemberPriceInfo memberPrice = new MemberPriceInfo();
                                memberPrice.ProductID = num3;
                                memberPrice.GradeID   = info2.ID;
                                memberPrice.Price     = num;
                                MemberPriceBLL.AddMemberPrice(memberPrice);
                            }
                        }
                    }
                    index++;
                }
            }
            ResponseHelper.Write(ShopLanguage.ReadLanguage("UpdateOK"));
            ResponseHelper.End();
        }