コード例 #1
0
ファイル: newshow.aspx.cs プロジェクト: kavilee2012/kvShop
    protected void Page_Load(object sender, EventArgs e)
    {
        Model.News mn = new Model.News();
        BLL.News bn = new BLL.News();
        mn.ID = Convert.ToInt32(Request.QueryString["uid"]);
        MySqlDataReader sdr = bn.datareader(mn);
        if (sdr.Read())
        {
            Label1.Text = sdr["_from"].ToString();
            Label2.Text = sdr["_author"].ToString();
            Label3.Text = sdr["_posttime"].ToString();
            Label4.Text = sdr["_content"].ToString();
            Label5.Text = sdr["_title"].ToString();
            Page.Title = Label5.Text + "新闻";
            int sum = Convert.ToInt32(sdr["_click"]);
            sdr.Close();
            sum = sum + 1;
            string str = "update news set _click=" + sum + " where _id=" + mn.ID + "";
            int result = DB.ExecuteSql(str);
            if (result > 0)
            {
                Label6.Text = sum.ToString();
                //Label6.Text = dr["_click"].ToString();
            }

        }
        repeat();
    }
コード例 #2
0
ファイル: newsselect.aspx.cs プロジェクト: kavilee2012/kvShop
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.News mn = new Model.News();
        BLL.News bn = new BLL.News();
        int result = 0;
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
            if (cb.Checked)
            {
                mn.ID = Convert.ToInt32(GridView1.DataKeys[i].Value);
                Response.Write(mn.ID);
                result = bn._delete(mn);
            }
        }

        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='newslist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='newslist.aspx'</script>");
        }
    }
コード例 #3
0
ファイル: newshow.aspx.cs プロジェクト: Hilvcha/net-shopping
    protected void Page_Load(object sender, EventArgs e)
    {
        //下载于www.51aspx.com
        Model.News mn = new Model.News();
        BLL.News   bn = new BLL.News();
        mn.ID = Convert.ToInt32(Request.QueryString["uid"]);
        SqlDataReader sdr = bn.datareader(mn);

        if (sdr.Read())
        {
            Label1.Text = sdr["_origin"].ToString();
            Label2.Text = sdr["_news_author"].ToString();
            Label3.Text = sdr["_post_time"].ToString();
            Label4.Text = sdr["_news_content"].ToString();
            Label5.Text = sdr["_news_title"].ToString();
            Page.Title  = Label5.Text + "新闻";
            int sum = Convert.ToInt32(sdr["_hits"]);
            sdr.Close();
            sum = sum + 1;
            string str    = "update news set _hits=" + sum + " where _id=" + mn.ID + "";
            int    result = DB.ExecuteSql(str);
            if (result > 0)
            {
                Label6.Text = sum.ToString();
                //Label6.Text = dr["_click"].ToString();
            }
        }
        repeat();

        //下载于www.51aspx.com
    }
コード例 #4
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.News mn     = new Model.News();
        BLL.News   bn     = new BLL.News();
        int        result = 0;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
            if (cb.Checked)
            {
                mn.ID = Convert.ToInt32(GridView1.DataKeys[i].Value);
                Response.Write(mn.ID);
                result = bn._delete(mn);
            }
        }

        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='newslist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='newslist.aspx'</script>");
        }
    }
コード例 #5
0
ファイル: WebLeft.ascx.cs プロジェクト: lincoln56/robinerp
 protected void Page_Load(object sender, EventArgs e)
 {
     News news = new News();
     this.rptNewUsers.DataSource = news.ListByTypeName("新手指南", 6);
     this.rptNewUsers.DataBind();
     //this.rptSer.DataSource = news.ListByTypeName("客服中心", 6);
     //this.rptSer.DataBind();
 }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _source.Text = "秋哈网";
         datablind();
         Model.News mn = new Model.News();
         mn.ID = Convert.ToInt32(Request.QueryString["uid"]);
         BLL.News      bn  = new BLL.News();
         SqlDataReader sdr = bn.datareader(mn);
         if (sdr.Read())
         {
             _title.Text  = sdr["_news_title"].ToString();
             _source.Text = sdr["_origin"].ToString();
             author.Text  = sdr["_news_author"].ToString();
             DropDownList1.SelectedValue = sdr["_top_state"].ToString();
             DropDownList2.SelectedValue = sdr["_news_cateid"].ToString();
             DropDownList3.SelectedValue = sdr["_pic_state"].ToString();
             FCKeditor1.Value            = sdr["_news_content"].ToString();
         }
         sdr.Close();
     }
 }
