protected void ddlptype_SelectedIndexChanged(object sender, EventArgs e) { ddlType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(this.ddlptype.SelectedValue)); ddlType.DataTextField = "typename"; ddlType.DataValueField = "id"; ddlType.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["del"] != null) { NewsService.SetDelete(int.Parse(Request["del"]), true); //Response.Write(Request["reUrl"].Replace("|", "&")); //Response.End(); string backurl = BackPage(pds(), Request["reUrl"].Replace("|", "&"), "news_manage.aspx?page=" + (pds().CurrentPageIndex - 1).ToString() + getcanshu()); Response.Redirect(backurl); //Response.Redirect(Request["reUrl"].Replace("|", "&")); } else if (Request["id"] != null && Request["comm"] != null) { NewsService.SetComm(int.Parse(Request["id"]), Request["comm"] == "1"?true:false); Response.Redirect(Request.UrlReferrer.ToString()); } else if (Request["id"] != null && Request["flag"] != null) { NewsService.SetFlag(int.Parse(Request["id"]), Request["flag"] == "1"?true:false); Response.Redirect(Request.UrlReferrer.ToString()); } else if (Request["id"] != null && Request["istop"] != null) { NewsService.SetTop(int.Parse(Request["id"]), Request["istop"] == "1"?true:false); Response.Redirect(Request.UrlReferrer.ToString()); } else { title = NewsTypeService.GetTypeName(int.Parse(Request["type"])); } ddlType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"])); ddlType.DataTextField = "typename"; ddlType.DataValueField = "id"; ddlType.DataBind(); //int nid = 12; //for (int i = 0; i < nt.DefaultView.Count;i++ ) //{ // if (nt.DefaultView[i]["id"].ToString() == "86") // { // nid = i; // } //} //if(Request["type"]=="4") //{ nt.Rows.RemoveAt(nid); } this.rpNewsType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"])); this.rpNewsType.DataBind(); //ddlType.Items.Insert(0, new ListItem("请选择分类", "0")); rtNews.DataSource = pds(); rtNews.DataBind(); } }
void Bind() { this.rpNewsDefault.DataSource = NewsTypeService.GetDefault(5); this.rpNewsDefault.DataBind(); if (Request["edit"] == null) { int id = 0; if (Request["id"] != null) { id = int.Parse(Request["id"]); } gvMain.DataSource = NewsTypeService.GetChildTypeByParentId(id); gvMain.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["del"] != null) { News ob = NewsService.GetNewsById(int.Parse(Request["del"])); if (ob != null) { if (File.Exists(MapPath(ob.img))) { File.Delete(MapPath(ob.img)); } if (File.Exists(MapPath(ob.upfile))) { File.Delete(MapPath(ob.upfile)); } NewsService.DeleteNews(ob); } string backurl = BackPage(pds(), Request["reUrl"].Replace("|", "&"), "news_recyle.aspx?page=" + (pds().CurrentPageIndex - 1).ToString() + getcanshu()); Response.Redirect(backurl); } else if (Request["back"] != null && Request["back"] != "") { NewsService.SetDelete(int.Parse(Request["back"]), false); Response.Redirect(Request.UrlReferrer.ToString()); } else { title = NewsTypeService.GetTypeName(int.Parse(Request["type"])) + "回收"; } ddlType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"])); ddlType.DataTextField = "typename"; ddlType.DataValueField = "id"; ddlType.DataBind(); this.rpNewsType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"])); this.rpNewsType.DataBind(); //ddlType.Items.Insert(0, new ListItem("请选择分类", "0")); rtNews.DataSource = pds(); rtNews.DataBind(); } }
public void BindData() { this.rpLink.DataSource = LinkService.GetLink(5); this.rpLink.DataBind(); lbWebName.Text = SettingManager.WebName; lbAddress.Text = SettingManager.GetSettingValue("Contact.Address"); lbFax.Text = SettingManager.GetSettingValue("Contact.Fax"); lbMobilePhone.Text = SettingManager.GetSettingValue("Contact.MobilePhone"); lbTePhone.Text = SettingManager.GetSettingValue("Contact.TelPhone"); WeiXin = SettingManager.GetSettingValue("Contact.WeiXin"); QQ = SettingManager.GetSettingValue("Contact.QQ"); this.rpZD.DataSource = NewsTypeService.GetChildTypeByParentId(5); this.rpZD.DataBind(); }
public void getdata() { //this.rpIntro.DataSource = LJH.Intro.GetTable("select * from tIntro"); //this.rpIntro.DataBind(); //this.ltNewsType1.Text =LJH.News.GetCount(1,0).ToString(); //this.ltNewsType2.Text =LJH.News.GetCount(2, 0).ToString(); //this.ltNewsType3.Text = LJH.Product.GetCount(0).ToString(); this.rpMenu.DataSource = NewsTypeService.GetChildTypeByParentId(0); this.rpMenu.DataBind(); //this.ltNewsType4.Text =LJH.News.GetCount(4, 0).ToString(); //this.ltNewsType5.Text =LJH.News.GetCount(5, 0).ToString(); //this.ltNewsType6.Text =LJH.News.GetCount(6, 0).ToString(); //this.ltNewsType7.Text =LJH.News.GetCount(7, 0).ToString(); //this.ltNewsType8.Text =LJH.News.GetCount(8, 0).ToString(); }
public void getdata() { string type = ""; if (Request["type"] != null) { type = Request["type"]; } else if (Request["id"] != null) { type = NewsService.GetTypeId(int.Parse(Request["id"])).ToString(); } if (type != "") { int ptype = int.Parse(type); int pid = NewsTypeService.GetPid(int.Parse(type)); if (pid == 0) { title = NewsTypeService.GetTypeName(int.Parse(type)); _ptype = int.Parse(type); } else { title = NewsTypeService.GetTypeName(pid); ptype = pid; _ptype = pid; } this.rpMenu.DataSource = NewsTypeService.GetChildTypeByParentId(ptype); this.rpMenu.DataBind(); _ctype = Convert.ToInt32(type); } else { title = NewsTypeService.GetTypeName(1); this.rpMenu.DataSource = NewsTypeService.GetChildTypeByParentId(1); this.rpMenu.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { lbTitle.Text = NewsTypeService.GetTypeName(int.Parse(Request["type"])); path1 = MapPath(App_ImgPath); path2 = MapPath(App_FilePath); if (Request["edit"] != null) { sbEdit.Visible = true; Submit1.Visible = false; btBack.Visible = true; } else { sbEdit.Visible = false; Submit1.Visible = true; btBack.Visible = false; } if (!IsPostBack) { //if(Request["type"]=="63") //{ // this.tbfile.Visible = true; //} this.ddlptype.DataSource = NewsTypeService.GetChildTypeByParentId(0); this.ddlptype.DataTextField = "typename"; this.ddlptype.DataValueField = "id"; this.ddlptype.DataBind(); // this.ddlptype.Items.Remove(this.ddlptype.Items.FindByValue("10")); this.ddlptype.SelectedValue = Request["type"]; ddlType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(this.ddlptype.SelectedValue)); ddlType.DataTextField = "typename"; ddlType.DataValueField = "id"; ddlType.DataBind(); //ddlType.Items.Insert(0, new ListItem("请选择分类", "0")); tbTime.Text = DateTime.Now.ToString(); if (Request["edit"] != null) { hdUrl.Value = Request.UrlReferrer.ToString(); News ob = NewsService.GetNewsById(int.Parse(Request["edit"])); if (ob != null) { tbTitle.Text = ob.title; tbTitle2.Text = ob.title2; tbSource.Text = ob.source; ddlType.SelectedValue = ob.type.ToString(); //ftbContent.Value = n["content"].ToString(); txtFull.Text = ob.content; rbComm.SelectedValue = ob.flag == true?"1":"0"; tbTime.Text = ob.addtime.ToString("yyyy-MM-dd"); tbAuthor.Text = ob.author; tbfile.Text = ob.upfile; this.tburl.Text = ob.url; this.rbisdiredict.SelectedValue = ob.isdiredict == true?"1":"0"; if (!string.IsNullOrEmpty(ob.img)) { Image1.Visible = true; //Image1.ImageUrl = n["img"].ToString(); Image1.ImageUrl = "" + ob.img; btDelImg.Visible = true; } if (!string.IsNullOrEmpty(ob.upfile)) { btDelFile.Visible = true; } } } } }