updaz.aspx.cs
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using COM.OA.Entity;
  12. using COM.OA.BLL;
  13. public partial class tzManager_updaz : System.Web.UI.Page
  14. {
  15.     sendword sw = new sendword();
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         if (!this.IsPostBack)
  19.         {
  20.             //从request中取sw_id
  21.             int sw_id = Int32.Parse(this.Request["sw_id"]);
  22.             //放入页面隐藏表单中
  23.             this.txtsw_id.Text = sw_id.ToString();
  24.             //根据ID从数据库中查询信息
  25.             sw = sendwordBLL.Select(sw_id);
  26.             //把信息分别放入文档框中
  27.             this.txtTitle.Text = sw.sw_title;
  28.             this.ftbContent.Text = sw.sw_content;
  29.             this.txtsw_dept_id.Text = sw.sw_dept_id.ToString();
  30.             this.txtuid.Text = sw.sw_u_id.ToString();
  31.             this.txtstate.Text = sw.sw_state.ToString();
  32.             this.txtreads.Text = sw.sw_reads.ToString();
  33.         }
  34.     }
  35.     protected void btnUpdate_Click(object sender, EventArgs e)
  36.     {
  37.         //从页面去出数据并放入实体
  38.         sw.sw_id = Int32.Parse(this.txtsw_id.Text);
  39.         sw.sw_title = this.txtTitle.Text;
  40.         sw.sw_content = this.ftbContent.Text;
  41.         sw.sw_releasetime = DateTime.Parse(DateTime.Now.ToString());
  42.         sw.sw_dept_id = Int32.Parse(this.txtsw_dept_id.Text);
  43.         sw.sw_u_id = Int32.Parse(this.txtuid.Text);
  44.         sw.sw_state = Int32.Parse(this.txtstate.Text);
  45.         sw.sw_reads = Int32.Parse(this.txtreads.Text);
  46.         //修改数据库中的数据
  47.         sendwordBLL.Update(sw);
  48.         //跳转页面
  49.         this.Response.Redirect("guanlitongzhi.aspx");
  50.     }
  51.     protected void btnselect_Click(object sender, EventArgs e)
  52.     {
  53.         //从页面取值
  54.         string tiaojian = this.txtwhere.Text;
  55.         //放入session
  56.         Session.Add("tiaojian", tiaojian);
  57.         //跳转到查询页面
  58.         this.Response.Write(string.Format(GetRedirect.REDIRECT, "mohuchaxun.aspx"));
  59.     }
  60.     protected void btnQuxiao_Click(object sender, EventArgs e)
  61.     {
  62.         //跳转到上级页面
  63.         this.Response.Write(string.Format(GetRedirect.REDIRECT, "guanlitongzhi.aspx"));
  64.     }
  65. }