Ejemplo n.º 1
0
 public ProductAttrValueInfo GetProductAttrValueInfo(string _proID,int _attrID)
 {
     ProductAttrValueInfo productAttrValueInfo = null;
     StringBuilder sql= new StringBuilder();
     sql.Append("SELECT * FROM");
     sql.Append(" [Tbl_ProductAttrValue]");
     sql.Append(" WHERE");
     sql.Append(" [ProID]=@ProID");
     sql.Append(" AND");
     sql.Append(" [AttrID]=@AttrID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ProID",_proID),
         dbhelper.CreateParameter("@AttrID",_attrID)
       };
       using(IDataReader reader=dbhelper.ExecuteReader(sql.ToString(),p_Parms))
       {
         if(reader.Read())
         {
             productAttrValueInfo = ProductAttrValueInfo.SetValue(reader);
         }
       }
     }
     return productAttrValueInfo;
 }
Ejemplo n.º 2
0
 public bool Delete(string _proID,int _attrID)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("DELETE FROM");
     sql.Append(" [Tbl_ProductAttrValue]");
     sql.Append(" WHERE");
     sql.Append(" [ProID]=@ProID");
     sql.Append(" AND");
     sql.Append(" [AttrID]=@AttrID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ProID",_proID),
         dbhelper.CreateParameter("@AttrID",_attrID)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 3
0
 public bool Delete(int _keyID)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("DELETE FROM");
     sql.Append(" [AutoNum]");
     sql.Append(" WHERE");
     sql.Append(" [KeyID]=@KeyID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@KeyID",_keyID)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 4
0
 public bool Delete(int _id)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("DELETE FROM");
     sql.Append(" [Tbl_PriceLevel]");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",_id)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 5
0
 public bool Delete(string _productNO)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("DELETE FROM");
     sql.Append(" [Tbl_Product]");
     sql.Append(" WHERE");
     sql.Append(" [ProductNO]=@ProductNO");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ProductNO",_productNO)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 6
0
        public bool Insert(HotKeyWordInfo hotKeyWordInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_HotKeyWord](");
            sql.Append("[KeyWord],");
            sql.Append("[CateID],");
            sql.Append("[OrderID]");
            sql.Append(") VALUES(");
            sql.Append("@KeyWord,");
            sql.Append("@CateID,");
            sql.Append("@OrderID");
            sql.Append(")");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@KeyWord",hotKeyWordInfo.KeyWord),
                    dbhelper.CreateParameter("@CateID",hotKeyWordInfo.CateID),
                    dbhelper.CreateParameter("@OrderID",hotKeyWordInfo.OrderID)
                };
            return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
            }
        }
Ejemplo n.º 7
0
        public bool Insert(ProductAttrInfo productAttrInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_ProductAttr](");
            sql.Append("[CateID],");
            sql.Append("[AttrName]");
            sql.Append(") VALUES(");
            sql.Append("@CateID,");
            sql.Append("@AttrName");
            sql.Append(");SELECT @@IDENTITY;");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@CateID",productAttrInfo.CateID),
                    dbhelper.CreateParameter("@AttrName",productAttrInfo.AttrName)
                };
            int ret=(int)dbhelper.ExecuteScalar(sql.ToString(),p_Parms);
            productAttrInfo.AttrID=ret;
            return true;
            }
        }
Ejemplo n.º 8
0
 public PriceLevelInfo GetPriceLevelInfo(int _id)
 {
     PriceLevelInfo priceLevelInfo = null;
     StringBuilder sql= new StringBuilder();
     sql.Append("SELECT * FROM");
     sql.Append(" [Tbl_PriceLevel]");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",_id)
       };
       using(IDataReader reader=dbhelper.ExecuteReader(sql.ToString(),p_Parms))
       {
         if(reader.Read())
         {
             priceLevelInfo = PriceLevelInfo.SetValue(reader);
         }
       }
     }
     return priceLevelInfo;
 }
Ejemplo n.º 9
0
 public CustomerInfo GetCustomerInfo(string _customerNO)
 {
     CustomerInfo customerInfo = null;
     StringBuilder sql= new StringBuilder();
     sql.Append("SELECT * FROM");
     sql.Append(" [Tbl_Customer]");
     sql.Append(" WHERE");
     sql.Append(" [CustomerNO]=@CustomerNO");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@CustomerNO",_customerNO)
       };
       using(IDataReader reader=dbhelper.ExecuteReader(sql.ToString(),p_Parms))
       {
         if(reader.Read())
         {
             customerInfo = CustomerInfo.SetValue(reader);
         }
       }
     }
     return customerInfo;
 }
