Added GetByName method to AnnotationTypeInfo class
Added code to manage checking out a folder to allow for exporting or importing docversions Added new commands TurnChangeManagerOff and TurnChangeManagerOn.
This commit is contained in:
@@ -12,7 +12,7 @@ namespace VEPROMS.CSLA.Library
|
||||
#region Enum stuff
|
||||
public enum CheckOutType : int
|
||||
{
|
||||
Procedure = 0, Document = 1, DocVersion = 2
|
||||
Procedure = 0, Document = 1, DocVersion = 2, Folder = 3
|
||||
}
|
||||
#endregion
|
||||
#region SessionInfoList stuff
|
||||
@@ -105,6 +105,25 @@ namespace VEPROMS.CSLA.Library
|
||||
SessionInfoList sil = DataPortal.Fetch<SessionInfoList>(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType));
|
||||
if (sil.Count == 0)
|
||||
return true;
|
||||
if (objectType == CheckOutType.Folder)
|
||||
{
|
||||
if (sil.Count == 1)
|
||||
{
|
||||
OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID);
|
||||
if (oil.Count == 0)
|
||||
return true;
|
||||
else
|
||||
{
|
||||
message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool rv = true;
|
||||
foreach (SessionInfo si in sil)
|
||||
{
|
||||
@@ -256,7 +275,73 @@ namespace VEPROMS.CSLA.Library
|
||||
// }
|
||||
//}
|
||||
}
|
||||
public class ResetSecurity : CommandBase
|
||||
public class TurnChangeManagerOff : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
public static void Execute()
|
||||
{
|
||||
TurnChangeManagerOff cmd = new TurnChangeManagerOff();
|
||||
DataPortal.Execute<TurnChangeManagerOff>(cmd);
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand("vesp_TurnChangeManagerOFF", cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("TurnChangeManagerOff Error", ex);
|
||||
throw new ApplicationException("Failure on TurnChangeManagerOff", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class TurnChangeManagerOn : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
public static void Execute()
|
||||
{
|
||||
TurnChangeManagerOn cmd = new TurnChangeManagerOn();
|
||||
DataPortal.Execute<TurnChangeManagerOn>(cmd);
|
||||
}
|
||||
#endregion
|
||||
#region Server-Side code
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand("vesp_TurnChangeManagerON", cn))
|
||||
{
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
cmd.CommandTimeout = 0;
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("TurnChangeManagerOn Error", ex);
|
||||
throw new ApplicationException("Failure on TurnChangeManagerOn", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class ResetSecurity : CommandBase
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Factory Methods
|
||||
|
Reference in New Issue
Block a user