string ICallbackEventHandler.GetCallbackResult() { if (string.IsNullOrEmpty(argCallback)) { //正常情况下不该进入此处,除非恶意提交 Log.WriteLog(99, "登录时传入了空参数,客户端IP:" + Request.UserHostAddress); return("err:用户名或密码错误!"); } else { string[] pwds = argCallback.Split('`'); DB.BLL.Person bllPerson = new DB.BLL.Person(); DataSet ds = bllPerson.GetList("UserName = '******' and Password = '******'"); if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0) { return("err:旧密码错误!"); } try { int id = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString()); bllPerson.Update(id, "Password", Maticsoft.DBUtility.DESEncrypt.Encrypt(pwds[1])); } catch (System.Exception ex) { Log.WriteLog("修改密码时出错,错误提示为:" + ex.Message); argCallback = "修改密码时出错"; } return(argCallback); } }
private void Bind() { DB.BLL.Person bllPerson = new DB.BLL.Person(); DataSet ds = bllPerson.GetList("view_person", "Status = 1"); if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0) { return; } dtPersons = ds.Tables[0]; this.gvPersonInJob.DataSource = this.dtPersons.DefaultView; this.gvPersonInJob.DataBind(); ds.Clear(); ds = bllPerson.GetList("view_person", "Status = 2"); if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0) { return; } dtPersons = ds.Tables[0]; this.gvPersonLeave.DataSource = this.dtPersons.DefaultView; this.gvPersonLeave.DataBind(); }