public virtual int MyUpdate(string OID, string LOG_NAME, string PAS_WORD, string ROL_NAME, string YG_OID) { if (OID == null) { throw new global::System.ArgumentNullException("OID"); } else { MyUpdateSqlComand.Parameters[0].Value = OID; } if (LOG_NAME == null) { throw new global::System.ArgumentNullException("LOG_NAME"); } else { MyUpdateSqlComand.Parameters[1].Value = LOG_NAME; } if (PAS_WORD == null) { throw new global::System.ArgumentNullException("PAS_WORD"); } else if (PAS_WORD == "PAS_WORD_TONY") { MyUpdateSqlComand.Parameters[2].Value = PAS_WORD; } else { //--对密码进行加密存储 MyUpdateSqlComand.Parameters[2].Value = AdapterHelper.Hash(PAS_WORD); } if (ROL_NAME == null) { throw new global::System.ArgumentNullException("ROL_NAME"); } else { MyUpdateSqlComand.Parameters[3].Value = ROL_NAME; } if (YG_OID == null) { throw new global::System.ArgumentNullException("YG_OID"); } else { MyUpdateSqlComand.Parameters[4].Value = YG_OID; } return(AdapterHelper.ExecuteCommand(MyUpdateSqlComand)); }
void callbackChangePassword_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { string oldPassWord = e.Parameter.Split('-')[0]; string newPassWord = e.Parameter.Split('-')[1]; if (AdapterHelper.Hash(oldPassWord) != AuthenUser.GetCurrentUser().PassWord) { e.Result = "您输入的旧密码不正确!"; } else { try { AuthenUser.ChangePassword(newPassWord); e.Result = "修改密码成功!"; } catch (Exception ex) { e.Result = "修改密码失败:" + ex.Message; } } }
public virtual int MyInsert(string LOG_NAME, string PAS_WORD, string ROL_NAME, string YG_OID) { string passWord = AdapterHelper.Hash(PAS_WORD); return(Insert(Guid.NewGuid().ToString(), LOG_NAME, passWord, ROL_NAME, DateTime.Now, YG_OID)); }