private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { UDS.Components.CM cm = new UDS.Components.CM(); int clientid = Int32.Parse((Request.QueryString["ClientID"] == null) || (Request.QueryString["ClientID"] == "")?"0":Request.QueryString["ClientID"].ToString()); UDS.Components.ClientInfo client = cm.GetClientAllInfo(clientid); ltl_ClientName.Text = client.ClientName; ltl_ClientShortName.Text = client.ClientShortName; ltl_UpdateTime.Text = client.UpdateTime.ToShortDateString(); ltl_Birthday.Text = client.Birthday.ToShortDateString(); ltl_ContactTimes.Text = client.ContactTimes.ToString(); ltl_SellPhase.Text = client.SellPhase; ltl_BargainPrognosis.Text = client.BargainPrognosis; ltl_Fee.Text = client.Fee.ToString(); //显示销售人员 UDS.Components.Staff staff = new UDS.Components.Staff(); SqlDataReader dr_staff = staff.GetStaffInfo(client.AddManID); while (dr_staff.Read()) { ltl_AddMan.Text = dr_staff["realname"].ToString(); } dr_staff.Close(); dr_staff = null; ControlClientContactHistory1.MyClientID = clientid; ControlClientContactHistory1.BindData(); } }
private void Page_Load(object sender, System.EventArgs e) { if(!Page.IsPostBack) { UDS.Components.CM cm = new UDS.Components.CM(); int clientid = Int32.Parse((Request.QueryString["ClientID"]==null)||(Request.QueryString["ClientID"]=="")?"0":Request.QueryString["ClientID"].ToString()); UDS.Components.ClientInfo client = cm.GetClientAllInfo(clientid); ltl_ClientName.Text = client.ClientName; ltl_ClientShortName.Text = client.ClientShortName; ltl_UpdateTime.Text = client.UpdateTime.ToShortDateString(); ltl_Birthday.Text = client.Birthday.ToShortDateString(); ltl_ContactTimes.Text = client.ContactTimes.ToString(); ltl_SellPhase.Text = client.SellPhase; ltl_BargainPrognosis.Text = client.BargainPrognosis; ltl_Fee.Text = client.Fee.ToString(); //��ʾ������Ա UDS.Components.Staff staff = new UDS.Components.Staff(); SqlDataReader dr_staff = staff.GetStaffInfo(client.AddManID); while(dr_staff.Read()) { ltl_AddMan.Text = dr_staff["realname"].ToString(); } dr_staff.Close(); dr_staff=null; ControlClientContactHistory1.MyClientID = clientid; ControlClientContactHistory1.BindData(); } }
private void Page_Load(object sender, System.EventArgs e) { // �ڴ˴������û������Գ�ʼ��ҳ�� int staffid = 0; UDS.Components.Staff staff = new UDS.Components.Staff(); staffid = ((Request.QueryString["Staff_ID"]==null)||(Request.QueryString["Staff_ID"]==""))?0:Int32.Parse(Request.QueryString["Staff_ID"]); SqlDataReader dr_staff = staff.GetStaffInfo(staffid); try { while (dr_staff.Read()) { ltl_Name.Text = dr_staff["RealName"].ToString(); ltl_Gender.Text = dr_staff["SexName"].ToString(); ltl_Mobile.Text = dr_staff["Mobile"].ToString(); ltl_Email.Text = dr_staff["Email"].ToString(); ltl_UnitTelephone.Text = dr_staff["Phone"].ToString(); ltl_Birthday.Text = dr_staff["Birthday"].ToString(); ltl_Position.Text = dr_staff["Position_Name"].ToString(); ltl_RD.Text = dr_staff["RQ"].ToString(); } } finally { dr_staff.Close(); } }
protected void PopulateData() { UDS.Components.Staff staff = new UDS.Components.Staff(); SqlDataReader dataReader = null; try { dataReader = staff.GetStaffInfo(Int32.Parse(StaffID)); } catch { Server.Transfer("../Error.aspx"); } try { if (dataReader.Read()) { this.lblRealName.Text = dataReader["RealName"].ToString(); this.lblStaff_Name.Text = dataReader["Staff_Name"].ToString(); this.lblEmail.Text = dataReader["Email"].ToString(); this.lblRegistedDate.Text = dataReader["RegistedDate"].ToString(); this.lblSex.Text = dataReader["Sex"].ToString() == "True" ? "��" : "Ů"; } } finally { dataReader.Close(); } }
private void BindSubordinate() { //绑定下级人员 UDS.Components.Staff staff = new UDS.Components.Staff(); SqlDataReader dr_mysubordinate = staff.GetStaffFromPosition(Request.Cookies["Username"].Value, 2, 2); ddl_MySubordinate.DataSource = dr_mysubordinate; ddl_MySubordinate.DataTextField = "realname"; ddl_MySubordinate.DataValueField = "staff_id"; ddl_MySubordinate.DataBind(); dr_mysubordinate.Close(); // 加入自己 SqlDataReader dr_me = staff.GetStaffInfo(long.Parse(Request.Cookies["UserID"].Value)); string myrealname = ""; while (dr_me.Read()) { myrealname = dr_me["realname"].ToString(); } dr_me.Close(); ListItem listitem = new ListItem(); listitem.Text = myrealname; listitem.Value = Request.Cookies["UserID"].Value; ddl_MySubordinate.Items.Add(listitem); if (ddl_MySubordinate.Items.Count != 0) { foreach (ListItem li in ddl_MySubordinate.Items) { if (li.Value == userid) { li.Selected = true; } else { li.Selected = false; } } } else { ddl_MySubordinate.Visible = false; } }
private void GetStaffInfo(long StaffID) { SqlDataReader dr; UDS.Components.Staff person = new UDS.Components.Staff(); dr = person.GetStaffInfo(StaffID); txtPassword.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; txtRePassword.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; if (dr.Read()) { txtStaffName.Text = dr["Staff_Name"].ToString(); txtStaffName.ReadOnly = true; txtRealName.Text = dr["RealName"].ToString(); if (dr["Sex"].ToString() == "True") { rb_male.Checked = true; sex = 1; } else { rb_female.Checked = true; sex = 0; } txtBirthday.Text = dr["Birthday"].ToString().IndexOf(" ") > 0?dr["Birthday"].ToString().Substring(0, dr["Birthday"].ToString().IndexOf(" ")):dr["Birthday"].ToString(); if (txtBirthday.Text == "") { txtBirthday.Text = DateTime.Now.ToShortDateString(); } txtPassword.Text = dr["Password"].ToString(); txtRePassword.Text = dr["Password"].ToString(); txtEmail.Text = dr["Email"].ToString(); txtPhone.Text = dr["Phone"].ToString(); txtMobile.Text = dr["Mobile"].ToString(); SelectDepartment(Int32.Parse(dr["Department_ID"].ToString())); } person = null; dr.Close(); dr = null; }
private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 int staffid = 0; UDS.Components.Staff staff = new UDS.Components.Staff(); staffid = ((Request.QueryString["Staff_ID"] == null) || (Request.QueryString["Staff_ID"] == ""))?0:Int32.Parse(Request.QueryString["Staff_ID"]); SqlDataReader dr_staff = staff.GetStaffInfo(staffid); while (dr_staff.Read()) { ltl_Name.Text = dr_staff["RealName"].ToString(); ltl_Gender.Text = dr_staff["SexName"].ToString(); ltl_Mobile.Text = dr_staff["Mobile"].ToString(); ltl_Email.Text = dr_staff["Email"].ToString(); ltl_UnitTelephone.Text = dr_staff["Phone"].ToString(); ltl_Birthday.Text = dr_staff["Birthday"].ToString(); ltl_Position.Text = dr_staff["Position_Name"].ToString(); ltl_RD.Text = dr_staff["RQ"].ToString(); } dr_staff.Close(); }
private void ddl_MySubordinate_SelectedIndexChanged(object sender, System.EventArgs e) { if (((DropDownList)sender).SelectedItem.Value == Request.Cookies["UserID"].Value) { Session["cm_permission"] = "administrator"; pnl.Visible = true; pnl_ClientInfo.Visible = true; } else { Session["cm_permission"] = "leader"; pnl.Visible = false; pnl_ClientInfo.Visible = false; } //改变观察视角 UDS.Components.Staff staff = new UDS.Components.Staff(); userid = ddl_MySubordinate.SelectedItem.Value; SqlDataReader dr = staff.GetStaffInfo(long.Parse(userid)); while (dr.Read()) { username = dr["staff_name"].ToString(); } dr.Close(); ViewState["userid"] = userid; ViewState["username"] = username; //重新绑定 if (ViewState["NowTab"].ToString() == "client") { BindGrid(); } else { BindMycooperatorClient(); } }
protected void PopulateData() { UDS.Components.Staff staff = new UDS.Components.Staff(); SqlDataReader dataReader = null; try { dataReader = staff.GetStaffInfo(Int32.Parse(StaffID)); } catch { Server.Transfer("../Error.aspx"); } if (dataReader.Read()) { this.lblRealName.Text = dataReader["RealName"].ToString(); this.lblStaff_Name.Text = dataReader["Staff_Name"].ToString(); this.lblEmail.Text = dataReader["Email"].ToString(); this.lblRegistedDate.Text = dataReader["RegistedDate"].ToString(); this.lblSex.Text = dataReader["Sex"].ToString() == "True"?"男":"女"; } dataReader.Close(); }
public void ddl_MySubordinate_SelectedIndexChanged(object sender, System.EventArgs e) { if(((DropDownList)sender).SelectedItem.Value==Request.Cookies["UserID"].Value) { Session["cm_permission"] = "administrator"; pnl.Visible = true; pnl_ClientInfo.Visible = true; } else { Session["cm_permission"] = "leader"; pnl.Visible = false; pnl_ClientInfo.Visible = false; } //�ı�۲��ӽ� UDS.Components.Staff staff = new UDS.Components.Staff(); userid = ddl_MySubordinate.SelectedItem.Value; SqlDataReader dr = staff.GetStaffInfo(long.Parse(userid)); try { while (dr.Read()) { username = dr["staff_name"].ToString(); } } finally { if (dr != null) { dr.Close(); } } ViewState["userid"] = userid; ViewState["username"] = username; //���°� if(ViewState["NowTab"].ToString()=="client") BindGrid(); else BindMycooperatorClient(); }
private void BindSubordinate() { //���¼���Ա UDS.Components.Staff staff = new UDS.Components.Staff(); SqlDataReader dr_mysubordinate = staff.GetStaffFromPosition(Server.UrlDecode(Request.Cookies["UserName"].Value), 2, 2); try { ddl_MySubordinate.DataSource = dr_mysubordinate; ddl_MySubordinate.DataTextField = "realname"; ddl_MySubordinate.DataValueField = "staff_id"; ddl_MySubordinate.DataBind(); } finally { dr_mysubordinate.Close(); } // �����Լ� SqlDataReader dr_me = staff.GetStaffInfo(long.Parse(Request.Cookies["UserID"].Value)); string myrealname = ""; try { while (dr_me.Read()) { myrealname = dr_me["realname"].ToString(); } } finally { dr_me.Close(); } ListItem listitem = new ListItem(); listitem.Text = myrealname; listitem.Value = Request.Cookies["UserID"].Value; ddl_MySubordinate.Items.Add(listitem); if(ddl_MySubordinate.Items.Count!=0) { foreach(ListItem li in ddl_MySubordinate.Items) { if(li.Value==userid) li.Selected = true; else li.Selected = false; } } else { ddl_MySubordinate.Visible = false; } }
private void GetStaffInfo(long StaffID) { SqlDataReader dr; UDS.Components.Staff person = new UDS.Components.Staff(); dr = person.GetStaffInfo(StaffID); txtPassword.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; txtRePassword.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; if(dr.Read ()) { txtStaffName.Text = dr["Staff_Name"].ToString(); txtStaffName.ReadOnly =true; txtRealName.Text = dr["RealName"].ToString(); if(dr["Sex"].ToString() =="True") { rb_male.Checked =true; sex =1; } else { rb_female.Checked =true; sex = 0; } txtBirthday.Text = dr["Birthday"].ToString().IndexOf(" ")>0?dr["Birthday"].ToString().Substring(0,dr["Birthday"].ToString().IndexOf(" ")):dr["Birthday"].ToString() ; if( txtBirthday.Text =="") txtBirthday.Text = DateTime.Now.ToShortDateString(); txtPassword.Text = dr["Password"].ToString(); txtRePassword.Text = dr["Password"].ToString(); txtEmail.Text = dr["Email"].ToString(); txtPhone.Text =dr["Phone"].ToString(); txtMobile.Text = dr["Mobile"].ToString(); SelectDepartment(Int32.Parse(dr["Department_ID"].ToString())); } person = null; dr.Close(); dr =null; }