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

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 System.Collections.Generic;
  13. using COM.OA.BLL;
  14. public partial class qs_Default : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         
  19.     }
  20.     protected void btChongZhi_Click(object sender, EventArgs e)
  21.     {
  22.        
  23.         this.txtZhiWu.Text = "";
  24.         this.txtShouji.Text = "";
  25.         this.txtXiaolingtong.Text = "";
  26.         this.txtBangong.Text = "";
  27.         this.txtFenji.Text = "";
  28.         this.txtEmail.Text = "";
  29.         this.txtQQ.Text = "";
  30.         this.txtChuanZhen.Text = "";
  31.         this.txtMsn.Text = "";
  32.         this.txtAdd.Text = "";
  33.         this.txtBeiZhu.Text = "";
  34.     }
  35.     protected void btTiJiao_Click(object sender, EventArgs e)
  36.     {
  37.         if (Page.IsValid) 
  38.         {
  39.             //取姓名ID
  40.             int uid =Int32.Parse( this.ddlUname.Text);
  41.          
  42.             users us = usersBLL.Select(uid);
  43.             int bumenid = us.u_dept_id;
  44.             //取部门ID
  45.             int bid =Int32.Parse( this.ddlBumen.Text);
  46.            
  47.             
  48.             if (!bumenid.Equals(bid))
  49.             {
  50.           this.Response.Write(string.Format(GetRedirect.WINALERT, "此人不是本部门人员请重新选择"));
  51.           this.Response.Write(string.Format(GetRedirect.REDIRECT, "tijiaobangongtongxunlu.aspx"));    
  52.             }
  53.             else { 
  54.         string zhiwu = this.txtZhiWu.Text;
  55.         string shouji = this.txtShouji.Text;
  56.         string xiaolingtong = this.txtXiaolingtong.Text;
  57.         string bangong = this.txtBangong.Text;
  58.         string fenji = this.txtFenji.Text;
  59.         string email = this.txtEmail.Text;
  60.         string qq = this.txtQQ.Text;
  61.         string chuanzhen = this.txtChuanZhen.Text;
  62.         string msn = this.txtMsn.Text;
  63.         string add = this.txtAdd.Text;
  64.         //取备注
  65.         string beizhu = this.txtBeiZhu.Text;
  66.         
  67.         //string where = "dept_department='{0}'";
  68.         //where = string.Format(where, bumen);
  69.         //IList<department> listbumen = departmentBLL.Select(where);
  70.         //department dt = listbumen[0];
  71.         //int bumenId = dt.dept_id;
  72.        
  73.         //string where1 = "u_username='{0}'";
  74.         //where1 = string.Format(where1, uname);
  75.         //IList<users> listuname = usersBLL.Select(where1);
  76.         //users user = listuname[0];
  77.         //int userId = user.u_id;
  78.         //封装
  79.         addresslist al = new addresslist();
  80.         al.al_u_id = uid;
  81.         al.al_dept_id = bid;
  82.         al.al_duty = zhiwu;
  83.         al.al_mobile = shouji;
  84.         al.al_smallclever = xiaolingtong;
  85.         al.al_worktelephone = bangong;
  86.         al.al_extension = fenji;
  87.         al.al_fax = chuanzhen;
  88.         al.al_email = email;
  89.         al.al_qq = qq;
  90.         al.al_msn = msn;
  91.         al.al_address = add;
  92.         //调用方法
  93.         addresslistBLL.Insert(al);
  94.         //跳到查询页
  95.             this.Response.Write(string.Format(GetRedirect.WINALERT, "插入成功"));
  96.             this.Response.Write(string.Format(GetRedirect.REDIRECT, "danweitxl.aspx"));
  97.         }
  98.         }
  99.        
  100.         
  101.     }
  102.    
  103. }