public void BinData() { NewClassSystem newClassSystem = new NewClassSystem(); NewClass_List.DataSource = newClassSystem.Get_NewClass(0); NewClass_List.DataBind(); }
protected void NewClass_List_RowDeleting(object sender, GridViewDeleteEventArgs e) { int nClassID = Int32.Parse(NewClass_List.DataKeys[e.RowIndex].Value.ToString()); NewClassSystem newClassSystem = new NewClassSystem(); newClassSystem.Delete_NewClass(nClassID); BinData(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { NewClassSystem newClassSystem = new NewClassSystem(); ClassID.DataSource = newClassSystem.Get_NewClass(0); ClassID.DataBind(); } }
public void BinClassData() { NewClassSystem newClassSystem = new NewClassSystem(); ClassID.DataSource = newClassSystem.Get_NewClass(0); ClassID.DataTextField = "ClassName"; ClassID.DataValueField = "ClassID"; ClassID.DataBind(); }
public void BinData() { NewClass newClass = new NewClass(); NewClassSystem newClassSystem = new NewClassSystem(); newClass = newClassSystem.Get_SintNewClass(nClassID); ClassID.Value = newClass.ClassID.ToString(); ClassName.Text = newClass.ClassName.ToString(); ParentID.Value = newClass.ParentID.ToString(); }
protected void Update_Btn_Click(object sender, EventArgs e) { NewClass newClass = new NewClass(); newClass.ClassID = Int32.Parse(ClassID.Value.ToString()); newClass.ClassName = ClassName.Text.ToString(); newClass.ParentID = Int32.Parse(ParentID.Value.ToString()); NewClassSystem newClassSystem = new NewClassSystem(); newClassSystem.Update_NewClass(newClass); Response.Write("<script>alert('修改成功');location.href='Get_NewClass.aspx';</script>"); }
protected void Add_Btn_Click(object sender, EventArgs e) { if (Page.IsValid) { NewClass newClass = new NewClass(); newClass.ClassName = ClassName.Text.ToString(); newClass.ParentID = 0; NewClassSystem newClassSystem = new NewClassSystem(); if (newClassSystem.Add_NewClass(newClass) > 0) { Response.Write("<script>alert('添加成功');location.href='Get_NewClass.aspx';</script>"); } else { Response.Write("<script>alert('添加失败');history.back(1);</script>"); } } }
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>"); }
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>"); } }