-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
541 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
|
||
namespace SiteServer.Utils.Enumerations | ||
{ | ||
public enum EOraclePrivilege | ||
{ | ||
Normal, | ||
SYSDBA, | ||
SYSOPER | ||
} | ||
|
||
public class EOraclePrivilegeUtils | ||
{ | ||
public static string GetValue(EOraclePrivilege type) | ||
{ | ||
if (type == EOraclePrivilege.Normal) | ||
{ | ||
return "Normal"; | ||
} | ||
if (type == EOraclePrivilege.SYSDBA) | ||
{ | ||
return "SYSDBA"; | ||
} | ||
if (type == EOraclePrivilege.SYSOPER) | ||
{ | ||
return "SYSOPER"; | ||
} | ||
throw new Exception(); | ||
} | ||
|
||
public static EOraclePrivilege GetEnumType(string typeStr) | ||
{ | ||
var retval = EOraclePrivilege.Normal; | ||
|
||
if (Equals(EOraclePrivilege.Normal, typeStr)) | ||
{ | ||
retval = EOraclePrivilege.Normal; | ||
} | ||
else if (Equals(EOraclePrivilege.SYSDBA, typeStr)) | ||
{ | ||
retval = EOraclePrivilege.SYSDBA; | ||
} | ||
else if (Equals(EOraclePrivilege.SYSOPER, typeStr)) | ||
{ | ||
retval = EOraclePrivilege.SYSOPER; | ||
} | ||
|
||
return retval; | ||
} | ||
|
||
public static bool Equals(EOraclePrivilege type, string typeStr) | ||
{ | ||
if (string.IsNullOrEmpty(typeStr)) return false; | ||
if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower())) | ||
{ | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
public static bool Equals(string typeStr, EOraclePrivilege type) | ||
{ | ||
return Equals(type, typeStr); | ||
} | ||
} | ||
} |
Oops, something went wrong.