C2016-022: Added purge of multiple RO/Associations and unused RoFsts and Figures
C2016-022: Additional admin tools queries for multiple RO/Associations & unused RoFsts and Figures
This commit is contained in:
@@ -155,6 +155,259 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#region MultipleROAssociations
|
||||
public class ESP_GetROAssoc : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
private string _StoredProcedure;
|
||||
public string StoredProcedure
|
||||
{
|
||||
get { return _StoredProcedure; }
|
||||
set { _StoredProcedure = value; }
|
||||
}
|
||||
private int _RowCount;
|
||||
public int RowCount
|
||||
{
|
||||
get { return _RowCount; }
|
||||
set { _RowCount = value; }
|
||||
}
|
||||
public static int Execute(string storedProcedure)
|
||||
{
|
||||
ESP_GetROAssoc cmd = new ESP_GetROAssoc();
|
||||
cmd.StoredProcedure = storedProcedure;
|
||||
DataPortal.Execute<ESP_GetROAssoc>(cmd);
|
||||
return cmd.RowCount;
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand(StoredProcedure, cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
SqlDataReader dr = cmd.ExecuteReader();
|
||||
while (dr.Read())
|
||||
{
|
||||
RowCount = dr.GetInt32(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ExecuteStoredProcedureRowCount Error", ex);
|
||||
throw new ApplicationException("Failure on ExecuteStoredProcedureRowCount", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class ESP_CleanupROAssoc : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
private string _StoredProcedure;
|
||||
public string StoredProcedure
|
||||
{
|
||||
get { return _StoredProcedure; }
|
||||
set { _StoredProcedure = value; }
|
||||
}
|
||||
private int _RowCount;
|
||||
public int RowCount
|
||||
{
|
||||
get { return _RowCount; }
|
||||
set { _RowCount = value; }
|
||||
}
|
||||
public static int Execute(string storedProcedure)
|
||||
{
|
||||
ESP_CleanupROAssoc cmd = new ESP_CleanupROAssoc();
|
||||
cmd.StoredProcedure = storedProcedure;
|
||||
DataPortal.Execute<ESP_CleanupROAssoc>(cmd);
|
||||
return cmd.RowCount;
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand(StoredProcedure, cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
SqlDataReader dr = cmd.ExecuteReader();
|
||||
RowCount = dr.RecordsAffected;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ExecuteStoredProcedureRowCount Error", ex);
|
||||
throw new ApplicationException("Failure on ExecuteStoredProcedureRowCount", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
#region UnsedRoFstsAndFigures
|
||||
public class ESP_GetUnusedRoFsts : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
private string _StoredProcedure;
|
||||
public string StoredProcedure
|
||||
{
|
||||
get { return _StoredProcedure; }
|
||||
set { _StoredProcedure = value; }
|
||||
}
|
||||
private int _RowCount;
|
||||
public int RowCount
|
||||
{
|
||||
get { return _RowCount; }
|
||||
set { _RowCount = value; }
|
||||
}
|
||||
public static int Execute(string storedProcedure)
|
||||
{
|
||||
ESP_GetUnusedRoFsts cmd = new ESP_GetUnusedRoFsts();
|
||||
cmd.StoredProcedure = storedProcedure;
|
||||
DataPortal.Execute<ESP_GetUnusedRoFsts>(cmd);
|
||||
return cmd.RowCount;
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand(StoredProcedure, cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
SqlDataReader dr = cmd.ExecuteReader();
|
||||
while (dr.Read())
|
||||
{
|
||||
RowCount = dr.GetInt32(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ExecuteStoredProcedureRowCount Error", ex);
|
||||
throw new ApplicationException("Failure on ExecuteStoredProcedureRowCount", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class ESP_GetUnusedFigures : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
private string _StoredProcedure;
|
||||
public string StoredProcedure
|
||||
{
|
||||
get { return _StoredProcedure; }
|
||||
set { _StoredProcedure = value; }
|
||||
}
|
||||
private int _RowCount;
|
||||
public int RowCount
|
||||
{
|
||||
get { return _RowCount; }
|
||||
set { _RowCount = value; }
|
||||
}
|
||||
public static int Execute(string storedProcedure)
|
||||
{
|
||||
ESP_GetUnusedFigures cmd = new ESP_GetUnusedFigures();
|
||||
cmd.StoredProcedure = storedProcedure;
|
||||
DataPortal.Execute<ESP_GetUnusedFigures>(cmd);
|
||||
return cmd.RowCount;
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand(StoredProcedure, cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
SqlDataReader dr = cmd.ExecuteReader();
|
||||
while (dr.Read())
|
||||
{
|
||||
RowCount = dr.GetInt32(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ExecuteStoredProcedureRowCount Error", ex);
|
||||
throw new ApplicationException("Failure on ExecuteStoredProcedureRowCount", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class ESP_PurgeUnusedRoFstsAndFigures : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
private string _StoredProcedure;
|
||||
public string StoredProcedure
|
||||
{
|
||||
get { return _StoredProcedure; }
|
||||
set { _StoredProcedure = value; }
|
||||
}
|
||||
private int _RowCount;
|
||||
public int RowCount
|
||||
{
|
||||
get { return _RowCount; }
|
||||
set { _RowCount = value; }
|
||||
}
|
||||
public static int Execute(string storedProcedure)
|
||||
{
|
||||
ESP_PurgeUnusedRoFstsAndFigures cmd = new ESP_PurgeUnusedRoFstsAndFigures();
|
||||
cmd.StoredProcedure = storedProcedure;
|
||||
DataPortal.Execute<ESP_PurgeUnusedRoFstsAndFigures>(cmd);
|
||||
return cmd.RowCount;
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand(StoredProcedure, cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
SqlDataReader dr = cmd.ExecuteReader();
|
||||
RowCount = dr.RecordsAffected;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ExecuteStoredProcedureRowCount Error", ex);
|
||||
throw new ApplicationException("Failure on ExecuteStoredProcedureRowCount", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
public class ESP_IdentifyNonEditableItems : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
Reference in New Issue
Block a user