Corrected errors in code that cause application to crash during initial testing.
Added code to allow for resetting security for a database. Added class to Reset Security.
This commit is contained in:
@@ -256,6 +256,39 @@ namespace VEPROMS.CSLA.Library
|
||||
// }
|
||||
//}
|
||||
}
|
||||
public class ResetSecurity : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
public static void Execute()
|
||||
{
|
||||
ResetSecurity cmd = new ResetSecurity();
|
||||
DataPortal.Execute<ResetSecurity>(cmd);
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand("vesp_ResetSecurity", cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Reset Security Error", ex);
|
||||
throw new ApplicationException("Failure on Reset Security", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class SessionPing : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
Reference in New Issue
Block a user