public void RaiseCallbackEvent(string eventArgument) { if (!string.IsNullOrEmpty(eventArgument)) { if (eventArgument != "0") { B_Column column = new B_Column(); int chid = int.Parse(eventArgument); DataTable dt = column.GetFormatListItemByChannelId(chid); foreach (DataRow row in dt.Rows) { _result += row["ColName"].ToString(); _result += ","; _result += row["ColId"].ToString(); _result += "|"; } if (_result == "") { _result = _result.Substring(0, _result.Length - 1); } //_result = _result.Substring(0, _result.Length - 1); } } }
public void ClearCache(string str) { B_Create createBll = new B_Create(); B_Channel channelBll = new B_Channel(); B_Column columnBll = new B_Column(); channelBll.ClearCache(); columnBll.ClearCache(); createBll.ClearHashTable(); GC.Collect(); }
public string CreateColumn(string colId) { B_SiteInfo SiteBll = new B_SiteInfo(); B_Channel ChannelBll = new B_Channel(); M_Site SiteModel = SiteBll.GetSiteModel(); if (!SiteModel.IsStaticType) { return "fail$全站参数设置没有开启生成静态页面功能"; } B_Column columnBll = new B_Column(); M_Column columnModel = columnBll.GetColumn(int.Parse(colId)); M_Channel channelModel = ChannelBll.GetChannel(columnModel.ChId); if (channelModel == null || !channelModel.IsStaticType) { return "fail$所属频道没有开启生成静态页面功能"; } Session["createcolid"] = colId; return "succ$" + colId; }
protected void CreateColumnAll() { B_Column bll = new B_Column(); DataTable dt = bll.GetList(false).ToTable(); RecordCount = dt.Rows.Count; Response.Write("<script>SetTotal(" + RecordCount + ")</script>\r\n"); Response.Flush(); for (int i = 1; i <= RecordCount; i++) { string per = ((i * 100) / RecordCount).ToString("F1"); CreateBll.CreateColumnlPage((int)dt.Rows[i-1]["ColId"]); Response.Write("<script>SetPr('" + per + "%'," + i + ")</script>\r\n"); Response.Flush(); } Response.Write("<script>SetPr('100.0%'," + RecordCount + ")</script>"); Response.Write("<script>document.getElementById('finallytd').innerText = '生成完毕'</script>"); Response.Flush(); CreateBll.ClearHashTable(); }
void BindData() { ddlParent.DataSource = Bll.GetChannelByType(modelId); ddlParent.DataTextField = "ChName"; ddlParent.DataValueField = "ChId"; ddlParent.DataBind(); ddlParent.Items.Insert(0,new ListItem("当前频道","0")); int chId = int.Parse(ddlParent.SelectedValue); B_Column column = new B_Column(); ddlChild.DataSource = column.GetFormatListItemByChannelId(chId); ddlChild.DataTextField = "ColName"; ddlChild.DataValueField = "ColId"; ddlChild.DataBind(); ddlChild.Items.Insert(0, new ListItem("当前栏目", "0")); ddlChild.Items.Insert(1, new ListItem("所有栏目", "all")); }
public void Auditing(string tableName, string idStr, int status) { if (idStr != string.Empty) { B_Admin admin = new B_Admin(); B_Column column = new B_Column(); B_Channel channel = new B_Channel(); string[] strArray = idStr.Split(new char[] { ',' }); foreach (string str in strArray) { int id = int.Parse(str); DataRow info = this.dal.GetInfo(tableName, id); if (info == null) { break; } int columnId = (int) info["colid"]; M_Column column2 = column.GetColumn(columnId); if (column2 == null) { break; } M_Channel channel2 = channel.GetChannel(column2.ChId); if (channel2 == null) { break; } int num3 = (int) info["Status"]; int num4 = (int) info["UserType"]; int userId = (int) info["UId"]; string str2 = info["UName"].ToString(); string newValue = info["Title"].ToString(); string str4 = channel2.Notice2.Replace("{@标题}", newValue); M_LoginAdmin loginModel = admin.GetLoginModel(); int adiminId = loginModel.UserId; string loginName = loginModel.LoginName; this.dal.Auditing(tableName, id, status, adiminId, loginName); if ((((status == 3) && (num3 != 3)) && (num4 == 0)) && (userId > 0)) { B_WebMessage message = new B_WebMessage(); M_WebMessage message2 = new M_WebMessage(); message2.Title = "稿件采纳通知"; message2.Content = str4; message2.IsRead = 0; message2.IsSend = 1; message2.ReceiverId = userId; message2.ReceiverName = str2; message2.SendId = 0; message2.SendName = loginName; message2.OverdueDate = DateTime.Now; message2.AddDate = DateTime.Now; message2.ReceiverDel = 0; message2.SendDel = 0; message.Insert(message2); } M_User user = new B_User().GetUser(userId); if (user == null) { break; } B_UserGroup group = new B_UserGroup(); M_UserGroup model = group.GetModel(user.GroupID); if (group == null) { break; } int num7 = int.Parse(group.Power_UserGroup("Contribute", 0, model.GroupPower)) * column2.ScoreReward; new B_Money().Integral(num7, userId); } } }
public void Cancel(string tableName, int id) { B_Channel channel = new B_Channel(); B_Column column = new B_Column(); B_Admin admin = new B_Admin(); DataRow info = this.dal.GetInfo(tableName, id); if (info != null) { int columnId = (int) info["colid"]; M_Column column2 = column.GetColumn(columnId); if (column2 != null) { M_Channel channel2 = channel.GetChannel(column2.ChId); if (channel2 != null) { int num2 = (int) info["UserType"]; int num3 = (int) info["UId"]; string str = info["UName"].ToString(); string newValue = info["Title"].ToString(); string str3 = channel2.Notice1.Replace("{@标题}", newValue); string loginName = admin.GetLoginModel().LoginName; this.dal.Cancel(tableName, id); if ((num2 == 0) && (num3 > 0)) { B_WebMessage message = new B_WebMessage(); M_WebMessage model = new M_WebMessage(); model.Title = "退稿通知"; model.Content = str3; model.IsRead = 0; model.IsSend = 1; model.ReceiverId = num3; model.ReceiverName = str; model.SendId = 0; model.SendName = loginName; model.OverdueDate = DateTime.Now; model.AddDate = DateTime.Now; model.ReceiverDel = 0; model.SendDel = 0; message.Insert(model); } } } } }
public DataTable GetFirstColumnList(string chId) { B_Column column = new B_Column(); DataTable dt = column.GetFirstColumnByChannelId(int.Parse(chId)).ToTable(); return dt; }
protected void ddlChinel_OnSelectedIndexChanged(object sender, EventArgs e) { B_Column bll = new B_Column(); DataView dv = bll.GetFirstColumnByChannelId(int.Parse(ddlChinel.SelectedValue)); lbColumn.DataSource = dv; lbColumn.DataTextField = "ColName"; lbColumn.DataValueField = "ColId"; lbColumn.DataBind(); }
void BindData() { ddlParent.DataSource = Bll.GetChannelByType(modelId); ddlParent.DataTextField = "ChName"; ddlParent.DataValueField = "ChId"; ddlParent.DataBind(); ddlCh.DataSource = Bll.GetList(false); ddlCh.DataTextField = "ChName"; ddlCh.DataValueField = "ChId"; ddlCh.DataBind(); if (ddlParent.Items.Count > 0) { int chId = int.Parse(ddlParent.SelectedValue); B_Column column = new B_Column(); ColumnList.DataSource = column.GetFormatListItemByChannelId(chId); ColumnList.DataTextField = "ColName"; ColumnList.DataValueField = "ColId"; ColumnList.DataBind(); lbColumn.DataSource = column.GetFormatListItemByChannelId(int.Parse(ddlCh.SelectedValue.ToString())); lbColumn.DataTextField = "ColName"; lbColumn.DataValueField = "ColId"; lbColumn.DataBind(); } }
private void Bind() { int ChType = 1; B_Dictionary dictionBll = new B_Dictionary(); DataTable chTypeDt = dictionBll.GetDictionary(ChType); for (int i = 0; i < chTypeDt.Rows.Count; i++) { TreeNode chTypeNode = new TreeNode(); chTypeNode.ToolTip = "分类右键操作$" + chTypeDt.Rows[i]["id"].ToString(); chTypeNode.Text = chTypeDt.Rows[i]["DicName"].ToString(); chTypeNode.ImageUrl = "~/system/images/category.gif"; chTypeNode.NavigateUrl = "~/system/info/ChannelList.aspx?ChType=" + chTypeDt.Rows[i]["id"].ToString(); chTypeNode.Target = "ContentIframe"; tvNav.Nodes.Add(chTypeNode); } TreeNode chTypeOtherNode = new TreeNode(); chTypeOtherNode.ToolTip = "分类右键操作$0"; chTypeOtherNode.Text = "其他"; chTypeOtherNode.ImageUrl = "~/system/images/category.gif"; chTypeOtherNode.NavigateUrl = "~/system/info/ChannelList.aspx?ChType=0"; chTypeOtherNode.Target = "ContentIframe"; tvNav.Nodes.Add(chTypeOtherNode); B_Channel channelBll = new B_Channel(); B_Column columnBll = new B_Column(); DataView channelDv = channelBll.GetList(false); for (int i = 0; i < tvNav.Nodes.Count-1; i++) { int chType = int.Parse(chTypeDt.Rows[i]["id"].ToString()); DataTable chDt = channelDv.ToTable(); DataView chTypeDv = new DataView(chDt); chTypeDv.RowFilter=string.Format("[chtype]={0}",chType); for (int j = 0; j < chTypeDv.Count; j++) { TreeNode channelNode = new TreeNode(); channelNode.ToolTip = "频道右键操作$" + chTypeDv[j]["ChId"].ToString() + "$" + chTypeDv[j]["ChType"].ToString(); channelNode.Text = chTypeDv[j]["ChName"].ToString(); channelNode.ImageUrl = "~/system/images/folder.gif"; channelNode.NavigateUrl = "~/system/info/ColumnList.aspx?ChId=" + chTypeDv[j]["ChId"]; channelNode.Target = "ContentIframe"; tvNav.Nodes[i].ChildNodes.Add(channelNode); } for (int j = 0; j < chTypeDv.Count; j++) { DataView dv = columnBll.GetColumnListByChannelId((int)chTypeDv[j]["ChId"]); DataTable dt = dv.ToTable(); dv.Dispose(); BindColumn(0, tvNav.Nodes[i].ChildNodes[j], dt, (int)chTypeDv[j]["ModelType"], (int)chTypeDv[j]["ChId"]); } chDt.Dispose(); chTypeDv.Dispose(); } DataTable chDt2 = channelDv.ToTable(); DataView chTypeDv2 = new DataView(chDt2); chTypeDv2.RowFilter = "[chtype]=0 or [chtype] is null"; for (int j = 0; j < chTypeDv2.Count; j++) { TreeNode channelNode = new TreeNode(); channelNode.ToolTip = "频道右键操作$" + chTypeDv2[j]["ChId"].ToString() + "$" + chTypeDv2[j]["ChType"].ToString(); channelNode.Text = chTypeDv2[j]["ChName"].ToString(); channelNode.ImageUrl = "~/system/images/folder.gif"; channelNode.NavigateUrl = "~/system/info/ColumnList.aspx?ChId=" + chTypeDv2[j]["ChId"]; channelNode.Target = "ContentIframe"; tvNav.Nodes[tvNav.Nodes.Count - 1].ChildNodes.Add(channelNode); } for (int j = 0; j < chTypeDv2.Count; j++) { DataView dv = columnBll.GetColumnListByChannelId((int)chTypeDv2[j]["ChId"]); DataTable dt = dv.ToTable(); dv.Dispose(); BindColumn(0, tvNav.Nodes[tvNav.Nodes.Count - 1].ChildNodes[j], dt, (int)chTypeDv2[j]["ModelType"], (int)chTypeDv2[j]["ChId"]); } chDt2.Dispose(); chTypeDv2.Dispose(); }
void BindData() { ddlParent.DataSource = bll.GetList(false); ddlParent.DataTextField = "ChName"; ddlParent.DataValueField = "ChId"; ddlParent.DataBind(); #region 首页栏目导航频道 ddlNavChannel.DataSource = bll.GetList(false); ddlNavChannel.DataTextField = "ChName"; ddlNavChannel.DataValueField = "ChId"; ddlNavChannel.DataBind(); #endregion #region 文字头条频道与栏目 ddlChHeader.DataSource = bll.GetChannelByType(1); ddlChHeader.DataTextField = "ChName"; ddlChHeader.DataValueField = "ChId"; ddlChHeader.DataBind(); #endregion #region 图片头条 ddlPicChHeader.DataSource = bll.GetChannelByType(1); ddlPicChHeader.DataTextField = "ChName"; ddlPicChHeader.DataValueField = "ChId"; ddlPicChHeader.DataBind(); #endregion int chId = int.Parse(ddlParent.SelectedValue); B_Column column = new B_Column(); ddlChild.DataSource = column.GetFormatListItemByChannelId(chId); ddlChild.DataTextField = "ColName"; ddlChild.DataValueField = "ColId"; ddlChild.DataBind(); ddlChild.Items.Insert(0, new ListItem("当前栏目", "0")); ddlChild.Items.Insert(1, new ListItem("所有栏目", "all")); #region 文字头条频道与栏目 ddlCoHeader.DataSource = column.GetFormatListItemByChannelId(chId); ddlCoHeader.DataTextField = "ColName"; ddlCoHeader.DataValueField = "ColId"; ddlCoHeader.DataBind(); #endregion #region 文字头条 ddlPicCoHeader.DataSource = column.GetFormatListItemByChannelId(chId); ddlPicCoHeader.DataTextField = "ColName"; ddlPicCoHeader.DataValueField = "ColId"; ddlPicCoHeader.DataBind(); #endregion }
void BindData() { ddlParent.DataSource = Bll.GetChannelByType(modelId); ddlParent.DataTextField = "ChName"; ddlParent.DataValueField = "ChId"; ddlParent.DataBind(); if (ddlParent.SelectedValue == null || ddlParent.SelectedValue.Length == 0) { Response.Write("<script>alert('你所在的模型还没添加频道,不能指定子类标签')</script>"); } else { int chId = int.Parse(ddlParent.SelectedValue); B_Column column = new B_Column(); ddlChild.DataSource = column.GetFormatListItemByChannelId(chId); ddlChild.DataTextField = "ColName"; ddlChild.DataValueField = "ColId"; ddlChild.DataBind(); ddlChild.Items.Insert(0, new ListItem("当前栏目", "0")); } }