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:
Rich
2013-11-25 04:42:53 +00:00
parent d7da2e454d
commit 2d612fcd91
4 changed files with 121 additions and 13 deletions

View File

@@ -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);