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);
            }
        }
        /// <summary>
        /// Convert IDataReader To ProductAnswerInfo
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static ProductAnswerInfo SetValue(IDataReader reader)
        {
            ProductAnswerInfo info = new ProductAnswerInfo();

            int idIndex = reader.GetOrdinal("ID");
            int productNOIndex = reader.GetOrdinal("ProductNO");
            int serviceTypeIndex = reader.GetOrdinal("ServiceType");
            int askIndex = reader.GetOrdinal("Ask");
            int answerIndex = reader.GetOrdinal("Answer");
            int yesCountIndex = reader.GetOrdinal("YesCount");
            int noCountIndex = reader.GetOrdinal("NoCount");

            info.Id = reader.GetInt32(idIndex);
            info.ProductNO = reader.GetString(productNOIndex);
            info.ServiceType = reader.GetInt32(serviceTypeIndex);
            info.Ask = reader.GetString(askIndex);
            info.Answer = reader.GetString(answerIndex);
            info.YesCount = reader.GetInt32(yesCountIndex);
            info.NoCount = reader.GetInt32(noCountIndex);

            return info;
        }
 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);
     }
 }