private void BindData() { UserManageBLL bll = null; DataPage dp = new DataPage(); Manage.Entity.Sys.User condition = new Manage.Entity.Sys.User(); try { bll = BLLFactory.CreateBLL <UserManageBLL>(); condition.LoginUserID = this.LoginUserID.Text; condition.UserName = this.UserName.Text; condition.OrganID = this.OrganID.Value; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <Entity.Sys.User> list = dp.Result as List <Entity.Sys.User>; foreach (Entity.Sys.User user in list) { if (string.IsNullOrEmpty(user.OrganID) == false && user.OrganID == "root") { user.OrganDESC = ConfigurationManager.AppSettings["rootOrgan"]; } } this.GvList.DataSource = list; this.GvList.DataBind(); for (int i = 0; i < this.GvList.Rows.Count; i++) { string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["UserID"].ToString()); (this.GvList.Rows[i].Cells[8].Controls[0] as WebControl).Attributes.Add("onclick", click); LinkButton btWHPowers = this.GvList.Rows[i].Cells[9].FindControl("btWHPowers") as LinkButton; btWHPowers.OnClientClick = "setWHPowers('" + this.GvList.DataKeys[i]["UserID"].ToString() + "');return false;"; } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
protected void btSave_Click(object sender, EventArgs e) { Manage.Entity.Sys.User info = new Manage.Entity.Sys.User(); info.PassWord = this.NewPassWord.Text; LoginInfo login = this.GetLoginInfo(); login.PassWord = this.OldPassWord.Text; login = new LoginBLL().IsLogin(login); if (login == null) { ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','原密码输入不正确!');", true); return; } info.UserID = login.UserID; BLLFactory.CreateBLL <UserManageBLL>().SetPassWord(info); ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.closeAppWindow1();", true); }