bangongtongxuluxiugai.aspx.cs
来自「OA自动化办公系统,就是OA自动化办公系统」· CS 代码 · 共 141 行
CS
141 行
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using COM.OA.Entity;
using COM.OA.BLL;
using System.Collections.Generic;
public partial class qs_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//取查询页面的姓名
string uname = this.Request.QueryString["u_username"];
string where = "u_username='{0}'";
//根据姓名查部门ID
where = string.Format(where, uname);
IList<users> list = usersBLL.Select(where);
users u = list[0];
int bumenId = u.u_dept_id;
//根据部门ID查部门名
string where1 = "dept_id='{0}'";
where1 = string.Format(where1, bumenId);
IList<department> lists = departmentBLL.Select(where1);
department dt = lists[0];
string bumen = dt.dept_department;
int uid = u.u_id;
string where2 = "al_u_id='{0}'";
where2 = string.Format(where2, uid);
IList<addresslist> listad = addresslistBLL.Select(where2);
addresslist dl = listad[0];
this.txtUname.Text = uname;
this.txtBumen.Text = bumen;
this.txtZhiWu.Text = dl.al_duty;
this.txtShouji.Text = dl.al_mobile;
this.txtXiaolingtong.Text = dl.al_smallclever;
this.txtBangong.Text = dl.al_worktelephone;
this.txtFenji.Text = dl.al_extension;
this.txtChuanZhen.Text = dl.al_fax;
this.txtEmail.Text = dl.al_email;
this.txtBeiZhu.Text = dl.al_remark;
this.txtAdd.Text = dl.al_address;
this.txtMsn.Text = dl.al_msn;
this.txtQQ.Text = dl.al_qq;
}
protected void btChongZhi_Click(object sender, EventArgs e)
{
this.txtZhiWu.Text = "";
this.txtShouji.Text = "";
this.txtXiaolingtong.Text = "";
this.txtBangong.Text = "";
this.txtFenji.Text = "";
this.txtEmail.Text = "";
this.txtQQ.Text = "";
this.txtChuanZhen.Text = "";
this.txtMsn.Text = "";
this.txtAdd.Text = "";
this.txtBeiZhu.Text = "";
}
protected void btXiuGai_Click(object sender, EventArgs e)
{
//取文本数值
string uname=this.txtUname.Text;
string bumen=this.txtBumen.Text ;
string zhiwu = this.txtZhiWu.Text;
string shouji = this.txtShouji.Text;
string xiaolingtong = this.txtXiaolingtong.Text;
string bangong = this.txtBangong.Text;
string fenji = this.txtFenji.Text;
string email = this.txtEmail.Text;
string qq = this.txtQQ.Text;
string chuanzhen = this.txtChuanZhen.Text;
string msn = this.txtMsn.Text;
string add = this.txtAdd.Text;
//取备注
string beizhu = this.txtBeiZhu.Text;
string where = "u_username='{0}'";
//根据姓名查ID
where = string.Format(where, uname);
IList<users> list = usersBLL.Select(where);
users u = list[0];
int uid = u.u_id;
//取部门ID
string where1 = "dept_department='{0}'";
where1 = string.Format(where1, bumen);
IList<department> listbumen = departmentBLL.Select(where1);
department dt = listbumen[0];
int bumenId = dt.dept_id;
//根据姓名ID查出这条数据
string where2 = "al_u_id='{0}'";
where2 = string.Format(where2, uid);
IList<addresslist> listtongxunlu = addresslistBLL.Select(where2);
//接受查询信息重新副职
addresslist al = listtongxunlu[0];
al.al_u_id=uid;
al.al_dept_id = bumenId;
al.al_duty = zhiwu;
al.al_mobile = shouji;
al.al_smallclever = xiaolingtong;
al.al_worktelephone = bangong;
al.al_extension = fenji;
al.al_fax = chuanzhen;
al.al_email = email;
al.al_qq = qq;
al.al_msn = msn;
al.al_address = add;
//修改通讯录表
addresslistBLL.Update(al);
//if ()
//{ //跳到查询页
this.Response.Redirect("danweitxl.aspx");
//}
//else { this.Response.Write(string.Format(GetRedirect.WINALERT, "修改失败")); }
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?