Ejemplo n.º 10
0
        public bool Insert(ProductCommentReplyInfo productCommentReplyInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_ProductCommentReply](");
            sql.Append("[CommentID],");
            sql.Append("[Summary]");
            sql.Append(") VALUES(");
            sql.Append("@CommentID,");
            sql.Append("@Summary");
            sql.Append(");SELECT @@IDENTITY;");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@CommentID",productCommentReplyInfo.CommentID),
                    dbhelper.CreateParameter("@Summary",productCommentReplyInfo.Summary)
                };
            int ret=(int)dbhelper.ExecuteScalar(sql.ToString(),p_Parms);
            productCommentReplyInfo.Id=ret;
            return true;
            }
        }
Ejemplo n.º 11
0
 public AutoNumInfo GetAutoNumInfo(int _keyID)
 {
     AutoNumInfo autoNumInfo = null;
     StringBuilder sql= new StringBuilder();
     sql.Append("SELECT * FROM");
     sql.Append(" [AutoNum]");
     sql.Append(" WHERE");
     sql.Append(" [KeyID]=@KeyID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@KeyID",_keyID)
       };
       using(IDataReader reader=dbhelper.ExecuteReader(sql.ToString(),p_Parms))
       {
         if(reader.Read())
         {
             autoNumInfo = AutoNumInfo.SetValue(reader);
         }
       }
     }
     return autoNumInfo;
 }
Ejemplo n.º 12
0
        public bool Insert(ProductAnswerInfo productAnswerInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_ProductAnswer](");
            sql.Append("[ID],");
            sql.Append("[ProductNO],");
            sql.Append("[ServiceType],");
            sql.Append("[Ask],");
            sql.Append("[Answer],");
            sql.Append("[YesCount],");
            sql.Append("[NoCount]");
            sql.Append(") VALUES(");
            sql.Append("@ID,");
            sql.Append("@ProductNO,");
            sql.Append("@ServiceType,");
            sql.Append("@Ask,");
            sql.Append("@Answer,");
            sql.Append("@YesCount,");
            sql.Append("@NoCount");
            sql.Append(")");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@ID",productAnswerInfo.Id),
                    dbhelper.CreateParameter("@ProductNO",productAnswerInfo.ProductNO),
                    dbhelper.CreateParameter("@ServiceType",productAnswerInfo.ServiceType),
                    dbhelper.CreateParameter("@Ask",productAnswerInfo.Ask),
                    dbhelper.CreateParameter("@Answer",productAnswerInfo.Answer),
                    dbhelper.CreateParameter("@YesCount",productAnswerInfo.YesCount),
                    dbhelper.CreateParameter("@NoCount",productAnswerInfo.NoCount)
                };
            return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
            }
        }
Ejemplo n.º 13
0
        public bool Insert(ProductAttrValueInfo productAttrValueInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_ProductAttrValue](");
            sql.Append("[ProID],");
            sql.Append("[AttrID],");
            sql.Append("[AttrValue]");
            sql.Append(") VALUES(");
            sql.Append("@ProID,");
            sql.Append("@AttrID,");
            sql.Append("@AttrValue");
            sql.Append(")");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@ProID",productAttrValueInfo.ProID),
                    dbhelper.CreateParameter("@AttrID",productAttrValueInfo.AttrID),
                    dbhelper.CreateParameter("@AttrValue",productAttrValueInfo.AttrValue)
                };
            return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
            }
        }
Ejemplo n.º 14
0
 public bool Update(PriceLevelInfo priceLevelInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_PriceLevel]");
     sql.Append(" SET");
     sql.Append(" [CateID]=@CateID,");
     sql.Append(" [NickName]=@NickName,");
     sql.Append(" [StartPrice]=@StartPrice,");
     sql.Append(" [EndPrice]=@EndPrice,");
     sql.Append(" [OrderID]=@OrderID");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",priceLevelInfo.Id)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 15
