Пример #1
0
 /// <summary>
 /// 添加产品类型
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Insert_ProductTypeTableData(ProductType_Table obj)
 {
     return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"),
                                      CommandType.StoredProcedure,
                                      new SqlParameter[] {
         new SqlParameter("@PT_Name", obj.PT_Name)
     }));
 }
Пример #2
0
        /// <summary>
        /// 获取全部的产品类型
        /// </summary>
        /// <returns></returns>
        public List <ProductType_Table> GetProductTypeTableAll()
        {
            List <ProductType_Table> list = new List <ProductType_Table>();
            SqlDataReader            dr   = DBHerlper.ExecuteReader(GetSqlString("Select"),
                                                                    CommandType.StoredProcedure);

            while (dr.Read())
            {
                ProductType_Table obj = new ProductType_Table()
                {
                    PT_id   = Convert.ToInt32(dr["PT_id"]),
                    PT_Name = dr["PT_Name"].ToString()
                };
                list.Add(obj);
            }
            dr.Close();
            return(list);
        }
Пример #3
0
        /// <summary>
        /// 根据ID查询产品类型信息
        /// </summary>
        /// <param name="con"></param>
        /// <returns></returns>
        public ProductType_Table GetProductTypeTableByConn(string con)
        {
            ProductType_Table obj = null;
            SqlDataReader     dr  = DBHerlper.ExecuteReader(
                "Select * from ProductType_Table where PT_id=@PT_id",
                CommandType.Text, new SqlParameter[] {
                new SqlParameter("@PT_id", con)
            });

            if (dr.Read())
            {
                obj = new ProductType_Table()
                {
                    PT_id   = Convert.ToInt32(dr["PT_id"]),
                    PT_Name = dr["PT_Name"].ToString()
                };
            }
            dr.Close();
            return(obj);
        }
Пример #4
0
 /// <summary>
 /// 更改产品类型信息
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Update_ProductTypeTableData(ProductType_Table obj)
 {
     return(relevanceClass.Update_ProductTypeTableData(obj));
 }
Пример #5
0
 /// <summary>
 /// 添加产品类型信息
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Insert_ProductTypeTableData(ProductType_Table obj)
 {
     return(relevanceClass.Insert_ProductTypeTableData(obj));
 }