// 删 public bool Delete(W_WeChatInfo weChatInfo) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("delete from [W_WeChatInfo] where WID=@WID", new SqlParameter("@WID", weChatInfo.WID)); return rows > 0; } }
// 改 public bool Update(W_WeChatInfo weChatInfo) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("update [W_WeChatInfo] set AppID=@AppID,AppSecret=@AppSecret,Token=@Token,WechatID=@WechatID,AppNamespace=@AppNamespace,CreateTime=@CreateTime,IsDelete=@IsDelete where WID=@WID", new SqlParameter("@WID", weChatInfo.WID), new SqlParameter("@AppID", weChatInfo.AppID), new SqlParameter("@AppSecret", weChatInfo.AppSecret), new SqlParameter("@Token", weChatInfo.Token), new SqlParameter("@WechatID", weChatInfo.WechatID), new SqlParameter("@AppNamespace", weChatInfo.AppNamespace), new SqlParameter("@CreateTime", weChatInfo.CreateTime), new SqlParameter("@IsDelete", weChatInfo.IsDelete)); return rows > 0; } }
// 增 public bool Add(W_WeChatInfo weChatInfo) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("insert into [W_WeChatInfo] values (@WID,@AppID,@AppSecret,@Token,@WechatID,@AppNamespace,@CreateTime,@IsDelete)", new SqlParameter("@WID", weChatInfo.WID), new SqlParameter("@AppID", weChatInfo.AppID), new SqlParameter("@AppSecret", weChatInfo.AppSecret), new SqlParameter("@Token", weChatInfo.Token), new SqlParameter("@WechatID", weChatInfo.WechatID), new SqlParameter("@AppNamespace", weChatInfo.AppNamespace), new SqlParameter("@CreateTime", weChatInfo.CreateTime), new SqlParameter("@IsDelete", weChatInfo.IsDelete)); return rows > 0; } }
public List<W_ResourcesCata> GetByWeChatInfo(W_WeChatInfo weChatInfo) { return GetAll().Where(temp => temp.WID == weChatInfo.WID).ToList(); }
public List<W_Menu> GetByWeChatInfo(W_WeChatInfo weChatInfo) { return GetAll().Where(temp => temp.WID == weChatInfo.WID).ToList(); }