0
        public bool Insert(AutoNumInfo autoNumInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [AutoNum](");
            sql.Append("[KeyID],");
            sql.Append("[Seed],");
            sql.Append("[SeedDate],");
            sql.Append("[Prefix],");
            sql.Append("[Summary]");
            sql.Append(") VALUES(");
            sql.Append("@KeyID,");
            sql.Append("@Seed,");
            sql.Append("@SeedDate,");
            sql.Append("@Prefix,");
            sql.Append("@Summary");
            sql.Append(")");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@KeyID",autoNumInfo.KeyID),
                    dbhelper.CreateParameter("@Seed",autoNumInfo.Seed),
                    dbhelper.CreateParameter("@SeedDate",autoNumInfo.SeedDate),
                    dbhelper.CreateParameter("@Prefix",autoNumInfo.Prefix),
                    dbhelper.CreateParameter("@Summary",autoNumInfo.Summary)
                };
            return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
            }
        }
Ejemplo n.º 16
0
 public bool Update(ProductAnswerInfo productAnswerInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_ProductAnswer]");
     sql.Append(" SET");
     sql.Append(" [ProductNO]=@ProductNO,");
     sql.Append(" [ServiceType]=@ServiceType,");
     sql.Append(" [Ask]=@Ask,");
     sql.Append(" [Answer]=@Answer,");
     sql.Append(" [YesCount]=@YesCount,");
     sql.Append(" [NoCount]=@NoCount");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",productAnswerInfo.Id)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 17
0
 public bool Update(AutoNumInfo autoNumInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [AutoNum]");
     sql.Append(" SET");
     sql.Append(" [Seed]=@Seed,");
     sql.Append(" [SeedDate]=@SeedDate,");
     sql.Append(" [Prefix]=@Prefix,");
     sql.Append(" [Summary]=@Summary");
     sql.Append(" WHERE");
     sql.Append(" [KeyID]=@KeyID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@KeyID",autoNumInfo.KeyID)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 18
0
 public bool Update(ProductCommentInfo productCommentInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_ProductComment]");
     sql.Append(" SET");
     sql.Append(" [ProductNO]=@ProductNO,");
     sql.Append(" [Title]=@Title,");
     sql.Append(" [Merits]=@Merits,");
     sql.Append(" [Demerits]=@Demerits,");
     sql.Append(" [Summary]=@Summary,");
     sql.Append(" [Star]=@Star,");
     sql.Append(" [ReplyCount]=@ReplyCount");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",productCommentInfo.Id)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 19
0
        public bool Insert(PriceLevelInfo priceLevelInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_PriceLevel](");
            sql.Append("[CateID],");
            sql.Append("[NickName],");
            sql.Append("[StartPrice],");
            sql.Append("[EndPrice],");
            sql.Append("[OrderID]");
            sql.Append(") VALUES(");
            sql.Append("@CateID,");
            sql.Append("@NickName,");
            sql.Append("@StartPrice,");
            sql.Append("@EndPrice,");
            sql.Append("@OrderID");
            sql.Append(");SELECT @@IDENTITY;");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@CateID",priceLevelInfo.CateID),
                    dbhelper.CreateParameter("@NickName",priceLevelInfo.NickName),
                    dbhelper.CreateParameter("@StartPrice",priceLevelInfo.StartPrice),
                    dbhelper.CreateParameter("@EndPrice",priceLevelInfo.EndPrice),
                    dbhelper.CreateParameter("@OrderID",priceLevelInfo.OrderID)
                };
            int ret=(int)dbhelper.ExecuteScalar(sql.ToString(),p_Parms);
            priceLevelInfo.Id=ret;
            return true;
            }
        }
Ejemplo n.º 20
0
 public bool Update(BrandInfo brandInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_Brand]");
     sql.Append(" SET");
     sql.Append(" [CateID]=@CateID,");
     sql.Append(" [NickName]=@NickName,");
     sql.Append(" [BrandName]=@BrandName,");
     sql.Append(" [OrderID]=@OrderID");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",brandInfo.Id)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 21
0
 public bool Update(ProductAttrInfo productAttrInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_ProductAttr]");
     sql.Append(" SET");
     sql.Append(" [CateID]=@CateID,");
     sql.Append(" [AttrName]=@AttrName");
     sql.Append(" WHERE");
     sql.Append(" [AttrID]=@AttrID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@AttrID",productAttrInfo.AttrID)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 22
