protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int num = Convert.ToInt32(htmlInputCheckBox.Value); try { IList all = News_Article.Init().GetAll("typeid=" + num, null); if (all != null && all.Count > 0) { foreach (object current in all) { News_ArticleInfo news_ArticleInfo = current as News_ArticleInfo; Help.DeleteFiles(news_ArticleInfo.FilePath); } } } catch { } string cmdText = "delete from News_Article where typeid=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); News_Type.Init().Delete(num); this.Show(); }
private void Show() { IList all = News_Type.Init().GetAll(null, " order by orders asc"); this.rpt.DataSource = all; this.rpt.DataBind(); this.num.InnerHtml = "当前 总计 - <span style='color:#ff0000; font-weight:bold;'>" + all.Count + "</span> 个 记录数据"; }
private void Show(string id) { News_TypeInfo byId = News_Type.Init().GetById(Convert.ToInt32(id)); this.ViewState["ni"] = byId; this.TypeName.Value = byId.TypeName; this.Orders.Value = string.Concat(byId.Orders); this.Notes.Value = byId.Notes; }
private void Show() { this.news_menu = "<li class='menu'><a href='NewsList.aspx' ><img src='../Style/Mobile/thumbs/other.png'/><span class='name'>所有资讯 ({0})</span><span class='arrow'></span></a></li> "; this.news_menu = string.Format(this.news_menu, this.GetAllNums()); IList all = News_Type.Init().GetAll(null, " order by orders asc"); for (int i = 0; i < all.Count; i++) { News_TypeInfo news_TypeInfo = all[i] as News_TypeInfo; this.news_menu += string.Format(this.s, news_TypeInfo.id, news_TypeInfo.TypeName, this.GetNumsByType(news_TypeInfo.id)); } }
protected void Page_Load(object sender, EventArgs e) { this.power_menu = this.GetUserPowerMenu(this.Modules); IList all = News_Type.Init().GetAll(null, " order by orders asc"); for (int i = 0; i < all.Count; i++) { News_TypeInfo news_TypeInfo = all[i] as News_TypeInfo; this.news_type += string.Format(this.ft, "nn" + (i + 1), news_TypeInfo.TypeName, "News/News_List.aspx?tid=" + news_TypeInfo.id); this.news_type1 += string.Format(this.ft1, "nn" + (i + 1), news_TypeInfo.TypeName); } this.uid.Value = this.Uid; Bas_ComInfo bas_ComInfo = HttpContext.Current.Application["cominfo"] as Bas_ComInfo; this.comname = bas_ComInfo.ComName; this.weburl = bas_ComInfo.WebUrl; this.logo = bas_ComInfo.Logo; Sys_UserInfo byId = Sys_User.Init().GetById(Convert.ToInt32(this.Uid)); byId.RoleGUID = (byId.RoleGUID ?? ""); if (!string.IsNullOrEmpty(byId.RoleGUID) && byId.RoleGUID.ToLower().Contains(".jpg")) { this.wallpaper = "myLib.desktop.wallpaper.init('" + byId.RoleGUID + "');"; } if (bas_ComInfo.MsgState != 1) { this.message_div.Visible = false; } else { try { int num = byId.MsgTime; if (num == -1) { this.message_div.Visible = false; } if (num > -1) { num = num * 60 * 1000; this.notice_time.Value = string.Concat(num); this.stay_time.Value = "30000"; } } catch { } } if (bas_ComInfo.BBSState == 1) { this.dxbbs_div.Visible = true; } }
private void Show() { if (!string.IsNullOrEmpty(base.Request.QueryString["nid"])) { News_ArticleInfo byId = News_Article.Init().GetById(Convert.ToInt32(base.Request.QueryString["nid"])); this.NewsTitle.Value = byId.NewsTitle; this.Bodys.Value = byId.Notes; this.ComID.SelectedValue = string.Concat(byId.ComID); if (byId.ShareDeps != "") { this.sel.SelectedIndex = 1; this.tr.Attributes["style"] = ""; this.userlist_dep.Value = byId.ShareDeps; this.namelist_dep.Value = byId.namelist; } this.TypeID.SelectedValue = string.Concat(byId.TypeID); if (!string.IsNullOrEmpty(byId.FilePath) && byId.FilePath.Contains("|")) { this.Attachword.Visible = true; List <TmpInfo> list = new List <TmpInfo>(); string[] array = byId.FilePath.Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { if (array[i].Trim() != "") { TmpInfo tmpInfo = new TmpInfo(); int num = array[i].LastIndexOf('/') + 1; string tmp = array[i].Substring(num, array[i].Length - num); string tmp2 = array[i].Replace("~", ""); tmpInfo.Tmp1 = array[i]; tmpInfo.Tmp2 = tmp; tmpInfo.Tmp3 = tmp2; list.Add(tmpInfo); } } this.rpt.DataSource = list; this.rpt.DataBind(); } } IList all = News_Type.Init().GetAll(null, null); this.TypeID.DataTextField = "TypeName"; this.TypeID.DataValueField = "id"; this.TypeID.DataSource = all; this.TypeID.DataBind(); }
private void Show(string nid) { IList all = News_Type.Init().GetAll(null, " order by orders asc"); for (int i = 0; i < all.Count; i++) { News_TypeInfo news_TypeInfo = all[i] as News_TypeInfo; this.news_menu += string.Format(this.news_tmp, news_TypeInfo.id, news_TypeInfo.TypeName); } using (DataSet readList = this.GetReadList(nid)) { int pageSize = 100; int num = 0; try { if (!string.IsNullOrEmpty(base.Request.QueryString["page"])) { num = Convert.ToInt32(base.Request.QueryString["page"]); } } catch { } if (num == 0) { num = 1; } PagedDataSource pagedDataSource = new PagedDataSource(); DataView defaultView = readList.Tables[0].DefaultView; defaultView.Sort = "et3 Desc,et4 Desc"; pagedDataSource.DataSource = defaultView; pagedDataSource.AllowPaging = true; pagedDataSource.PageSize = pageSize; pagedDataSource.CurrentPageIndex = num - 1; this.rpt.DataSource = pagedDataSource; this.rpt.DataBind(); this.Page2.sty("meneame", num, pagedDataSource.PageCount, "?nid=" + nid + "&page="); this.num.InnerHtml = "当前查询条件总计 - <span style='color:#ff0000; font-weight:bold;'>" + readList.Tables[0].Rows.Count + "</span> 条 记录数据"; } }
protected void Save_Btn(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { News_TypeInfo news_TypeInfo = this.ViewState["ni"] as News_TypeInfo; news_TypeInfo.Notes = this.Notes.Value; news_TypeInfo.TypeName = this.TypeName.Value; news_TypeInfo.Orders = Convert.ToInt32(this.Orders.Value); News_Type.Init().Update(news_TypeInfo); } else { News_TypeInfo news_TypeInfo = new News_TypeInfo(); news_TypeInfo.TypeName = this.TypeName.Value; news_TypeInfo.Notes = this.Notes.Value; news_TypeInfo.Orders = Convert.ToInt32(this.Orders.Value); News_Type.Init().Add(news_TypeInfo); } string str = HttpContext.Current.Server.HtmlEncode("您好!分类保存成功!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../../Manage/News/NewsType_List.aspx&tip=" + str); }
private void Show() { IList all = News_Type.Init().GetAll(null, " order by orders asc"); for (int i = 0; i < all.Count; i++) { News_TypeInfo news_TypeInfo = all[i] as News_TypeInfo; if (string.Concat(news_TypeInfo.id) == (base.Request.QueryString["tid"] ?? "")) { this.news_list = news_TypeInfo.TypeName; } } int pageSize = 30; int num = 0; try { if (!string.IsNullOrEmpty(base.Request.QueryString["page"])) { num = Convert.ToInt32(base.Request.QueryString["page"]); } } catch { } if (num == 0) { num = 1; } PagedDataSource pagedDataSource = new PagedDataSource(); string text = " a.TypeID = b.id and ( a.ShareDeps='' or a.ShareDeps like '%#" + this.DepID + "#%') "; string text2 = base.Request.QueryString["keywords"]; if (!string.IsNullOrEmpty(text2) && Utils.CheckSql(text2)) { text = " a.TypeID = b.id and ( a.ShareDeps='' or a.ShareDeps like '%#" + this.DepID + "#%') "; text = text + " and (a.NewsTitle like '%" + text2 + "%' ) "; } if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { string text3 = base.Request.QueryString["tid"]; text = string.Concat(new string[] { " a.TypeID=", text3, " and a.TypeID = b.id and ( a.ShareDeps='' or a.ShareDeps like '%#", this.DepID, "#%') " }); } string cmdText = "select a.*,b.TypeName from News_Article as a,News_Type as b where " + text + " order by a.id desc"; using (DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, cmdText, new SqlParameter[0])) { this.num.InnerHtml = "当前总计 - <span style='color:#ff0000; font-weight:bold;'>" + dataSet.Tables[0].Rows.Count + "</span> 条 记录数据"; pagedDataSource.DataSource = dataSet.Tables[0].DefaultView; pagedDataSource.AllowPaging = true; pagedDataSource.PageSize = pageSize; pagedDataSource.CurrentPageIndex = num - 1; this.rpt.DataSource = pagedDataSource; this.rpt.DataBind(); if (!string.IsNullOrEmpty(base.Request.QueryString["keywords"])) { this.Page1.sty("meneame", num, pagedDataSource.PageCount, "?keywords=" + text2 + "&page="); } if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { this.Page1.sty("meneame", num, pagedDataSource.PageCount, "?tid=" + base.Request.QueryString["tid"] + "&page="); } this.Page1.sty("meneame", num, pagedDataSource.PageCount, "?page="); } }
private void Show(string nid) { IList all = News_Type.Init().GetAll(null, " order by orders asc"); News_ArticleInfo byId = News_Article.Init().GetById(Convert.ToInt32(nid)); if (this.Modules.Contains("29") || byId.ShareDeps.Trim() == "" || byId.ShareDeps.Contains("#" + this.DepID + "#")) { this.NewsTitle.InnerText = byId.NewsTitle; this.Creator.InnerText = byId.CreatorRealName + " (" + byId.CreatorDepName + ")"; this.addtime.InnerText = Utils.ConvertDate2(byId.AddTime); byId.Notes = (byId.Notes ?? ""); if (byId.Notes.ToLower().Contains("script")) { this.Notes.InnerHtml = byId.Notes.ToLower().Replace("script", "scrript"); } else { this.Notes.InnerHtml = byId.Notes; } this.Page.Title = "标题:" + byId.NewsTitle; this.AddReadRecord(nid); if (byId.ShareDeps.Contains(",")) { string text = ""; string[] array = byId.ShareDeps.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { if (array[i].Contains("#")) { text = text + array[i].Split(new char[] { '#' })[0] + " "; } } this.Deps.InnerText = text; } else { this.Deps.InnerText = "全体人员"; } if (!string.IsNullOrEmpty(byId.FilePath)) { this.fjs = "<span style='font-weight:bold; color:Black;'>相关文件</span>:<br>"; string[] array = byId.FilePath.Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { if (array[i].Trim() != "") { int num = array[i].LastIndexOf('/') + 1; string arg = array[i].Substring(num, array[i].Length - num); string s = array[i].Replace("~", ""); this.fjs += string.Format(this.fj, base.Server.UrlEncode(s), arg); } } } } else { base.Response.Write("<script>alert('您没有查看权限');window.location='../News/News_List.aspx';</script>"); } string text2 = "我的资讯:"; for (int i = 0; i < all.Count; i++) { News_TypeInfo news_TypeInfo = all[i] as News_TypeInfo; this.news_menu += string.Format(this.news_tmp, news_TypeInfo.id, news_TypeInfo.TypeName); string text3 = " | "; if (i == all.Count - 1) { text3 = ""; } if (news_TypeInfo.id == byId.TypeID) { string text4 = text2; text2 = string.Concat(new string[] { text4, "<span style='color:#ff0000;'>", news_TypeInfo.TypeName, "</span>", text3 }); } else { text2 = text2 + news_TypeInfo.TypeName + text3; } } this.top.InnerHtml = text2; }