Edit.aspx.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:3k
源码类别:
Email客户端
开发平台:
Visual C++
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class manage_govEdit : System.Web.UI.Page
- {
- BaseClass bc = new BaseClass();
- static string strStyle;
- static string strType;
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- DataSet ds = bc.GetDataSet("select * from tbNews where id='" + Request.QueryString["id"] + "'", "tbNews");
- DataRow[] row = ds.Tables[0].Select();
- foreach (DataRow rs in row)
- {
- TextBox1.Text = rs["title"].ToString();
- TextBox2.Text = rs["content"].ToString();
- strStyle = rs["Style"].ToString();
- strType = rs["type"].ToString();
- }
- switch (strStyle)
- {
- case "时政要闻":
- dlGov.Text = strType;
- dlGov.Visible = true;
- Label1.Text = "编辑★★时政要闻★★";
- break;
- case "经济动向":
- dlJj.Text = strType;
- dlJj.Visible = true;
- Label1.Text = "编辑★★经济动向★★";
- break;
- case "世界军事":
- dlArmy.Text = strType;
- dlArmy.Visible = true;
- Label1.Text = "编辑★★世界军事★★";
- break;
- case "科学教育":
- dlKJ.Text = strType;
- dlKJ.Visible = true;
- Label1.Text = "编辑★★科学教育★★";
- break;
- case "法治道德":
- dlFz.Text = strType;
- dlFz.Visible = true;
- Label1.Text = "编辑★★法治道德★★";
- break;
- case "社会现象":
- dlSh.Text = strType;
- dlSh.Visible = true;
- Label1.Text = "编辑★★社会现象★★";
- break;
- case "体育世界":
- dlTy.Text = strType;
- dlTy.Visible = true;
- Label1.Text = "编辑★★体育世界★★";
- break;
- case "时尚娱乐":
- dlSh.Text = strType;
- dlSh.Visible = true;
- Label1.Text = "编辑★★时尚娱乐★★";
- break;
- }
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- bc.ExecSQL("UPDATE tbNews SET Title = '"+TextBox1.Text+"', Content = '"+TextBox2.Text+"', Style = '"+strStyle+"', Type = '"+strType+"' WHERE (ID = '"+Request.QueryString["id"]+"')");
- Response.Write(bc.MessageBox("数据修改成功!"));
- Response.Write("<script>location='list.aspx'</script>");
- }
- protected void Button2_Click(object sender, EventArgs e)
- {
- TextBox1.Text = "";
- TextBox2.Text = "";
- }
- }