protected void Button_Click1(object sender, EventArgs e) { string managerID = this.Session["ManagerID"].ToString(); ManagerBll managerBll = new ManagerBll(); ManagerEnitity managerEntity = new ManagerEnitity(); managerEntity.ManagerID = managerID; DataTable byID = managerBll.GetByID(managerEntity); if (this.MD5(this.TextBox1.Text.Trim()) != byID.Rows[0]["ManagerPwd"].ToString().Trim()) { this.Page.ClientScript.RegisterStartupScript(base.GetType(), "alert", "<script>alert('旧密码错误')</script>"); this.TextBox1.Text = ""; this.TextBox2.Text = ""; this.TextBox3.Text = ""; return; } managerEntity.ManagerID = managerID; managerEntity.ManagerPwd = this.MD5(this.TextBox3.Text.Trim()); if (managerBll.Update_Pwd(managerEntity)) { this.Page.ClientScript.RegisterStartupScript(base.GetType(), "alert", "<script>alert('密码修改成功')</script>"); } else { this.Page.ClientScript.RegisterStartupScript(base.GetType(), "alert", "<script>alert('密码修改失败')</script>"); } this.TextBox1.Text = ""; this.TextBox2.Text = ""; this.TextBox3.Text = ""; }
private void bind1() { ManagerBll managerBll = new ManagerBll(); string managerID = this.GetManagerID(); ManagerEnitity managerEntity = new ManagerEnitity(); managerEntity.ManagerID = managerID; DataTable byID = managerBll.GetByID(managerEntity); if (byID != null && byID.Rows.Count == 1) { this.lbManager.Text = byID.Rows[0]["ManagerName"].ToString(); } }
protected void Button3_Click(object sender, EventArgs e) { string ManagerID = this.Session["ManagerID"].ToString().Trim(); ManagerBll managerBll = new ManagerBll(); DataTable byID = managerBll.GetByID(new ManagerEnitity { ManagerID = ManagerID }); ProjectPaperBll projectPaperBll = new ProjectPaperBll(); ProjectPaperEntity projectPaperEntity = new ProjectPaperEntity(); projectPaperEntity.PPID = Convert.ToInt32(Label2.Text); projectPaperEntity.ProjectHead = byID.Rows[0]["ManagerName"].ToString().Trim(); projectPaperEntity.DepartmentId = Convert.ToInt32(this.OkDepartment.SelectedValue); projectPaperBll.Update3(projectPaperEntity); base.ClientScript.RegisterStartupScript(base.GetType(), "msg", "<script>alert('项目分配成功');</script>"); }
public void LoadData() { string ManagerID = this.Session["ManagerID"].ToString().Trim(); ManagerBll managerBll = new ManagerBll(); DataTable byID = managerBll.GetByID(new ManagerEnitity { ManagerID = ManagerID }); if (byID != null && byID.Rows.Count == 1) { this.lbID.Text = byID.Rows[0]["ManagerID"].ToString().Trim(); this.txtName.Text = byID.Rows[0]["ManagerName"].ToString().Trim(); this.lbDepartmentName.Text = byID.Rows[0]["DepartmentName"].ToString().Trim(); this.lbDepartmentID.Text = byID.Rows[0]["DepartmentID"].ToString().Trim(); this.lbPowerName.Text = byID.Rows[0]["PowerName"].ToString().Trim(); this.lbPowerID.Text = byID.Rows[0]["PowerID"].ToString().Trim(); this.upImage.ImageUrl = "~/" + byID.Rows[0]["ManagerImage"].ToString().Trim(); this.txtDes.Text = byID.Rows[0]["ManagerDes"].ToString().Trim(); this.lbImage.Text = byID.Rows[0]["ManagerImage"].ToString().Trim(); } }
protected void LinkButton1_Command(object sender, CommandEventArgs e) { ManagerBll managerBll = new ManagerBll(); DataTable byID = managerBll.GetByID(new ManagerEnitity { ManagerID = e.CommandArgument.ToString().Trim() }); if (byID != null && byID.Rows.Count == 1) { this.upID.Text = byID.Rows[0]["ManagerID"].ToString().Trim(); this.upName.Text = byID.Rows[0]["ManagerName"].ToString().Trim(); this.upDepartment.SelectedValue = byID.Rows[0]["DepartmentID"].ToString().Trim(); this.upPower.SelectedValue = byID.Rows[0]["PowerID"].ToString().Trim(); // this.upImage.ImageUrl = "~/ManagerImage/" + byID.Rows[0]["ManagerImage"].ToString().Trim(); this.upDes.Text = byID.Rows[0]["ManagerDes"].ToString().Trim(); // this.lbImage.Text = byID.Rows[0]["ManagerImage"].ToString().Trim(); } this.btUp.CommandArgument = e.CommandArgument.ToString().Trim(); this.add.Visible = false; this.edit.Visible = true; this.ChangePwd.Visible = false; }