// 改 public bool Update(W_ResourcesCata resourcesCata) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("update [W_ResourcesCata] set WID=@WID,CataName=@CataName,CreateTime=@CreateTime,IsDelete=@IsDelete where CataID=@CataID", new SqlParameter("@CataID", resourcesCata.CataID), new SqlParameter("@CataID", resourcesCata.CataID), new SqlParameter("@WID", resourcesCata.WID), new SqlParameter("@CataName", resourcesCata.CataName), new SqlParameter("@CreateTime", resourcesCata.CreateTime), new SqlParameter("@IsDelete", resourcesCata.IsDelete)); return rows > 0; } }
// 删 public bool Delete(W_ResourcesCata resourcesCata) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("delete from [W_ResourcesCata] where CataID=@CataID", new SqlParameter("@CataID", resourcesCata.CataID)); return rows > 0; } }
// 增 public bool Add(W_ResourcesCata resourcesCata) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("insert into [W_ResourcesCata] values (@CataID,@WID,@CataName,@CreateTime,@IsDelete)", new SqlParameter("@CataID", resourcesCata.CataID), new SqlParameter("@WID", resourcesCata.WID), new SqlParameter("@CataName", resourcesCata.CataName), new SqlParameter("@CreateTime", resourcesCata.CreateTime), new SqlParameter("@IsDelete", resourcesCata.IsDelete)); return rows > 0; } }
public List<W_KeyWord> GetByResourcesCata(W_ResourcesCata resourcesCata) { return GetAll().Where(temp => temp.CataID == resourcesCata.CataID).ToList(); }
// 改 public bool Update(W_ResourcesCata resourcesCata) { return new W_ResourcesCataDAL().Update(resourcesCata); }
// 删 public bool Delete(W_ResourcesCata resourcesCata) { return new W_ResourcesCataDAL().Delete(resourcesCata); }
// 增 public bool Add(W_ResourcesCata resourcesCata) { return new W_ResourcesCataDAL().Add(resourcesCata); }