updateshenpi.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. using System.Collections.Generic;
  14. public partial class lb_shenpi_updateshenpi : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         int id =Int32.Parse( this.Request.Params["id"]);
  19.         examine ex = examineBLL.Select(id);
  20.         users u = usersBLL.Select(ex.ex_u_id,true,false);
  21.         this.txbsy.Text = ex.ex_applycontent;
  22.         this.FreeTextBox1.Text = ex.ex_define;
  23.         this.txbbz.Text = ex.ex_remark;
  24.         this.txbname.Text = u.employee.em_name;
  25.     }
  26.     protected void btnsubmit_Click(object sender, EventArgs e)
  27.     {
  28.         //验证
  29.         this.check();
  30.         //申请人
  31.         string name = this.txbname.Text;
  32.         string where = "u_em_id =(select em_id from employee where em_name ='" + name + "')";
  33.         IList<users> elist = usersBLL.Select(where);
  34.         users u = elist[0];
  35.         examine ex = new examine();
  36.         //事由
  37.         ex.ex_applycontent = this.txbsy.Text;
  38.         //备注
  39.         ex.ex_remark = this.txbbz.Text;
  40.         //说明
  41.         ex.ex_define = this.FreeTextBox1.Text;
  42.         //申请时间
  43.         ex.ex_applytime = DateTime.Now.ToLocalTime();
  44.         ex.ex_examinetiem = DateTime.Now.ToLocalTime();
  45.         //状态
  46.         ex.ex_state = 0;
  47.         //申请人ID
  48.         ex.ex_u_id = u.u_id;
  49.         //部门
  50.         ex.ex_dept_id = u.u_dept_id;
  51.         //把审批的实体放入会话
  52.         Session.Add("examines", ex);
  53.         this.Response.Redirect("updatepost.aspx");
  54.     }
  55.     protected void btnReset_Click(object sender, EventArgs e)
  56.     {
  57.         this.txbsy.Text = "";
  58.         this.txbbz.Text = "";
  59.         this.FreeTextBox1.Text = "";
  60.     }
  61.     private void check()
  62.     {
  63.         if (this.txbsy.Text == "")
  64.         {
  65.             this.Response.Write(string.Format(GetRedirect.WINALERT, "请填写事由"));
  66.             this.txbsy.Focus();
  67.             return;
  68.         }
  69.         if (this.FreeTextBox1.Text == "")
  70.         {
  71.             this.Response.Write(string.Format(GetRedirect.WINALERT, "请填写审批说明"));
  72.             this.FreeTextBox1.Focus = true;
  73.             return;
  74.         }
  75.     }
  76. }