protected void Page_Load(object sender, EventArgs e) { if (!Utils.CheckRole("9")) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('权限信息','没有权限!','/Systestcomjun/index.aspx',2)</script>"); return; } if (!IsPostBack) { ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config")); imgformat = site.ImgFormat; ddlNewsType.DataSource = new ZhongLi.BLL.NewsType().GetAllList(); ddlNewsType.DataTextField = "Name"; ddlNewsType.DataValueField = "NewsTypeID"; ddlNewsType.DataBind(); ltlTitle.Text = "新增内容"; if (Request.QueryString["NewsID"] != null) { int NewsID = Convert.ToInt32(Request.QueryString["NewsID"]); ZhongLi.Model.News news = bll.GetModel(NewsID); txtTitle.Text = news.Title; if (news.ImgUrl != "") { img_Photo.ImageUrl = news.ImgUrl; } ddlNewsType.SelectedValue = news.NewsType + ""; ddlhot.SelectedValue = news.Hot == true ? "1" : "2"; txtAbsDes.Text = news.AbsDes; txtNewsCon.Text = news.NewsCon; } } }
protected void Page_Load(object sender, EventArgs e) { BindNews(); string type = Request["type"]; string id = Request["id"]; switch (type) { case "news": NEWM = NEW.GetModel(Convert.ToInt32(id)); title = NEWM.Title; count = NEWM.NewsCon; time = "发表时间:" + NEWM.CreateTime.ToString(); break; case "jo": jom = jo.GetModel(Convert.ToInt32(id)); title = jom.JobTraTitle; count = jom.JobTraDes; time = ""; break; case "cp": cpm = cp.GetModel(Convert.ToInt32(id)); title = cpm.CPTitle; count = cpm.CPDes; time = "发表时间:" + cpm.CreateTime.ToString(); break; } ZhongLi.Model.siteconfig config = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config")); log = config.log; phone = config.phone; mail = config.mail; bjtu = config.bgtu; QRCode = config.QRCode; }