public void BinData() { NewsSystem newsSystem = new NewsSystem(); News_List.DataSource = newsSystem.Get_News(AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex); News_List.DataBind(); }
protected void News_List_RowDeleting(object sender, GridViewDeleteEventArgs e) { int nID = Int32.Parse(News_List.DataKeys[e.RowIndex].Value.ToString()); NewsSystem newsSystem = new NewsSystem(); newsSystem.Delete_News(nID); BinData(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Admin_User"] == null) { Response.Redirect("login.aspx"); Response.End(); } else { NewsSystem newsSystem = new NewsSystem(); AspNetPager1.RecordCount = newsSystem.Get_NewsNum(); } }
public void BinData() { NewsSystem newsSystem = new NewsSystem(); if (nClassID > 0) { List_News.DataSource = newsSystem.Get_News(AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex, nClassID); } else { List_News.DataSource = newsSystem.Get_News(AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex); } List_News.DataBind(); }
public void BinData() { News news = new News(); NewsSystem newsSystem = new NewsSystem(); news = newsSystem.Get_SintNews(nID); ID.Value = news.ID.ToString(); Title.Text = news.Title; Source.Text = news.Source; Author.Text = news.Source; Content.Value = news.Content; Updatatime.Value = news.Updatatime.ToString(); Click.Text = news.Click.ToString(); i180cn.i180cn.SetListBoxItem(ClassID, news.NewClass.ClassID.ToString()); }
protected void Update_Btn_Click(object sender, EventArgs e) { News news = new News(); news.ID = Int32.Parse(ID.Value.ToString()); news.Title = Title.Text.ToString(); news.Source = Source.Text.ToString(); news.Author = Author.Text.ToString(); news.Content = Content.Value.ToString(); news.Updatatime = DateTime.Parse(Updatatime.Value.ToString()); news.Click = Int32.Parse(Click.Text.ToString()); NewClassSystem newClassSystem = new NewClassSystem(); news.NewClass = newClassSystem.Get_SintNewClass(Int32.Parse(ClassID.SelectedValue)); NewsSystem newsSystem = new NewsSystem(); newsSystem.Update_News(news); Response.Write("<script>alert('修改成功');location.href='Get_News.aspx';</script>"); }
public void BinData() { Model.News news = new Model.News(); NewsSystem newsSystem = new NewsSystem(); news = newsSystem.Get_SintNews(nID); if (news.ID == nID) { ClassName.Text = ">" + news.NewClass.ClassName; Title_1.Text = ">" + news.Title; Title_2.Text = news.Title; Updatatime.Text = news.Updatatime.ToString(); Author.Text = news.Author; Source.Text = news.Source; Content.Text = news.Content; } else { Response.Write("<script>alert('数据不存在');history.back(1);</script>"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { Title = "科技有限公司"; if (Request.Params["ClassID"] != null) { nClassID = Int32.Parse(Request.Params["ClassID"].ToString()); } if (!Page.IsPostBack) { NewsSystem newsSystem = new NewsSystem(); if (nClassID > 0) { AspNetPager1.RecordCount = newsSystem.Get_NewsNum(nClassID); NewClassSystem newClassSystem = new NewClassSystem(); ClassName.Text = ">" + newClassSystem.Get_SintNewClass(nClassID).ClassName; } else { AspNetPager1.RecordCount = newsSystem.Get_NewsNum(); } } }
protected void Button1_Click(object sender, EventArgs e) { News news = new News(); news.Title = Title.Text.ToString(); news.Source = Source.Text.ToString(); news.Author = Author.Text.ToString(); news.Content = Content.Value.ToString(); news.Updatatime = DateTime.Now; news.Click = Int32.Parse(Click.Text.ToString()); NewClassSystem newClassSystem = new NewClassSystem(); news.NewClass = newClassSystem.Get_SintNewClass(Int32.Parse(ClassID.SelectedValue)); NewsSystem newsSystem = new NewsSystem(); if (newsSystem.Add_News(news) > 0) { Response.Write("<script>alert('添加成功');location.href='Get_News.aspx';</script>"); } else { Response.Write("<script>alert('添加失败');history.back(1);</script>"); } }
public override void PanelInit() { base.PanelInit(); newsSystem = new NewsSystem(); AddButtonClick("Close", HandleUnityAction); }