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

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 qs_Default : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         //取查询页面的姓名
  19.         string uname = this.Request.QueryString["u_username"];
  20.         string where = "u_username='{0}'";
  21.         //根据姓名查部门ID
  22.         where = string.Format(where, uname);
  23.         IList<users> list =  usersBLL.Select(where);
  24.         users u = list[0];
  25.         int bumenId = u.u_dept_id;
  26.         //根据部门ID查部门名
  27.         string where1 = "dept_id='{0}'";
  28.         where1 = string.Format(where1, bumenId);
  29.         IList<department> lists = departmentBLL.Select(where1);
  30.         department dt = lists[0];
  31.         string bumen = dt.dept_department;
  32.         int uid = u.u_id;
  33.         string where2 = "al_u_id='{0}'";
  34.         where2 = string.Format(where2, uid);
  35.         IList<addresslist> listad = addresslistBLL.Select(where2);
  36.         addresslist dl = listad[0];
  37.       
  38.         
  39.         this.txtUname.Text = uname;
  40.         this.txtBumen.Text = bumen;
  41.         this.txtZhiWu.Text = dl.al_duty;
  42.         this.txtShouji.Text = dl.al_mobile;
  43.         this.txtXiaolingtong.Text = dl.al_smallclever;
  44.         this.txtBangong.Text = dl.al_worktelephone;
  45.         this.txtFenji.Text = dl.al_extension;
  46.         this.txtChuanZhen.Text = dl.al_fax;
  47.         this.txtEmail.Text = dl.al_email;
  48.         this.txtBeiZhu.Text = dl.al_remark;
  49.         this.txtAdd.Text = dl.al_address;
  50.         this.txtMsn.Text = dl.al_msn;
  51.         this.txtQQ.Text = dl.al_qq;
  52.         
  53.         
  54.     }
  55.     protected void btChongZhi_Click(object sender, EventArgs e)
  56.     {
  57.         
  58.         this.txtZhiWu.Text = "";
  59.         this.txtShouji.Text = "";
  60.         this.txtXiaolingtong.Text = "";
  61.         this.txtBangong.Text = "";
  62.         this.txtFenji.Text = "";
  63.         this.txtEmail.Text = "";
  64.         this.txtQQ.Text = "";
  65.         this.txtChuanZhen.Text = "";
  66.         this.txtMsn.Text = "";
  67.         this.txtAdd.Text = "";
  68.         this.txtBeiZhu.Text = "";
  69.     }
  70.     protected void btXiuGai_Click(object sender, EventArgs e)
  71.     {
  72.         //取文本数值
  73.         string uname=this.txtUname.Text;
  74.         string bumen=this.txtBumen.Text ;
  75.         string zhiwu = this.txtZhiWu.Text;
  76.         string shouji = this.txtShouji.Text;
  77.         string xiaolingtong = this.txtXiaolingtong.Text;
  78.         string bangong = this.txtBangong.Text;
  79.         string fenji = this.txtFenji.Text;
  80.         string email = this.txtEmail.Text;
  81.         string qq = this.txtQQ.Text;
  82.         string chuanzhen = this.txtChuanZhen.Text;
  83.         string msn = this.txtMsn.Text;
  84.         string add = this.txtAdd.Text;
  85.         //取备注
  86.         string beizhu = this.txtBeiZhu.Text;
  87.         string where = "u_username='{0}'";
  88.         //根据姓名查ID
  89.         where = string.Format(where, uname);
  90.         IList<users> list = usersBLL.Select(where);
  91.         users u = list[0];
  92.         int uid = u.u_id;
  93.         //取部门ID
  94.         string where1 = "dept_department='{0}'";
  95.         where1 = string.Format(where1, bumen);
  96.         IList<department> listbumen = departmentBLL.Select(where1);
  97.         department dt = listbumen[0];
  98.         int bumenId = dt.dept_id;
  99.         //根据姓名ID查出这条数据
  100.         
  101.         string where2 = "al_u_id='{0}'";
  102.         where2 = string.Format(where2, uid);
  103.         IList<addresslist> listtongxunlu = addresslistBLL.Select(where2);
  104.         
  105.        
  106.         //接受查询信息重新副职
  107.          addresslist al = listtongxunlu[0];
  108.         al.al_u_id=uid;
  109.         al.al_dept_id = bumenId;
  110.         al.al_duty = zhiwu;
  111.         al.al_mobile = shouji;
  112.         al.al_smallclever = xiaolingtong;
  113.         al.al_worktelephone = bangong;
  114.         al.al_extension = fenji;
  115.         al.al_fax = chuanzhen;
  116.         al.al_email = email;
  117.         al.al_qq = qq;
  118.         al.al_msn = msn;
  119.         al.al_address = add;
  120.         
  121.         //修改通讯录表
  122.         addresslistBLL.Update(al);
  123.         //if ()
  124.         //{ //跳到查询页
  125.             this.Response.Redirect("danweitxl.aspx");
  126.         //}
  127.         //else { this.Response.Write(string.Format(GetRedirect.WINALERT, "修改失败")); }
  128.         
  129.         
  130.     }
  131.    
  132. }