updatepost.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.BLL;
  12. using COM.OA.Entity;
  13. using System.Data.SqlClient;
  14. using System.Collections.Generic;
  15. public partial class lb_shenpi_updatepost : System.Web.UI.Page
  16. {
  17.     protected void Page_Load(object sender, EventArgs e)
  18.     {
  19.     }
  20.     protected void ddl_bumen_SelectedIndexChanged(object sender, EventArgs e)
  21.     {
  22.         if (this.ddl_bumen.Text != "选择部门")
  23.         {
  24.             int id = Int32.Parse(this.ddl_bumen.Text);
  25.             SqlParameter bumen = new SqlParameter("@dept_id", id);
  26.             IList<lbEmploy> list = BLLGeneric.Select<lbEmploy>(CommandType.StoredProcedure, "lb_liandong", bumen);
  27.             //配置数据源
  28.             this.ddl_em.DataSource = list;
  29.             //绑定字段属性
  30.             this.ddl_em.DataTextField = "Em_name";
  31.             this.ddl_em.DataValueField = "Em_name";
  32.             //绑定控件
  33.             this.ddl_em.DataBind();
  34.         }
  35.         else
  36.         {
  37.             this.Response.Write(string.Format(GetRedirect.WINALERT, "请选择部门"));
  38.             this.ddl_bumen.Focus();
  39.             return;
  40.         }
  41.     }
  42.     protected void btnclean_Click(object sender, EventArgs e)
  43.     {
  44.         this.txbnames.Text = "";
  45.     }
  46.     protected void btnadd_Click(object sender, EventArgs e)
  47.     {
  48.         this.txbnames.Text += this.ddl_em.Text + ",";
  49.     }
  50.     protected void btndj_Click(object sender, EventArgs e)
  51.     {
  52.         string str = this.txbnames.Text.Trim();
  53.         string[] snames = str.Split(',');
  54.         foreach (string s in snames)
  55.         {
  56.             if (s == "")
  57.             {
  58.                 break;
  59.             }
  60.             SqlParameter parm = new SqlParameter("@name", s);
  61.             IList<users> user = BLLGeneric.Select<users>(CommandType.StoredProcedure, "lb_employ", parm);
  62.             users u = user[0];
  63.             examine ex = (examine)Session["examines"];
  64.             //接收人的ID
  65.             ex.ex_inceptid = u.u_id;
  66.             examineBLL.Update(ex);
  67.         }
  68.         this.Response.Write(string.Format(GetRedirect.WINALERT, "递交申请成功!"));
  69.         this.Response.Write(string.Format(GetRedirect.REDIRECT,"splist.aspx"));
  70.     }
  71. }