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(); }
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>"); } }
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 }
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(); }
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(); } }
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(); } }
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>"); } }
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>"); } }
public int InsertNews(News news) { news.f_id = new NewsCategoryManager().GetNewsCategoryId(news.f_name); return(new NewsService().InsertNews(news)); }
/// <summary> /// 添加新闻 /// </summary> /// <param name="news"></param> /// <returns></returns> public int Add_News(News news) { NewsSQL newsSQL = new NewsSQL(); return(newsSQL.Add_News(news)); }
/// <summary> /// 修改新闻 /// </summary> /// <param name="news"></param> public void Update_News(News news) { NewsSQL newsSQL = new NewsSQL(); newsSQL.Update_News(news); }
/// <summary> /// 增加新闻 /// </summary> /// <param name="news"></param> public void AddNews(News news) { inews.AddNews(news); }
/// <summary> /// 删除新闻 /// </summary> /// <param name="news"></param> public void RemoveNews(News news) { inews.RemoveNews(news); }
/// <summary> /// 发布新闻 /// </summary> /// <param name="news"></param> /// <returns></returns> public int PublishNews(News news) { return(newsService.PublishNews(news)); }
/// <summary> /// 修改新闻 /// </summary> /// <param name="n">新闻实体类</param> /// <returns></returns> public bool Update(News n) { return(ndao.Update(n)); }
/// <summary> /// 增加新闻 /// </summary> /// <param name="n">新闻实体类</param> /// <returns></returns> public bool Insert(News n) { return(ndao.Insert(n)); }
public int UpdateNews(News news) { return(new NewsService().UpdateNews(news)); }
/// <summary> /// 更新新闻 /// </summary> /// <param name="news"></param> /// <returns></returns> public int ModifyNews(News news) { return(newsService.ModifyNews(news)); }