Esempio n. 1
0
 public void AddUserCate(M_UserCate model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@UserId", SqlDbType.Int, 4), new SqlParameter("@CateName", SqlDbType.VarChar, 50), new SqlParameter("@CateType", SqlDbType.Int, 4), new SqlParameter("@Discription", SqlDbType.Text), new SqlParameter("@UserCateId", SqlDbType.Int, 4) };
     commandParameters[0].Value = model.UserId;
     commandParameters[1].Value = model.CateName;
     commandParameters[2].Value = model.CateType;
     commandParameters[3].Value = model.Discription;
     commandParameters[4].Value = model.UserCateId;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_UserCate_Set", commandParameters);
 }
Esempio n. 2
0
 public void AddUserCate(M_UserCate model)
 {
     this.iu.AddUserCate(model);
 }
Esempio n. 3
0
 public void UpdateUserCate(M_UserCate model)
 {
     this.iu.UpdateUserCate(model);
 }
Esempio n. 4
0
 public M_UserCate GetUserCateById(int userCateId)
 {
     M_UserCate cate = new M_UserCate();
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@UserCateId", userCateId) };
     DataTable table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_UserCate_GetById", commandParameters);
     if (table.Rows.Count > 0)
     {
         cate.UserId = int.Parse(table.Rows[0]["UserId"].ToString());
         cate.UserCateId = int.Parse(table.Rows[0]["UserCateId"].ToString());
         cate.CateType = int.Parse(table.Rows[0]["ModelType"].ToString());
         cate.CateName = table.Rows[0]["CateName"].ToString();
         cate.Discription = table.Rows[0]["Discription"].ToString();
     }
     return cate;
 }