/// <summary> /// 批量删除数据 /// </summary> private void OnDelete() { string itemsAppend = hV.Value.Trim(); if (string.IsNullOrEmpty(itemsAppend)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "请至少勾选一行进行操作", "错误提醒", "error"); return; } if (bll == null) { bll = new BLL.ContentDetail(); } string[] itemsAppendArr = itemsAppend.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); List <string> list = itemsAppendArr.ToList <string>(); if (bll.DeleteBatch(list)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "操作成功"); Bind(); } else { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "操作失败", "温馨提醒", "error"); } }
private void OnSave() { string sTitle = txtTitle.Value.Trim(); if (string.IsNullOrEmpty(sTitle)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "标题不能为空,请检查", "温馨提醒", "error"); return; } string sParent = txtParent.Value.Trim(); Guid contentTypeId = Guid.Empty; if (!string.IsNullOrEmpty(sParent)) { Guid.TryParse(sParent, out contentTypeId); } string sContent = HttpUtility.UrlDecode(hEditor1.Value).Trim(); if (bll == null) { bll = new BLL.ContentDetail(); } Model.ContentDetail model = new Model.ContentDetail(); model.Title = sTitle; model.ContentTypeID = contentTypeId; model.ContentText = sContent; model.Sort = 0; model.LastUpdatedDate = DateTime.Now; model.UserId = WebHelper.Common.GetUserId(); int effectCount = -1; if (!string.IsNullOrEmpty(nId)) { model.NumberID = nId; effectCount = bll.Update(model); } else { effectCount = bll.Insert(model); } if (effectCount == 110) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "已存在相同记录", "温馨提醒", "error"); return; } if (effectCount > 0) { WebHelper.MessageBox.MessagerShow(this.Page, lbtnPostBack, "操作成功"); } else { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "操作失败"); } }
private void Bind() { int totalCount = 0; if (bll == null) { bll = new BLL.ContentDetail(); } rpData.DataSource = bll.GetDataSet(1, 10, out totalCount, "", null);; rpData.DataBind(); }
private void Bind() { //查询条件 GetSearchItem(); int totalCount = 0; if (bll == null) { bll = new BLL.ContentDetail(); } rpData.DataSource = bll.GetDataSet(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out totalCount, sqlWhere, parms == null ? null : parms.ToArray());; rpData.DataBind(); AspNetPager1.RecordCount = totalCount; }
private void Bind() { if (!string.IsNullOrEmpty(nId)) { if (bll == null) { bll = new BLL.ContentDetail(); } Model.ContentDetail model = bll.GetModel(nId); if (model != null) { txtTitle.Value = model.Title; txtParent.Value = model.ContentTypeID.ToString(); hEditor1.Value = model.ContentText; } } }
private void Bind() { BLL.ContentDetail cdBll = new BLL.ContentDetail(); Dictionary <string, string> titleDic = WebHelper.ContentDetailDataProxy.GetKeyValueByType("兑奖帮助"); if (titleDic != null && titleDic.Count > 0) { string titleAppend = string.Empty; foreach (KeyValuePair <string, string> kvp in titleDic) { titleAppend += "<a href=\"/s/t.html?nId=" + kvp.Key + "\" class=\"a\" target=\"_blank\">" + kvp.Value + "</a>"; } titleAppend += "<span class=\"clr\"></span>"; ltrTicketHelp.Text = titleAppend; } }
private void Bind() { if (!Page.IsPostBack) { BLL.ContentDetail bll = new BLL.ContentDetail(); Model.ContentDetailInfo model = bll.GetModel(nId); if (model != null) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("<div id='cTitle' class='tc'>{0}</div>", model.Title, model.ContentTypeID); sb.AppendFormat("<div id='cContent' class='mt10'>{0}</div>", model.ContentText); ltrContent.Text = sb.ToString(); } else { ltrContent.Text = "<div id='cTitle' class='tc'></div><div id='cContent' class='mt10'></div>"; } } }
/// <summary> /// 获取属于当前类型ID的内容标题和ID /// </summary> /// <param name="nId"></param> /// <returns></returns> public static Dictionary <string, string> GetKeyValueByTypeID(object nId) { BLL.ContentDetail bll = new BLL.ContentDetail(); if (!enableCaching) { return(bll.GetKeyValueByTypeID(nId)); } string key = "contentDetail_" + nId.ToString() + ""; Dictionary <string, string> data = (Dictionary <string, string>)HttpRuntime.Cache[key]; if (data == null) { data = bll.GetKeyValueByTypeID(nId); AggregateCacheDependency cd = DependencyFactory.GetContentDetailDependency(); HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddHours(contentDetailTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } return(data); }
/// <summary> /// 获取前第15行数据 /// </summary> /// <returns></returns> public static IList <Model.ContentDetail> GetListByNotice() { BLL.ContentDetail bll = new BLL.ContentDetail(); if (!enableCaching) { return(bll.GetList(1, 15, "and ct.TypeName = '开奖公告'", null)); } string key = "contentDetail_Notice"; IList <Model.ContentDetail> data = (IList <Model.ContentDetail>)HttpRuntime.Cache[key]; if (data == null) { data = bll.GetList(1, 15, "and ct.TypeName = '开奖公告'", null); AggregateCacheDependency cd = DependencyFactory.GetContentDetailDependency(); HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddHours(contentDetailTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } return(data); }
/// <summary> /// 获取当前根节点下的所有内容类型和内容 /// </summary> /// <param name="typeName"></param> /// <returns></returns> public static List <Model.ContentDetailInfo> GetSiteContent() { BLL.ContentDetail bll = new BLL.ContentDetail(); if (!enableCaching) { return(bll.GetSiteContent("站点所有帮助")); } string key = "sitecontent_all"; List <Model.ContentDetailInfo> data = (List <Model.ContentDetailInfo>)HttpRuntime.Cache[key]; if (data == null) { data = bll.GetSiteContent("站点所有帮助"); AggregateCacheDependency cd = DependencyFactory.GetProvinceCityDependency(); HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddHours(siteContentTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } return(data); }
public string GetSiteHelper() { string htmlAppend = string.Empty; if (ctBll == null) { ctBll = new BLL.ContentType(); } if (cdBll == null) { cdBll = new BLL.ContentDetail(); } cdList = cdBll.GetList(); List <Model.ContentTypeInfo> ctList = ctBll.GetList(); Model.ContentTypeInfo rootModel = ctList.Find(delegate(Model.ContentTypeInfo m) { return(m.TypeName == "站点所有帮助"); }); if (rootModel != null) { htmlAppend += GetChildren(rootModel, ctList); } return(htmlAppend); }