0
 public bool Update(CustomerInfo customerInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_Customer]");
     sql.Append(" SET");
     sql.Append(" [Email]=@Email,");
     sql.Append(" [Password]=@Password,");
     sql.Append(" [NickName]=@NickName,");
     sql.Append(" [Telephone]=@Telephone,");
     sql.Append(" [Mobile]=@Mobile");
     sql.Append(" WHERE");
     sql.Append(" [CustomerNO]=@CustomerNO");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@CustomerNO",customerInfo.CustomerNO)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 23
0
 public bool Update(ProductCommentReplyInfo productCommentReplyInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_ProductCommentReply]");
     sql.Append(" SET");
     sql.Append(" [CommentID]=@CommentID,");
     sql.Append(" [Summary]=@Summary");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",productCommentReplyInfo.Id)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 24
0
        public bool Insert(ProductCommentInfo productCommentInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_ProductComment](");
            sql.Append("[ProductNO],");
            sql.Append("[Title],");
            sql.Append("[Merits],");
            sql.Append("[Demerits],");
            sql.Append("[Summary],");
            sql.Append("[Star],");
            sql.Append("[ReplyCount]");
            sql.Append(") VALUES(");
            sql.Append("@ProductNO,");
            sql.Append("@Title,");
            sql.Append("@Merits,");
            sql.Append("@Demerits,");
            sql.Append("@Summary,");
            sql.Append("@Star,");
            sql.Append("@ReplyCount");
            sql.Append(");SELECT @@IDENTITY;");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@ProductNO",productCommentInfo.ProductNO),
                    dbhelper.CreateParameter("@Title",productCommentInfo.Title),
                    dbhelper.CreateParameter("@Merits",productCommentInfo.Merits),
                    dbhelper.CreateParameter("@Demerits",productCommentInfo.Demerits),
                    dbhelper.CreateParameter("@Summary",productCommentInfo.Summary),
                    dbhelper.CreateParameter("@Star",productCommentInfo.Star),
                    dbhelper.CreateParameter("@ReplyCount",productCommentInfo.ReplyCount)
                };
            int ret=(int)dbhelper.ExecuteScalar(sql.ToString(),p_Parms);
            productCommentInfo.Id=ret;
            return true;
            }
        }
Ejemplo n.º 25
0
        public bool Insert(ProductPicInfo productPicInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_ProductPic](");
            sql.Append("[OrderID],");
            sql.Append("[ProductNO],");
            sql.Append("[SmallPic],");
            sql.Append("[MidPic],");
            sql.Append("[BigPic]");
            sql.Append(") VALUES(");
            sql.Append("@OrderID,");
            sql.Append("@ProductNO,");
            sql.Append("@SmallPic,");
            sql.Append("@MidPic,");
            sql.Append("@BigPic");
            sql.Append(");SELECT @@IDENTITY;");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@OrderID",productPicInfo.OrderID),
                    dbhelper.CreateParameter("@ProductNO",productPicInfo.ProductNO),
                    dbhelper.CreateParameter("@SmallPic",productPicInfo.SmallPic),
                    dbhelper.CreateParameter("@MidPic",productPicInfo.MidPic),
                    dbhelper.CreateParameter("@BigPic",productPicInfo.BigPic)
                };
            long ret=(long)dbhelper.ExecuteScalar(sql.ToString(),p_Parms);
            productPicInfo.Id=ret;
            return true;
            }
        }
Ejemplo n.º 26
0
        public bool Insert(BrandInfo brandInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_Brand](");
            sql.Append("[CateID],");
            sql.Append("[NickName],");
            sql.Append("[BrandName],");
            sql.Append("[OrderID]");
            sql.Append(") VALUES(");
            sql.Append("@CateID,");
            sql.Append("@NickName,");
            sql.Append("@BrandName,");
            sql.Append("@OrderID");
            sql.Append(");SELECT @@IDENTITY;");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@CateID",brandInfo.CateID),
                    dbhelper.CreateParameter("@NickName",brandInfo.NickName),
                    dbhelper.CreateParameter("@BrandName",brandInfo.BrandName),
                    dbhelper.CreateParameter("@OrderID",brandInfo.OrderID)
                };
            int ret=(int)dbhelper.ExecuteScalar(sql.ToString(),p_Parms);
            brandInfo.Id=ret;
            return true;
            }
        }
