Exemplo n.º 1
0
    public void BinData()
    {
        NewsSystem newsSystem = new NewsSystem();

        News_List.DataSource = newsSystem.Get_News(AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
        News_List.DataBind();
    }
Exemplo n.º 2
0
    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();
    }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 4
0
    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();
    }
Exemplo n.º 5
0
    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());
    }
Exemplo n.º 6
0
    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>");
    }
Exemplo n.º 7
0
    public void BinData()
    {
        Model.News news       = new Model.News();
        NewsSystem newsSystem = new NewsSystem();

        news = newsSystem.Get_SintNews(nID);
        if (news.ID == nID)
        {
            ClassName.Text  = "&gt;" + news.NewClass.ClassName;
            Title_1.Text    = "&gt;" + 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();
        }
    }
Exemplo n.º 8
0
 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 = "&gt;" + newClassSystem.Get_SintNewClass(nClassID).ClassName;
         }
         else
         {
             AspNetPager1.RecordCount = newsSystem.Get_NewsNum();
         }
     }
 }
Exemplo n.º 9
0
    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>");
        }
    }
Exemplo n.º 10
0
 public override void PanelInit()
 {
     base.PanelInit();
     newsSystem = new NewsSystem();
     AddButtonClick("Close", HandleUnityAction);
 }