コード例 #7
0
ファイル: newsupdate.aspx.cs プロジェクト: kavilee2012/kvShop
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _source.Text = "秋哈网";
         datablind();
         Model.News mn = new Model.News();
         mn.ID = Convert.ToInt32(Request.QueryString["uid"]);
         BLL.News bn = new BLL.News();
         MySqlDataReader sdr = bn.datareader(mn);
         if (sdr.Read())
         {
             _title.Text = sdr["_title"].ToString();
             _source.Text=sdr["_from"].ToString();
             author.Text = sdr["_author"].ToString();
             DropDownList1.SelectedValue = sdr["_top"].ToString();
             DropDownList2.SelectedValue = sdr["_cateid"].ToString();
             DropDownList3.SelectedValue = sdr["_ispic"].ToString();
             FCKeditor1.Value = sdr["_content"].ToString();
         }
         sdr.Close();
     }
 }
コード例 #8
0
ファイル: newsadd.aspx.cs プロジェクト: kavilee2012/kvShop
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.News mn = new Model.News();
     BLL.News bn = new BLL.News();
     mn.Title = _title.Text;
     mn.From = _source.Text;
     mn.Author = author.Text;
     mn.Content = FCKeditor1.Value;
     mn.Top = Convert.ToInt32( DropDownList1.SelectedValue);
     mn.Ispic = Convert.ToInt32(DropDownList2.SelectedValue);
     mn.Cateid = Convert.ToInt32(DropDownList3.SelectedValue);
     int result = bn.add(mn);
     //Response.Write(_title.Text);
     //Response.Write(author.Text);
     if (result > 0)
     {
         Response.Write("<script>alert('添加成功'),location.href='newsadd.aspx'</script>");
     }
     else
     {
         Response.Write("<script>alert('添加失败'),location.href='newsadd.aspx'</script>");
     }
 }
コード例 #9
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Model.News mn = new Model.News();
        mn.ID = Convert.ToInt32(Request.QueryString["uid"]);

        mn.Title   = _title.Text;
        mn.From    = _source.Text;
        mn.Author  = author.Text;
        mn.Content = FCKeditor1.Value;
        mn.Top     = Convert.ToInt32(DropDownList1.SelectedValue);
        mn.Ispic   = Convert.ToInt32(DropDownList2.SelectedValue);
        mn.Cateid  = Convert.ToInt32(DropDownList3.SelectedValue);
        BLL.News bn     = new BLL.News();
        int      result = bn.update(mn);

        if (result > 0)
        {
            Response.Write("<script>alert('添加成功'),location.href='newslist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('添加失败'),location.href=''newslist.aspx'</script>");
        }
    }
コード例 #10
0
        public int InsertNews(News news)
        {
            news.f_id = new NewsCategoryManager().GetNewsCategoryId(news.f_name);

            return(new NewsService().InsertNews(news));
        }
コード例 #11
0
ファイル: NewsSystem.cs プロジェクト: zhenghua75/kmdx_web
        /// <summary>
        /// 添加新闻
        /// </summary>
        /// <param name="news"></param>
        /// <returns></returns>
        public int Add_News(News news)
        {
            NewsSQL newsSQL = new NewsSQL();

            return(newsSQL.Add_News(news));
        }
コード例 #12
0
ファイル: NewsSystem.cs プロジェクト: zhenghua75/kmdx_web
        /// <summary>
        /// 修改新闻
        /// </summary>
        /// <param name="news"></param>
        public void Update_News(News news)
        {
            NewsSQL newsSQL = new NewsSQL();

            newsSQL.Update_News(news);
        }
コード例 #13
0
ファイル: NewsManager.cs プロジェクト: LIYINHAI/GY1
 /// <summary>
 /// 增加新闻
 /// </summary>
 /// <param name="news"></param>
 public void AddNews(News news)
 {
     inews.AddNews(news);
 }
コード例 #14
0
ファイル: NewsManager.cs プロジェクト: LIYINHAI/GY1
 /// <summary>
 /// 删除新闻
 /// </summary>
 /// <param name="news"></param>
 public void RemoveNews(News news)
 {
     inews.RemoveNews(news);
 }
コード例 #15
0
 /// <summary>
 /// 发布新闻
 /// </summary>
 /// <param name="news"></param>
 /// <returns></returns>
 public int PublishNews(News news)
 {
     return(newsService.PublishNews(news));
 }
コード例 #16
0
 /// <summary>
 /// 修改新闻
 /// </summary>
 /// <param name="n">新闻实体类</param>
 /// <returns></returns>
 public bool Update(News n)
 {
     return(ndao.Update(n));
 }
コード例 #17
0
 /// <summary>
 /// 增加新闻
 /// </summary>
 /// <param name="n">新闻实体类</param>
 /// <returns></returns>
 public bool Insert(News n)
 {
     return(ndao.Insert(n));
 }
コード例 #18
0
 public int UpdateNews(News news)
 {
     return(new NewsService().UpdateNews(news));
 }
コード例 #19
0
 /// <summary>
 /// 更新新闻
 /// </summary>
 /// <param name="news"></param>
 /// <returns></returns>
 public int ModifyNews(News news)
 {
     return(newsService.ModifyNews(news));
 }