protected void UpdateCache() { var rc = _GetRedisClient(); var newPackList = new BLL.UpdateInfo().GetNewList(); foreach (var eachPackKey in newPackList.Keys) { //eachPackKey=packName + channelNo string cache_key = "hPackList:" + eachPackKey; rc.Del(cache_key); Dictionary <string, string> cache_update_info = new Dictionary <string, string>(); cache_update_info.Add("updateType", newPackList[eachPackKey].UpdateType.ToString()); cache_update_info.Add("packName", newPackList[eachPackKey].PackName); cache_update_info.Add("newVerName", newPackList[eachPackKey].VerName); cache_update_info.Add("newVerCode", newPackList[eachPackKey].VerCode.ToString()); cache_update_info.Add("packSize", newPackList[eachPackKey].PackSize.ToString()); cache_update_info.Add("packMD5", newPackList[eachPackKey].PackMD5); cache_update_info.Add("packUrl", newPackList[eachPackKey].PackUrl); cache_update_info.Add("pubTime", newPackList[eachPackKey].PubTime.ToString("yyyy-MM-dd HH:mm:ss")); cache_update_info.Add("updatePrompt", newPackList[eachPackKey].UpdatePrompt); cache_update_info.Add("updateDesc", newPackList[eachPackKey].UpdateDesc); cache_update_info.Add("schemeId", newPackList[eachPackKey].SchemeId.ToString()); cache_update_info.Add("forceUpdateVerCode", newPackList[eachPackKey].ForceUpdateVerCode.ToString()); rc.SetRangeInHash(cache_key, cache_update_info); } }
protected void Del_Click(object s, CommandEventArgs e) { try { string[] param = e.CommandArgument.ToString().Split('|'); int id = Convert.ToInt32(param[0]); string packName = param[1]; string schemeId = param[2]; string channelNo = param[3]; var result = new BLL.UpdateInfo().Del(id); if (result) { string keyName = string.Format("hPackList:{0}_{1}_{2}", schemeId, packName, channelNo); var client = _GetRedisClient(); client.Del(keyName); UpdateCache(); Bind(); } Alert("删除" + (result ? "成功" : "失败")); } catch (Exception ex) { Alert("删除失败!"); //异常 } }
private void Bind() { var appList = new updatesys_cms.BLL.AppInfo().GetAll(); string act = Request.QueryString["act"]; ddlAppList.DataTextField = "AppName"; ddlAppList.DataValueField = "AppID"; ddlAppList.DataSource = appList; ddlAppList.DataBind(); // 初始化 txtForceUpdateVerCode.Text = "0"; if (act == "edit" && _UpdateId > 0) { Model.UpdateInfo updateInfo = new BLL.UpdateInfo().GetOne(_UpdateId); if (updateInfo != null) { ddlAppList.SelectedValue = updateInfo.AppId.ToString(); txtChannelNo.Text = updateInfo.ChannelNo; txtVerName.Text = updateInfo.VerName; txtVerCode.Text = updateInfo.VerCode.ToString(); txtPackMD5.Text = updateInfo.PackMD5; txtPackName.Text = updateInfo.PackName; txtPackSize.Text = updateInfo.PackSize.ToString(); txtPackUrl.Text = updateInfo.PackUrl; txtUpdateDesc.Text = updateInfo.UpdateDesc.Replace("\n", "\r\n"); txtUpdatePrompt.Text = updateInfo.UpdatePrompt.Replace("\n", "\r\n"); ddlUpdateType.SelectedValue = updateInfo.UpdateType.ToString(); ddlSchemeId.SelectedValue = updateInfo.SchemeId.ToString(); ddlStatus.SelectedValue = updateInfo.Status.ToString(); txtForceUpdateVerCode.Text = updateInfo.ForceUpdateVerCode.ToString(); } } }
private bool Add(Model.UpdateInfo updateInfo) { bool add_result = new BLL.UpdateInfo().Add(updateInfo); return(add_result); }
private bool Update(Model.UpdateInfo updateInfo) { bool update_result = new BLL.UpdateInfo().Update(updateInfo); return(update_result); }