Ejemplo n.º 27
0
 public bool Update(ProductInfo productInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_Product]");
     sql.Append(" SET");
     sql.Append(" [CateIDPath]=@CateIDPath,");
     sql.Append(" [NickName]=@NickName,");
     sql.Append(" [ProductName]=@ProductName,");
     sql.Append(" [MarketPrice]=@MarketPrice,");
     sql.Append(" [InnerPrice]=@InnerPrice,");
     sql.Append(" [BrandID]=@BrandID,");
     sql.Append(" [BrandName]=@BrandName");
     sql.Append(" WHERE");
     sql.Append(" [ProductNO]=@ProductNO");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ProductNO",productInfo.ProductNO)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }
Ejemplo n.º 28
0
        public bool Insert(CustomerInfo customerInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_Customer](");
            sql.Append("[CustomerNO],");
            sql.Append("[Email],");
            sql.Append("[Password],");
            sql.Append("[NickName],");
            sql.Append("[Telephone],");
            sql.Append("[Mobile]");
            sql.Append(") VALUES(");
            sql.Append("@CustomerNO,");
            sql.Append("@Email,");
            sql.Append("@Password,");
            sql.Append("@NickName,");
            sql.Append("@Telephone,");
            sql.Append("@Mobile");
            sql.Append(")");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@CustomerNO",customerInfo.CustomerNO),
                    dbhelper.CreateParameter("@Email",customerInfo.Email),
                    dbhelper.CreateParameter("@Password",customerInfo.Password),
                    dbhelper.CreateParameter("@NickName",customerInfo.NickName),
                    dbhelper.CreateParameter("@Telephone",customerInfo.Telephone),
                    dbhelper.CreateParameter("@Mobile",customerInfo.Mobile)
                };
            return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
            }
        }
Ejemplo n.º 29
0
        public bool Insert(ProductInfo productInfo)
        {
            StringBuilder sql=new StringBuilder();
            sql.Append("INSERT INTO");
            sql.Append(" [Tbl_Product](");
            sql.Append("[ProductNO],");
            sql.Append("[CateIDPath],");
            sql.Append("[NickName],");
            sql.Append("[ProductName],");
            sql.Append("[MarketPrice],");
            sql.Append("[InnerPrice],");
            sql.Append("[BrandID],");
            sql.Append("[BrandName]");
            sql.Append(") VALUES(");
            sql.Append("@ProductNO,");
            sql.Append("@CateIDPath,");
            sql.Append("@NickName,");
            sql.Append("@ProductName,");
            sql.Append("@MarketPrice,");
            sql.Append("@InnerPrice,");
            sql.Append("@BrandID,");
            sql.Append("@BrandName");
            sql.Append(")");

            using(NetShopHelper dbhelper=new NetShopHelper())
            {
                IDbDataParameter[] p_Parms=new IDbDataParameter[]{
                    dbhelper.CreateParameter("@ProductNO",productInfo.ProductNO),
                    dbhelper.CreateParameter("@CateIDPath",productInfo.CateIDPath),
                    dbhelper.CreateParameter("@NickName",productInfo.NickName),
                    dbhelper.CreateParameter("@ProductName",productInfo.ProductName),
                    dbhelper.CreateParameter("@MarketPrice",productInfo.MarketPrice),
                    dbhelper.CreateParameter("@InnerPrice",productInfo.InnerPrice),
                    dbhelper.CreateParameter("@BrandID",productInfo.BrandID),
                    dbhelper.CreateParameter("@BrandName",productInfo.BrandName)
                };
            return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
            }
        }
Ejemplo n.º 30
0
 public bool Update(ProductPicInfo productPicInfo)
 {
     StringBuilder sql = new StringBuilder();
     sql.Append("UPDATE");
     sql.Append(" [Tbl_ProductPic]");
     sql.Append(" SET");
     sql.Append(" [OrderID]=@OrderID,");
     sql.Append(" [ProductNO]=@ProductNO,");
     sql.Append(" [SmallPic]=@SmallPic,");
     sql.Append(" [MidPic]=@MidPic,");
     sql.Append(" [BigPic]=@BigPic");
     sql.Append(" WHERE");
     sql.Append(" [ID]=@ID");
     using(NetShopHelper dbhelper=new NetShopHelper())
     {
       IDbDataParameter[] p_Parms = new IDbDataParameter[]{
         dbhelper.CreateParameter("@ID",productPicInfo.Id)
       };
      return 0 < dbhelper.ExecuteNonQuery(sql.ToString(),p_Parms);
     }
 }