Example #1
0
    public void DeleteUser(string strID)
    {
        DBLib dbLib = new DBLib();

        string strSQL = "Delete From Users Where UserID=" + strID;
        int    ret    = dbLib.ExecuteNonQuery(strSQL);

        //strSQL = "Delete From User_Right Where UserID=" + strID;
        //int retRight = dbLib.ExecuteNonQuery(strSQL);
    }
Example #2
0
    /*
     * public void AddRight(DBLib dbLib, string strUserID,  string strRightID)
     * {
     *  string strSQL = "Select * From User_Right where UserID=" + strUserID + " and RightID=" + strRightID;
     *  DataSet dsRight = dbLib.GetDataSet(strSQL);
     *  if (dsRight.Tables[0].Rows.Count > 0) return;
     *
     *  dbLib.ClearParams();
     *  dbLib.AddParams("RightID", strRightID);
     *  dbLib.AddParams("UserID", strUserID);
     *  strSQL = dbLib.MakeInsertSQL("User_Right");
     *  int ret = dbLib.ExecuteNonQuery(strSQL);
     * }
     *
     * public void DelRight(DBLib dbLib, string strUserID,  string strRightID)
     * {
     *  string strSQL = "Delete From User_Right where UserID=" + strUserID + " and RightID=" + strRightID;
     *  int ret = dbLib.ExecuteNonQuery(strSQL);
     * }
     *
     * public DataSet GetUserRightList(DBLib dbLib, string strUserID)
     * {
     *  string strSQL = "Select * From User_Right where UserID=" + strUserID;
     *  return dbLib.GetDataSet(strSQL);
     * }
     */

    public void ModPassword(DBLib dbLib, string strNewPassword)
    {
        string strPsw;

        strPsw = FormsAuthentication.HashPasswordForStoringInConfigFile(strNewPassword, "md5");
        string strSQL = "Update Users(Password) values('" + strPsw + "')";
        int    ret    = dbLib.ExecuteNonQuery(strSQL);

        m_strPsw = strNewPassword;
    }
Example #3
0
    public void ModifyUser(DBLib dbLib, string strID)
    {
        if (strID == "")
        {
            throw new Exception("用户ID不能为空!");
        }

        m_bEdit = true;
        DBLib dbLibParam = SetParams(dbLib);

        string strSQL = dbLibParam.MakeUpdateSQL("Users", "UserID=" + strID);
        int    ret    = dbLibParam.ExecuteNonQuery(strSQL);
    }