|
|
|
@@ -156,32 +156,38 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
SessionInfoList sil = DataPortal.Fetch<SessionInfoList>(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType));
|
|
|
|
|
if (sil.Count == 0)
|
|
|
|
|
return true;
|
|
|
|
|
if (objectType == CheckOutType.Session)
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (objectType == CheckOutType.Session)
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
// C2015-022 part of separate windows logic, check the processID instead of the sessionID
|
|
|
|
|
foreach (SessionInfo si in sil)
|
|
|
|
|
{
|
|
|
|
|
if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure)
|
|
|
|
|
{
|
|
|
|
|
message = string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(objectID).MyProcedure.DisplayNumber, si.UserID);
|
|
|
|
|
//B2024-074 If no Number for Procedure, Display Title
|
|
|
|
|
ProcedureInfo tmpproc = ItemInfo.Get(objectID).MyProcedure;
|
|
|
|
|
string name = tmpproc.DisplayNumber;
|
|
|
|
|
if (string.IsNullOrEmpty(name))
|
|
|
|
|
{ name = tmpproc.DisplayText; }
|
|
|
|
|
|
|
|
|
|
message = string.Format("The procedure {0} is already checked out to {1}", name, si.UserID);
|
|
|
|
|
rv = rv && false;
|
|
|
|
|
}
|
|
|
|
|
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document)
|
|
|
|
@@ -195,8 +201,16 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
|
|
|
|
if (oi == null)
|
|
|
|
|
message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine;
|
|
|
|
|
else if(oi.OwnerType == 0)
|
|
|
|
|
message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine;
|
|
|
|
|
else if (oi.OwnerType == 0)
|
|
|
|
|
{
|
|
|
|
|
//B2024-074 If no Number for Procedure, Display Title
|
|
|
|
|
ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure;
|
|
|
|
|
string name = tmpproc.DisplayNumber;
|
|
|
|
|
if (string.IsNullOrEmpty(name))
|
|
|
|
|
{ name = tmpproc.DisplayText; }
|
|
|
|
|
|
|
|
|
|
message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine;
|
|
|
|
|
}
|
|
|
|
|
else if (oi.OwnerType == 1)
|
|
|
|
|
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
|
|
|
|
else if (oi.OwnerType == 2)
|
|
|
|
@@ -211,7 +225,15 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
if (oi != null)
|
|
|
|
|
{
|
|
|
|
|
if (oi.OwnerType == 0)
|
|
|
|
|
message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine;
|
|
|
|
|
{
|
|
|
|
|
//B2024-074 If no Number for Procedure, Display Title
|
|
|
|
|
ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure;
|
|
|
|
|
string name = tmpproc.DisplayNumber;
|
|
|
|
|
if (string.IsNullOrEmpty(name))
|
|
|
|
|
{ name = tmpproc.DisplayText; }
|
|
|
|
|
|
|
|
|
|
message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine;
|
|
|
|
|
}
|
|
|
|
|
else if (oi.OwnerType == 1)
|
|
|
|
|
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
|
|
|
|
else if (oi.OwnerType == 2)
|
|
|
|
|