Esempio n. 1
0
 /// <summary>
 /// 根据ID删除
 /// </summary>
 /// <param name="ID">ID</param>
 /// <returns>成功返回影响行数,失败返回0</returns>
 public static int Delete_1(int ID)
 {
     SqlParameter[] pramsWhere =
     {
         DALUtil.MakeInParam("@ID", SqlDbType.Int, 4, ID)
     };
     return(DBCommon.DBHelper.Delete(ConnString, TableName, pramsWhere));
 }
Esempio n. 2
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="pramsModify">修改参数集合</param>
 /// <param name="id">ID</param>
 /// <returns>成功返回影响行数,失败返回0</returns>
 public static int Modify(SqlParameter[] pramsModify, int id)
 {
     SqlParameter[] pramsWhere =
     {
         DALUtil.MakeInParam("@ID", SqlDbType.Int, 4, id)
     };
     return(DBCommon.DBHelper.Modify(ConnString, TableName, pramsModify, pramsWhere));
 }
Esempio n. 3
0
 /// <summary>
 ///新增
 /// <summary>
 /// <param name="pramsAdd">参数</param>
 /// <returns>成功返回自增ID</returns>
 public static int Add(long categoryID, long attrID)
 {
     SqlParameter[] pramsAdd =
     {
         DALUtil.MakeInParam("@categoryID", SqlDbType.BigInt, 4, categoryID),
         DALUtil.MakeInParam("@attrID",     SqlDbType.BigInt, 4, attrID),
     };
     return(DBCommon.DBHelper.Add2(ConnString, TableName, pramsAdd));
 }
Esempio n. 4
0
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="SelectIF">需要查询的字段</param>
        /// <param name="pramsWhere">条件集合</param>
        /// <param name="OrderName">排序无需带Order by</param>
        public static List <CategoryInfoEntity> GetList(string SelectIF, int level, string OrderName = "")
        {
            SqlParameter[] pramsWhere =
            {
                DALUtil.MakeInParam("@level", SqlDbType.Int, 4, level)
            };
            DataTable dt = DBCommon.DBHelper.GetDataTable2(ConnString, TableName, SelectIF, pramsWhere, OrderName);

            return(DALUtil.ConvertDataTableToEntityList <CategoryInfoEntity>(dt));
        }
Esempio n. 5
0
 /// <summary>
 ///新增
 /// <summary>
 /// <param name="pramsAdd">参数</param>
 /// <returns>成功返回自增ID</returns>
 public static int Add(long fid, long subID, int attrType)
 {
     SqlParameter[] pramsAdd =
     {
         DALUtil.MakeInParam("@fid",      SqlDbType.BigInt, 4, fid),
         DALUtil.MakeInParam("@subID",    SqlDbType.BigInt, 4, subID),
         DALUtil.MakeInParam("@attrType", SqlDbType.Int,    4, attrType),
     };
     return(DBCommon.DBHelper.Add2(ConnString, TableName, pramsAdd));
 }
Esempio n. 6
0
 /// <summary>
 ///新增
 /// <summary>
 /// <param name="pramsAdd">参数</param>
 /// <returns>成功返回自增ID</returns>
 public static int Add(long categoryID, string name, long parentID, int level)
 {
     SqlParameter[] pramsAdd =
     {
         DALUtil.MakeInParam("@categoryID", SqlDbType.Int,        4, categoryID),
         DALUtil.MakeInParam("@name",       SqlDbType.NVarChar, 100, name),
         DALUtil.MakeInParam("@parentID",   SqlDbType.Int,        4, parentID),
         DALUtil.MakeInParam("@level",      SqlDbType.Int,        4, level),
     };
     return(DBCommon.DBHelper.Add2(ConnString, TableName, pramsAdd));
 }
Esempio n. 7
0
 /// <summary>
 /// 获取自定义参数数据
 /// </summary>
 /// <param name="ID">ID</param>
 /// <param name="SelectIF">查询字段</param>
 public static CategoryInfoEntity Get_99(int ID, string SelectIF)
 {
     try
     {
         //参数Where条件
         SqlParameter[] pramsWhere =
         {
             DALUtil.MakeInParam("@ID", SqlDbType.Int, 4, ID)
         };
         return(Get1(SelectIF, pramsWhere));
     }
     catch { return(null); }
 }
Esempio n. 8
0
 /// <summary>
 /// 获取自定义参数数据
 /// </summary>
 /// <param name="ID">ID</param>
 /// <param name="SelectIF">查询字段</param>
 public static AttributeValueInfoEntity Get_98(long attrValueID, string SelectIF)
 {
     try
     {
         //参数Where条件
         SqlParameter[] pramsWhere =
         {
             DALUtil.MakeInParam("@attrValueID", SqlDbType.BigInt, 4, attrValueID)
         };
         return(Get1(SelectIF, pramsWhere));
     }
     catch { return(null); }
 }
Esempio n. 9
0
 public static int Modify(long attrValueID, string name, string enName, int isSKU)
 {
     SqlParameter[] pramsModify =
     {
         DAL.DALUtil.MakeInParam("@name",   System.Data.SqlDbType.NVarChar, 100, name),
         DAL.DALUtil.MakeInParam("@enName", System.Data.SqlDbType.NVarChar, 100, enName),
         DAL.DALUtil.MakeInParam("@isSKU",  System.Data.SqlDbType.Int,        4, isSKU),
     };
     SqlParameter[] pramsWhere =
     {
         DALUtil.MakeInParam("@attrValueID", SqlDbType.BigInt, 4, attrValueID)
     };
     return(DBCommon.DBHelper.Modify(ConnString, TableName, pramsModify, pramsWhere));
 }
Esempio n. 10
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="pramsModify">修改参数集合</param>
 /// <param name="pramsWhere">条件集合</param>
 /// <returns>成功返回影响行数,失败返回0</returns>
 public static int Modify(long categoryID, string name, long parentID, int level, bool isLeaf)
 {
     SqlParameter[] pramsModify =
     {
         DALUtil.MakeInParam("@categoryID", SqlDbType.Int,        4, categoryID),
         DALUtil.MakeInParam("@name",       SqlDbType.NVarChar, 100, name),
         DALUtil.MakeInParam("@parentID",   SqlDbType.Int,        4, parentID),
         DALUtil.MakeInParam("@level",      SqlDbType.Int,        4, level),
         DALUtil.MakeInParam("@isLeaf",     SqlDbType.Int,        4, (isLeaf == true?1:0)),
     };
     SqlParameter[] pramsWhere =
     {
         DALUtil.MakeInParam("@categoryID", SqlDbType.BigInt, 4, categoryID)
     };
     return(DBCommon.DBHelper.Modify(ConnString, TableName, pramsModify, pramsWhere));
 }