Merge pull request 'Development' (#413) from Development into master

Merging F2023-136 and F2024-074 in master after successful testing
This commit is contained in:
Devin Jankowski 2024-09-27 14:27:22 -04:00
commit 461329468c
5 changed files with 61 additions and 23 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -11,6 +11,7 @@ using Volian.Controls.Library;
using DevComponents.DotNetBar; using DevComponents.DotNetBar;
using JR.Utils.GUI.Forms; using JR.Utils.GUI.Forms;
using Volian.Controls.Library; using Volian.Controls.Library;
using System.Linq;
namespace VEPROMS namespace VEPROMS
{ {
@ -1799,6 +1800,21 @@ namespace VEPROMS
} }
} }
//B2024-074 If only deleting annotations from an individual procedure, verify can check out procedure.
string msgpi = string.Empty;
foreach (ProcedureInfo pi in pil)
{
//LINQ used for 1st check of if statement
//basically check if procedure was already part of a docVersionsFolder
//before checking if procedure was checked out already
//to avoid duplicate messages for checked out procedures
if (!dvil.Any(x => x.Procedures.Any(y => y.ItemID == pi.ItemID)) && !MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgpi))
{
sbDocVersions.AppendLine(msgpi);
cancelledOut = true;
}
}
if (cancelledOut) if (cancelledOut)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();

View File

@ -181,7 +181,13 @@ namespace VEPROMS.CSLA.Library
{ {
if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure) 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; rv = rv && false;
} }
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document) else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document)
@ -195,8 +201,16 @@ namespace VEPROMS.CSLA.Library
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID); OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
if (oi == null) if (oi == null)
message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine; message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine;
else if(oi.OwnerType == 0) 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; {
//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) 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; 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) else if (oi.OwnerType == 2)
@ -211,7 +225,15 @@ namespace VEPROMS.CSLA.Library
if (oi != null) if (oi != null)
{ {
if (oi.OwnerType == 0) 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) 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; 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) else if (oi.OwnerType == 2)