protected void gridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "MemDelete") { Cultural.Model.Board mem = new Cultural.Model.Board(); mem = bll.GetModel(int.Parse(e.CommandArgument.ToString())); mem.Status = "0"; bll.Update(mem); BindData(); Cultural.BLL.Information infoBLL = new Cultural.BLL.Information(); infoBLL.DeleteBoardInfo(mem.BoardID); } }
public void DropDownListBind() { Cultural.Model.Board board = new Cultural.Model.Board(); List <Cultural.Model.Board> bList = boardBll.GetModelList(" BoardName='下载中心' and Status ='1' "); board = bList.Count > 0 ? bList[0] : null; if (board != null) { bList = boardBll.GetModelList(string.Format(" ParentID={0} and Status ='1' ", board.BoardID)); for (int i = 0; i < bList.Count; i++) { ddlDownLoad.Items.Add(new ListItem(bList[i].BoardName, bList[i].BoardID.ToString())); } } }
protected void Page_Load(object sender, EventArgs e) { id = Request.QueryString["id"]; if (!IsPostBack) { BindDropdownList(); Cultural.Model.Board board = new Cultural.Model.Board(); if (id != null && id.ToString() != "") { board = bll.GetModel(int.Parse(id)); ddlParent.SelectedIndex = ddlParent.Items.IndexOf(ddlParent.Items.FindByValue(board.ParentID.ToString())); txtBoardName.Text = board.BoardName; } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; Cultural.BLL.Department departBll = new Cultural.BLL.Department(); context.Response.ContentType = "text/plain"; string paraFID = context.Request["FID"]; //读取参数PageSize if (paraFID != null && paraFID.Trim() == "DL") //列表界面 { int paraIndex = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]); //读取参数PageSize int paraSize = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize string paraBoardID = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString(); //读取参数 DepartInfo departInfo = new DepartInfo(); departInfo.DepartList = departBll.DataTableToList(departBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " Weight desc,DepartID asc ", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]); departInfo.TotalNum = departBll.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID)); context.Response.Write(JsonHelper.Serialize(departInfo)); } if (paraFID != null && paraFID.Trim() == "DownL") //列表界面 { int paraIndex = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]); //读取参数PageSize int paraSize = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize string paraBoardID = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString(); //读取参数 DownLoadInfo downLoadInfo = new DownLoadInfo(); Cultural.BLL.DownCenter dcBll = new Cultural.BLL.DownCenter(); downLoadInfo.DownCenterList = dcBll.DataTableToList(dcBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " PubTime desc ", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]); foreach (Cultural.Model.DownCenter dc in downLoadInfo.DownCenterList) { dc.PubTime = dc.PubTime.Substring(0, 10); } downLoadInfo.TotalNum = dcBll.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID)); context.Response.Write(JsonHelper.Serialize(downLoadInfo)); } if (paraFID != null && paraFID.Trim() == "DownD") //详细界面 { int paraIndex = context.Request["InfoID"] == null ? 0 : int.Parse(context.Request["InfoID"]); //读取参数InfoID Cultural.Model.DownCenter downLoad = new Cultural.Model.DownCenter(); Cultural.BLL.DownCenter dcBll = new Cultural.BLL.DownCenter(); downLoad = dcBll.GetModel(paraIndex); DownLoadInfo downLoadInfo = new DownLoadInfo(); downLoadInfo.DownCenterList = new List <Cultural.Model.DownCenter>(); downLoadInfo.DownCenterList.Add(downLoad); Cultural.BLL.Board boardBll = new Cultural.BLL.Board(); Cultural.Model.Board board = new Cultural.Model.Board(); board = boardBll.GetModel(int.Parse(downLoad.BoardID.ToString())); downLoadInfo.BName = board.BoardName; context.Response.Write(JsonHelper.Serialize(downLoadInfo)); } }
public void BindDropdownList() { Cultural.BLL.Board boardBll = new Cultural.BLL.Board(); Cultural.Model.Board board = new Cultural.Model.Board(); List <Cultural.Model.Board> boardList = new List <Cultural.Model.Board>(); boardList = boardBll.GetModelList(string.Format(" BoardName ='{0}' and Status!='0' ", "中心成果")); if (boardList != null && boardList.Count > 0) { List <Cultural.Model.Board> bList = new List <Cultural.Model.Board>(); bList = boardBll.GetModelList(string.Format(" ParentID={0} and Status!='0' ", boardList[0].BoardID)); ddlBoard.DataTextField = "BoardName"; ddlBoard.DataValueField = "BoardID"; ddlBoard.DataSource = bList; ddlBoard.DataBind(); } }
public void BindTextBox(Cultural.Model.Achievement ach) { if (ach != null) { txtAchName.Text = ach.AchieveName; Cultural.BLL.Board boardBll = new Cultural.BLL.Board(); Cultural.Model.Board board = new Cultural.Model.Board(); board = boardBll.GetModel(int.Parse(ach.BoardID.ToString())); txtBoard.Text = board != null ? board.BoardName : ""; txtCharger.Text = ach.MainCharge; txtContent.Text = ach.Content; txtMeaning.Text = ach.Meaning; txtOrigon.Text = ach.Origon; txtPublish.Text = ach.Publish; txtFileName.Text = ach.AccName; FilePath = Maticsoft.Common.CommonFun.URLConverToServer(string.Format("{0}{1}", "../../FileUpload/", ach.AccURL)); } }
protected void btnConfirm_Click(object sender, EventArgs e) { Cultural.Model.Board board = new Cultural.Model.Board(); board.BoardName = txtBoardName.Text.Trim(); board.ParentID = int.Parse(ddlParent.SelectedValue); board.Status = "1"; if (id != null && id.ToString() != "") { board.BoardID = int.Parse(id); bll.Update(board); Maticsoft.Common.CommonFun.Show(this.Page, "修改成功!"); } else { bll.Add(board); Maticsoft.Common.CommonFun.Show(this.Page, "保存成功"); } BindDropdownList(); txtBoardName.Text = ""; }
public void ProcessRequest(HttpContext context) { Cultural.BLL.Information infoBLL = new Cultural.BLL.Information(); context.Response.ContentType = "text/plain"; string paraFID = context.Request["FID"]; //读取参数PageSize if (paraFID != null && paraFID.Trim() == "NL") //列表界面 { int paraIndex = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]); //读取参数PageSize int paraSize = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize string paraBoardID = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString(); //读取参数 NewsInfo newsInfo = new NewsInfo(); newsInfo.Info = infoBLL.DataTableToList(infoBLL.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " Weight desc,PubTime desc ", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]); newsInfo.TotalNum = infoBLL.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID)); newsInfo.BoardID = paraBoardID; for (int i = 0; i < newsInfo.Info.Count; i++) { newsInfo.Info[i].Content = newsInfo.Info[i].Content == null ? "" : Maticsoft.Common.CommonFun.ClearHtml(newsInfo.Info[i].Content).Length > 230 ? Maticsoft.Common.CommonFun.ClearHtml(newsInfo.Info[i].Content).Substring(0, 229) + "…" :CommonFun.ClearHtml(newsInfo.Info[i].Content); } context.Response.Write(JsonHelper.Serialize(newsInfo)); } else if (paraFID != null && paraFID.Trim() == "ND") //详细界面 { int paraID = context.Request["InfoID"] == null ? 1 : int.Parse(context.Request["InfoID"]); //读取参数PageSize if (paraID != null && paraID.ToString().Trim() != "") { Cultural.Model.Information info = new Cultural.Model.Information(); info = infoBLL.GetModel(paraID); NewsInfo newsInfo = new NewsInfo(); newsInfo.Info = new List <Cultural.Model.Information>(); if (info != null) { newsInfo.Info.Add(info); //阅读次数更新 info.ReadNum += 1; infoBLL.Update(info); Cultural.BLL.Member memBll = new Cultural.BLL.Member(); newsInfo.Author = memBll.GetModel(int.Parse(info.Author.ToString().Trim())).MembName; Cultural.BLL.Board boardBll = new Cultural.BLL.Board(); Cultural.Model.Board board = new Cultural.Model.Board(); board = boardBll.GetModel(int.Parse(info.BoardID.ToString())); if (board != null && board.ParentID == 0) { newsInfo.BoardID = board.BoardID.ToString(); newsInfo.BoardName = board.BoardName; newsInfo.BName = ""; } else if (board != null && board.ParentID != 0) { Cultural.Model.Board board2 = new Cultural.Model.Board(); board2 = boardBll.GetModel(int.Parse(board.ParentID.ToString())); if (board2 != null) { newsInfo.BoardID = board2.BoardID.ToString(); newsInfo.BoardName = board2.BoardName; newsInfo.BName = board.BoardName; } else { newsInfo.BoardID = board.BoardID.ToString(); newsInfo.BoardName = board.BoardName; newsInfo.BName = ""; } } else { newsInfo.BoardID = board.BoardID.ToString(); newsInfo.BoardName = board.BoardName; newsInfo.BName = ""; } } context.Response.Write(JsonHelper.Serialize(newsInfo)); } else { context.Response.Write(JsonHelper.Serialize("error")); } } else if (paraFID != null && paraFID.Trim() == "CND") //中心概括界面 邹瑶修改20140225 { int paraID = context.Request["InfoID"] == null ? 1 : int.Parse(context.Request["InfoID"]); //读取参数PageSize NewsInfo newsInfo = new NewsInfo(); if (paraID != null && paraID.ToString().Trim() != "") { newsInfo.Info = infoBLL.GetModelList(string.Format(" BoardID ={0} and Status!='0' order by Weight desc,PubTime desc ", paraID)); } context.Response.Write(JsonHelper.Serialize(newsInfo)); } else { context.Response.Write(JsonHelper.Serialize("error")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { id = GetBIDByQueryStr(Request.QueryString["BName"]); boardIDInfo.Value = id; try { if (id != null && id.ToString().Trim() != "") { //取得该id的板块信息 Cultural.Model.Board board = new Cultural.Model.Board(); board = boardBll.GetModel(int.Parse(id)); if (board != null) { if (board.ParentID == 0)//为第一级板块 { //一级板块名赋值 ParentBName = board.BoardName; //取得所有子级板块 List <Cultural.Model.Board> boardList = new List <Cultural.Model.Board>(); boardList = boardBll.GetModelList(string.Format(" ParentID ={0} and Status!='0' ", board.BoardID)); //如果有子版块 if (boardList.Count > 0) { //给页面子版块赋值 repBoardList.DataSource = boardList; repBoardList.DataBind(); //显示第一个板块的Infomation boardIDInfo.Value = boardList[0].BoardID.ToString(); DataSet infoData = new DataSet(); infoData = departBll.GetListByPage(string.Format(" BoardID={0} and Status!=0", boardList[0].BoardID), " Weight desc,DepartID asc ", 1, 15); boardInfoNum.Value = departBll.GetRecordCount(string.Format(" BoardID={0} and Status!=0", boardList[0].BoardID)).ToString(); repDepartList.DataSource = infoData; repDepartList.DataBind(); } else // 如果没有子版块 { //给页面子版块赋值null repBoardList.DataSource = null; repBoardList.DataBind(); //显示第一个板块的Infomation DataSet infoData = new DataSet(); infoData = departBll.GetListByPage(string.Format(" BoardID={0} and Status!=0", board.BoardID), " Weight desc,DepartID asc ", 1, 15); boardInfoNum.Value = departBll.GetRecordCount(string.Format(" BoardID={0} and Status!=0", board.BoardID)).ToString(); repDepartList.DataSource = infoData; repDepartList.DataBind(); } } else //非一级板块 { repDepartList.DataSource = null; repDepartList.DataBind(); } } else { ParentBName = Request.QueryString["BName"]; Maticsoft.Common.MessageBox.Show(this.Page, "可能原因:\\n 1.网络错误\\n 2.暂时无数据\\n 请重试!"); } } else { ParentBName = Request.QueryString["BName"]; Maticsoft.Common.MessageBox.Show(this.Page, "可能原因:\\n 1.网络错误\\n 2.暂时无数据\\n 请重试!"); } repAnnounce.DataSource = infoBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", htBID["公告"] == "" ? "0" : htBID["公告"]), " Weight desc,PubTime desc ", 0, 9); repAnnounce.DataBind(); repRelaxInfo.DataSource = infoBll.GetListByPage(string.Format(" (BoardID ={0} or BoardID in(select BoardID from Board where ParentID ={1}) ) and Status!='0' ", htBID["闲情偶寄"] == "" ? "0" : htBID["闲情偶寄"], htBID["闲情偶寄"] == "" ? "0" : htBID["闲情偶寄"]), " Weight desc,PubTime desc ", 0, 8); repRelaxInfo.DataBind(); } catch (Exception ex) { ParentBName = Request.QueryString["BName"]; Maticsoft.Common.MessageBox.Show(this.Page, "可能原因:\\n 1.网络错误\\n 2.暂时无数据\\n 请重试!" + ex.Message); } } }