C2026 043 tech debt v1 #817
@@ -5,7 +5,6 @@ using System.Data;
|
|||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using Csla.Validation;
|
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@@ -13,22 +12,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int AffectedRows { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _AffectedRows;
|
|
||||||
public int AffectedRows
|
|
||||||
{
|
|
||||||
get { return _AffectedRows; }
|
|
||||||
set { _AffectedRows = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_DeletePDFs cmd = new ESP_DeletePDFs();
|
ESP_DeletePDFs cmd = new ESP_DeletePDFs
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_DeletePDFs>(cmd);
|
DataPortal.Execute<ESP_DeletePDFs>(cmd);
|
||||||
return cmd.AffectedRows;
|
return cmd.AffectedRows;
|
||||||
}
|
}
|
||||||
@@ -60,22 +51,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int AffectedRows { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _AffectedRows;
|
|
||||||
public int AffectedRows
|
|
||||||
{
|
|
||||||
get { return _AffectedRows; }
|
|
||||||
set { _AffectedRows = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_DeletePDFs cmd = new ESP_DeletePDFs();
|
ESP_DeletePDFs cmd = new ESP_DeletePDFs
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_DeletePDFs>(cmd);
|
DataPortal.Execute<ESP_DeletePDFs>(cmd);
|
||||||
return cmd.AffectedRows;
|
return cmd.AffectedRows;
|
||||||
}
|
}
|
||||||
@@ -107,22 +90,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int RowCount { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _RowCount;
|
|
||||||
public int RowCount
|
|
||||||
{
|
|
||||||
get { return _RowCount; }
|
|
||||||
set { _RowCount = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_IdentifyDisconnectedItems cmd = new ESP_IdentifyDisconnectedItems();
|
ESP_IdentifyDisconnectedItems cmd = new ESP_IdentifyDisconnectedItems
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_IdentifyDisconnectedItems>(cmd);
|
DataPortal.Execute<ESP_IdentifyDisconnectedItems>(cmd);
|
||||||
return cmd.RowCount;
|
return cmd.RowCount;
|
||||||
}
|
}
|
||||||
@@ -158,22 +133,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int RowCount { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _RowCount;
|
|
||||||
public int RowCount
|
|
||||||
{
|
|
||||||
get { return _RowCount; }
|
|
||||||
set { _RowCount = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_PurgeDisconnectedItems cmd = new ESP_PurgeDisconnectedItems();
|
ESP_PurgeDisconnectedItems cmd = new ESP_PurgeDisconnectedItems
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_PurgeDisconnectedItems>(cmd);
|
DataPortal.Execute<ESP_PurgeDisconnectedItems>(cmd);
|
||||||
return cmd.RowCount;
|
return cmd.RowCount;
|
||||||
}
|
}
|
||||||
@@ -207,22 +174,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int RowCount { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _RowCount;
|
|
||||||
public int RowCount
|
|
||||||
{
|
|
||||||
get { return _RowCount; }
|
|
||||||
set { _RowCount = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_GetROAssoc cmd = new ESP_GetROAssoc();
|
ESP_GetROAssoc cmd = new ESP_GetROAssoc
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_GetROAssoc>(cmd);
|
DataPortal.Execute<ESP_GetROAssoc>(cmd);
|
||||||
return cmd.RowCount;
|
return cmd.RowCount;
|
||||||
}
|
}
|
||||||
@@ -258,22 +217,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int RowCount { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _RowCount;
|
|
||||||
public int RowCount
|
|
||||||
{
|
|
||||||
get { return _RowCount; }
|
|
||||||
set { _RowCount = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_CleanupROAssoc cmd = new ESP_CleanupROAssoc();
|
ESP_CleanupROAssoc cmd = new ESP_CleanupROAssoc
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_CleanupROAssoc>(cmd);
|
DataPortal.Execute<ESP_CleanupROAssoc>(cmd);
|
||||||
return cmd.RowCount;
|
return cmd.RowCount;
|
||||||
}
|
}
|
||||||
@@ -308,22 +259,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int RowCount { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _RowCount;
|
|
||||||
public int RowCount
|
|
||||||
{
|
|
||||||
get { return _RowCount; }
|
|
||||||
set { _RowCount = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_GetUnusedRoFsts cmd = new ESP_GetUnusedRoFsts();
|
ESP_GetUnusedRoFsts cmd = new ESP_GetUnusedRoFsts
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_GetUnusedRoFsts>(cmd);
|
DataPortal.Execute<ESP_GetUnusedRoFsts>(cmd);
|
||||||
return cmd.RowCount;
|
return cmd.RowCount;
|
||||||
}
|
}
|
||||||
@@ -359,22 +302,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int RowCount { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _RowCount;
|
|
||||||
public int RowCount
|
|
||||||
{
|
|
||||||
get { return _RowCount; }
|
|
||||||
set { _RowCount = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_GetUnusedFigures cmd = new ESP_GetUnusedFigures();
|
ESP_GetUnusedFigures cmd = new ESP_GetUnusedFigures
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_GetUnusedFigures>(cmd);
|
DataPortal.Execute<ESP_GetUnusedFigures>(cmd);
|
||||||
return cmd.RowCount;
|
return cmd.RowCount;
|
||||||
}
|
}
|
||||||
@@ -410,22 +345,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public int RowCount { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _RowCount;
|
|
||||||
public int RowCount
|
|
||||||
{
|
|
||||||
get { return _RowCount; }
|
|
||||||
set { _RowCount = value; }
|
|
||||||
}
|
|
||||||
public static int Execute(string storedProcedure)
|
public static int Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_PurgeUnusedRoFstsAndFigures cmd = new ESP_PurgeUnusedRoFstsAndFigures();
|
ESP_PurgeUnusedRoFstsAndFigures cmd = new ESP_PurgeUnusedRoFstsAndFigures
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_PurgeUnusedRoFstsAndFigures>(cmd);
|
DataPortal.Execute<ESP_PurgeUnusedRoFstsAndFigures>(cmd);
|
||||||
return cmd.RowCount;
|
return cmd.RowCount;
|
||||||
}
|
}
|
||||||
@@ -459,22 +386,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public List<ItemInfo> ItemInfoList { get; set; } = new List<ItemInfo>();
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private List<ItemInfo> _ItemInfoList = new List<ItemInfo>();
|
|
||||||
public List<ItemInfo> ItemInfoList
|
|
||||||
{
|
|
||||||
get { return _ItemInfoList; }
|
|
||||||
set { _ItemInfoList = value; }
|
|
||||||
}
|
|
||||||
public static List<ItemInfo> Execute(string storedProcedure)
|
public static List<ItemInfo> Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_IdentifyNonEditableItems cmd = new ESP_IdentifyNonEditableItems();
|
ESP_IdentifyNonEditableItems cmd = new ESP_IdentifyNonEditableItems
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_IdentifyNonEditableItems>(cmd);
|
DataPortal.Execute<ESP_IdentifyNonEditableItems>(cmd);
|
||||||
return cmd.ItemInfoList;
|
return cmd.ItemInfoList;
|
||||||
}
|
}
|
||||||
@@ -509,22 +428,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
private string _StoredProcedure;
|
public string StoredProcedure { get; set; }
|
||||||
public string StoredProcedure
|
public string ResultsString { get; set; }
|
||||||
{
|
|
||||||
get { return _StoredProcedure; }
|
|
||||||
set { _StoredProcedure = value; }
|
|
||||||
}
|
|
||||||
private string _ResultsString;
|
|
||||||
public string ResultsString
|
|
||||||
{
|
|
||||||
get { return _ResultsString; }
|
|
||||||
set { _ResultsString = value; }
|
|
||||||
}
|
|
||||||
public static string Execute(string storedProcedure)
|
public static string Execute(string storedProcedure)
|
||||||
{
|
{
|
||||||
ESP_GetDatabaseSessions cmd = new ESP_GetDatabaseSessions();
|
ESP_GetDatabaseSessions cmd = new ESP_GetDatabaseSessions
|
||||||
cmd.StoredProcedure = storedProcedure;
|
{
|
||||||
|
StoredProcedure = storedProcedure
|
||||||
|
};
|
||||||
DataPortal.Execute<ESP_GetDatabaseSessions>(cmd);
|
DataPortal.Execute<ESP_GetDatabaseSessions>(cmd);
|
||||||
return cmd.ResultsString;
|
return cmd.ResultsString;
|
||||||
}
|
}
|
||||||
@@ -579,7 +490,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ResultsString = sbs.ToString();
|
ResultsString = sbs.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -591,12 +502,4 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
public class ESP_FindROProblems : CommandBase
|
|
||||||
{
|
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
#region Factory Methods
|
|
||||||
#endregion
|
|
||||||
#region Server-Side Code
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
|
|
||||||
@@ -11,10 +9,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public partial class AnnotationInfo
|
public partial class AnnotationInfo
|
||||||
{
|
{
|
||||||
public override string ToString()
|
public override string ToString() => _SearchText;
|
||||||
{
|
|
||||||
return _SearchText;
|
|
||||||
}
|
|
||||||
#region JCB Annotation Status
|
#region JCB Annotation Status
|
||||||
private bool _IsAnnotationNew = false;
|
private bool _IsAnnotationNew = false;
|
||||||
|
|
||||||
@@ -49,10 +44,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public partial class AnnotationType
|
public partial class AnnotationType
|
||||||
{
|
{
|
||||||
public override string ToString()
|
public override string ToString() => _Name;
|
||||||
{
|
|
||||||
return _Name;
|
|
||||||
}
|
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private AnnotationTypeConfig _AnnotationTypeConfig;
|
private AnnotationTypeConfig _AnnotationTypeConfig;
|
||||||
public AnnotationTypeConfig AnnotationTypeConfig
|
public AnnotationTypeConfig AnnotationTypeConfig
|
||||||
@@ -83,15 +75,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _AnnotationTypeConfig;
|
return _AnnotationTypeConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static List<AnnotationTypeInfo> AllList()
|
public static List<AnnotationTypeInfo> AllList() => AnnotationTypeInfo._CacheList;
|
||||||
{
|
public override string ToString() => _Name;
|
||||||
//return _AllList;
|
|
||||||
return AnnotationTypeInfo._CacheList;
|
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return _Name;
|
|
||||||
}
|
|
||||||
public static AnnotationTypeInfo GetByName(string name)
|
public static AnnotationTypeInfo GetByName(string name)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -112,12 +97,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class GetByNameCriteria
|
protected class GetByNameCriteria
|
||||||
{
|
{
|
||||||
private string _Name;
|
private readonly string _Name;
|
||||||
public string Name { get { return _Name; } }
|
public string Name => _Name;
|
||||||
public GetByNameCriteria(string name)
|
public GetByNameCriteria(string name) => _Name = name;
|
||||||
{
|
|
||||||
_Name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(GetByNameCriteria criteria)
|
private void DataPortal_Fetch(GetByNameCriteria criteria)
|
||||||
{
|
{
|
||||||
@@ -177,44 +159,20 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_TypeID = anotypeid;
|
_TypeID = anotypeid;
|
||||||
MarkDirty(); // force the record update
|
MarkDirty(); // force the record update
|
||||||
Save();
|
Save();
|
||||||
//Update(); // commit record to database
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void CommitChanges()
|
public void CommitChanges()
|
||||||
{
|
{
|
||||||
MarkDirty(); // force the record update
|
MarkDirty(); // force the record update
|
||||||
Save(true);
|
Save(true);
|
||||||
//Update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DeleteAnnotation(AnnotationInfo obj)
|
public static void DeleteAnnotation(AnnotationInfo obj)
|
||||||
{
|
{
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// ItemInfo nextItem = item.NextItem;
|
|
||||||
// ItemInfo prevItem = item.MyPrevious;
|
|
||||||
// item.OnBeforeDelete();
|
|
||||||
DataPortal.Delete(new DeleteCriteria(obj.AnnotationID, Volian.Base.Library.VlnSettings.UserID));
|
DataPortal.Delete(new DeleteCriteria(obj.AnnotationID, Volian.Base.Library.VlnSettings.UserID));
|
||||||
AnnotationInfo.StaticOnInfoChanged();
|
AnnotationInfo.StaticOnInfoChanged();
|
||||||
// if (nextItem != null) // Adjust PreviousID for NextItem
|
|
||||||
// {
|
|
||||||
// ItemInfo.RefreshPrevious(nextItem.ItemID, item.PreviousID);
|
|
||||||
// // The order of the next two methods was required to fix a null reference
|
|
||||||
// // when getting myparent. This bug was found when deleting a node from the
|
|
||||||
// // tree when the RTBItem was not open (i.e. in the step editor window).
|
|
||||||
// nextItem.RefreshItemParts();
|
|
||||||
// //nextItem.ResetOrdinal(); - UpdateTransitionText calls ResetOrdinal
|
|
||||||
// nextItem.UpdateTransitionText();
|
|
||||||
// }
|
|
||||||
// else if (prevItem != null)
|
|
||||||
// {
|
|
||||||
// prevItem.RefreshNextItems();
|
|
||||||
// if (prevItem.IsCaution || prevItem.IsNote) prevItem.ResetOrdinal();
|
|
||||||
// prevItem.UpdateTransitionText();
|
|
||||||
// }
|
|
||||||
// ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -228,8 +186,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public static void DeleteAnnotationProcByType(int typID, string procList)
|
public static void DeleteAnnotationProcByType(int typID, string procList)
|
||||||
{
|
{
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DataPortal.Delete(new DeleteAnnotationProcByTypeCriteria(typID, procList));
|
DataPortal.Delete(new DeleteAnnotationProcByTypeCriteria(typID, procList));
|
||||||
@@ -247,8 +203,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public static void DeleteAnnotationDocvByType(int typID, string versionID)
|
public static void DeleteAnnotationDocvByType(int typID, string versionID)
|
||||||
{
|
{
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DataPortal.Delete(new DeleteAnnotationDocvByTypeCriteria(typID, versionID));
|
DataPortal.Delete(new DeleteAnnotationDocvByTypeCriteria(typID, versionID));
|
||||||
@@ -266,8 +220,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public static int getAnnotationProcCnt(int typID, string procList)
|
public static int getAnnotationProcCnt(int typID, string procList)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Annotation ProcCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountProcCriteria(typID, procList));
|
Annotation ProcCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountProcCriteria(typID, procList));
|
||||||
@@ -287,8 +239,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public static int getAnnotationCountDocv(int typID, string procList)
|
public static int getAnnotationCountDocv(int typID, string procList)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Annotation DocvCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountDocvCriteria(typID, procList));
|
Annotation DocvCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountDocvCriteria(typID, procList));
|
||||||
@@ -319,9 +269,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class DeleteCriteria
|
protected class DeleteCriteria
|
||||||
{
|
{
|
||||||
private int _AnnotationID;
|
private readonly int _AnnotationID;
|
||||||
public int AnnotationID
|
public int AnnotationID => _AnnotationID;
|
||||||
{ get { return _AnnotationID; } }
|
|
||||||
private string _UserID;
|
private string _UserID;
|
||||||
public string UserID
|
public string UserID
|
||||||
{
|
{
|
||||||
@@ -364,13 +313,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class DeleteAnnotationProcByTypeCriteria
|
protected class DeleteAnnotationProcByTypeCriteria
|
||||||
{
|
{
|
||||||
private int _typeID;
|
private readonly int _typeID;
|
||||||
public int TypeID
|
public int TypeID => _typeID;
|
||||||
{ get { return _typeID; } }
|
|
||||||
|
|
||||||
private string _procList;
|
private readonly string _procList;
|
||||||
public string ProcList
|
public string ProcList => _procList;
|
||||||
{ get { return _procList; } }
|
|
||||||
public DeleteAnnotationProcByTypeCriteria(int typeID, string procList)
|
public DeleteAnnotationProcByTypeCriteria(int typeID, string procList)
|
||||||
{
|
{
|
||||||
_typeID = typeID;
|
_typeID = typeID;
|
||||||
@@ -407,13 +354,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class DeleteAnnotationDocvByTypeCriteria
|
protected class DeleteAnnotationDocvByTypeCriteria
|
||||||
{
|
{
|
||||||
private int _typeID;
|
private readonly int _typeID;
|
||||||
public int TypeID
|
public int TypeID => _typeID;
|
||||||
{ get { return _typeID; } }
|
|
||||||
|
|
||||||
private string _versionID;
|
private readonly string _versionID;
|
||||||
public string VersionID
|
public string VersionID => _versionID;
|
||||||
{ get { return _versionID; } }
|
|
||||||
public DeleteAnnotationDocvByTypeCriteria(int typeID, string versionID)
|
public DeleteAnnotationDocvByTypeCriteria(int typeID, string versionID)
|
||||||
{
|
{
|
||||||
_typeID = typeID;
|
_typeID = typeID;
|
||||||
@@ -459,15 +404,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private int _procCnt;
|
private int _procCnt;
|
||||||
public int ProcCnt
|
public int ProcCnt
|
||||||
{ get { return _procCnt; }
|
{
|
||||||
|
get { return _procCnt; }
|
||||||
set { _procCnt = value; }
|
set { _procCnt = value; }
|
||||||
}
|
}
|
||||||
private int _typeID;
|
private readonly int _typeID;
|
||||||
public int TypeID
|
public int TypeID => _typeID;
|
||||||
{ get { return _typeID; } }
|
private readonly string _procList;
|
||||||
private string _procList;
|
public string ProcList => _procList;
|
||||||
public string ProcList
|
|
||||||
{ get { return _procList; } }
|
|
||||||
public getAnnotationCountProcCriteria(int typeID, string procList, int procCnt = 0)
|
public getAnnotationCountProcCriteria(int typeID, string procList, int procCnt = 0)
|
||||||
{
|
{
|
||||||
_typeID = typeID;
|
_typeID = typeID;
|
||||||
@@ -517,15 +461,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
private int _docvCnt;
|
private int _docvCnt;
|
||||||
public int DocvCnt
|
public int DocvCnt
|
||||||
{ get { return _docvCnt; }
|
{
|
||||||
|
get { return _docvCnt; }
|
||||||
set { _docvCnt = value; }
|
set { _docvCnt = value; }
|
||||||
}
|
}
|
||||||
private int _TypeID;
|
private readonly int _TypeID;
|
||||||
public int TypeID
|
public int TypeID => _TypeID;
|
||||||
{ get { return _TypeID; } }
|
private readonly string _docvList;
|
||||||
private string _docvList;
|
public string DocvList => _docvList;
|
||||||
public string DocvList
|
|
||||||
{ get { return _docvList; } }
|
|
||||||
public getAnnotationCountDocvCriteria(int typeID, string docvList, int docvCnt = 0)
|
public getAnnotationCountDocvCriteria(int typeID, string docvList, int docvCnt = 0)
|
||||||
{
|
{
|
||||||
_TypeID = typeID;
|
_TypeID = typeID;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
@@ -438,29 +437,29 @@ namespace VEPROMS.CSLA.Library
|
|||||||
count += lst.Count;
|
count += lst.Count;
|
||||||
if (count == 0) return "";
|
if (count == 0) return "";
|
||||||
string output = typeof(T).Name;
|
string output = typeof(T).Name;
|
||||||
output += "\t" + cache.Count;
|
output += $"\t{cache.Count}";
|
||||||
output += "\t" + count + "\r\n";
|
output += $"\t{count}\r\n";
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
private static string Counts<T>(int count)
|
private static string Counts<T>(int count)
|
||||||
{
|
{
|
||||||
if (count == 0) return "";
|
if (count == 0) return "";
|
||||||
string output = typeof(T).Name;
|
string output = typeof(T).Name;
|
||||||
output += "\t" + count + "\r\n";
|
output += $"\t{count}\r\n";
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
private static string Counts<T>(int countNotDisposed, int countNotFinalized)
|
private static string Counts<T>(int countNotDisposed, int countNotFinalized)
|
||||||
{
|
{
|
||||||
if (countNotDisposed == 0 && countNotFinalized == 0) return "";
|
if (countNotDisposed == 0 && countNotFinalized == 0) return "";
|
||||||
string output = typeof(T).Name;
|
string output = typeof(T).Name;
|
||||||
output += "\t" + countNotDisposed + "\t" + countNotFinalized + "\r\n";
|
output += $"\t{countNotDisposed}\t{countNotFinalized}\r\n";
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
private static string Counts<T>(int countCreated, int countNotDisposed, int countNotFinalized)
|
private static string Counts<T>(int countCreated, int countNotDisposed, int countNotFinalized)
|
||||||
{
|
{
|
||||||
if (countCreated == 0) return "";
|
if (countCreated == 0) return "";
|
||||||
string output = typeof(T).Name;
|
string output = typeof(T).Name;
|
||||||
output += "\t" + countCreated + "\t" + countNotDisposed + "\t" + countNotFinalized + "\r\n";
|
output += $"\t{countCreated}\t{countNotDisposed}\t{countNotFinalized}\r\n";
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -475,6 +474,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Stack
|
#region Stack
|
||||||
public partial class Content
|
public partial class Content
|
||||||
{
|
{
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static List<string> _MyStack = new List<string>();
|
private static List<string> _MyStack = new List<string>();
|
||||||
public static string MyStack
|
public static string MyStack
|
||||||
{
|
{
|
||||||
@@ -519,14 +519,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _MyStack.IndexOf(stk);
|
return _MyStack.IndexOf(stk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private int _StackIndex = StaticStackIndex;
|
private readonly int _StackIndex = StaticStackIndex;
|
||||||
public int StackIndex
|
public int StackIndex => _StackIndex;
|
||||||
{
|
|
||||||
get { return _StackIndex; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class ContentInfo
|
public partial class ContentInfo
|
||||||
{
|
{
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static List<string> _MyStack = new List<string>();
|
private static List<string> _MyStack = new List<string>();
|
||||||
public static string MyStack
|
public static string MyStack
|
||||||
{
|
{
|
||||||
@@ -571,14 +569,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _MyStack.IndexOf(stk);
|
return _MyStack.IndexOf(stk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private int _StackIndex = StaticStackIndex;
|
private readonly int _StackIndex = StaticStackIndex;
|
||||||
public int StackIndex
|
public int StackIndex => _StackIndex;
|
||||||
{
|
|
||||||
get { return _StackIndex; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class DocVersionInfo
|
public partial class DocVersionInfo
|
||||||
{
|
{
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static List<string> _MyStack = new List<string>();
|
private static List<string> _MyStack = new List<string>();
|
||||||
public static string MyStack
|
public static string MyStack
|
||||||
{
|
{
|
||||||
@@ -623,11 +619,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _MyStack.IndexOf(stk);
|
return _MyStack.IndexOf(stk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private int _StackIndex = StaticStackIndex;
|
private readonly int _StackIndex = StaticStackIndex;
|
||||||
public int StackIndex
|
public int StackIndex => _StackIndex;
|
||||||
{
|
|
||||||
get { return _StackIndex; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class PartInfo
|
public partial class PartInfo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@@ -21,26 +19,28 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// if the dictionary hasn't been set yet,
|
// if the dictionary hasn't been set yet,
|
||||||
if (ColorIndx==null)
|
if (ColorIndx==null)
|
||||||
{
|
{
|
||||||
ColorIndx = new Dictionary<string, int>();
|
ColorIndx = new Dictionary<string, int>
|
||||||
ColorIndx["black"] = 1;
|
{
|
||||||
ColorIndx["blue"] = 2;
|
["black"] = 1,
|
||||||
ColorIndx["green"] = 3;
|
["blue"] = 2,
|
||||||
ColorIndx["cyan"] = 4;
|
["green"] = 3,
|
||||||
ColorIndx["red"] = 5;
|
["cyan"] = 4,
|
||||||
ColorIndx["magenta"] = 6;
|
["red"] = 5,
|
||||||
ColorIndx["brown"] = 7;
|
["magenta"] = 6,
|
||||||
ColorIndx["lightgray"] = 8;
|
["brown"] = 7,
|
||||||
ColorIndx["darkgray"] = 9;
|
["lightgray"] = 8,
|
||||||
ColorIndx["lightblue"] = 10;
|
["darkgray"] = 9,
|
||||||
ColorIndx["lightgreen"] = 11;
|
["lightblue"] = 10,
|
||||||
ColorIndx["lightcyan"] = 12;
|
["lightgreen"] = 11,
|
||||||
ColorIndx["lightred"] = 13;
|
["lightcyan"] = 12,
|
||||||
ColorIndx["lightmagenta"] = 14;
|
["lightred"] = 13,
|
||||||
ColorIndx["yellow"] = 15;
|
["lightmagenta"] = 14,
|
||||||
ColorIndx["white"] = 16;
|
["yellow"] = 15,
|
||||||
ColorIndx["ro"] = 17;
|
["white"] = 16,
|
||||||
ColorIndx["trans"] = 18;
|
["ro"] = 17,
|
||||||
ColorIndx["editbackground"] = 19;
|
["trans"] = 18,
|
||||||
|
["editbackground"] = 19
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return ColorIndx[color];
|
return ColorIndx[color];
|
||||||
}
|
}
|
||||||
@@ -49,11 +49,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// This gets the rtf color table string for the input color.
|
// This gets the rtf color table string for the input color.
|
||||||
public static string GetTableString(string color)
|
public static string GetTableString(string color)
|
||||||
{
|
{
|
||||||
Dictionary<string, int> ColorIndx = new Dictionary<string, int>();
|
|
||||||
if (ColorRtf == null)
|
if (ColorRtf == null)
|
||||||
{
|
{
|
||||||
ColorRtf = new Dictionary<string, string>();
|
ColorRtf = new Dictionary<string, string>
|
||||||
|
{
|
||||||
// color table, from 16-bit code, is defined as (in order):
|
// color table, from 16-bit code, is defined as (in order):
|
||||||
// black=0,0,0
|
// black=0,0,0
|
||||||
// blue=0,0,255
|
// blue=0,0,255
|
||||||
@@ -73,25 +72,26 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// white=128,128,128
|
// white=128,128,128
|
||||||
// ro=255,128,0
|
// ro=255,128,0
|
||||||
// editbackground=192,192,192
|
// editbackground=192,192,192
|
||||||
ColorRtf["black"] = "\\red0\\green0\\blue0;";
|
["black"] = "\\red0\\green0\\blue0;",
|
||||||
ColorRtf["blue"] = "\\red0\\green0\\blue255;";
|
["blue"] = "\\red0\\green0\\blue255;",
|
||||||
ColorRtf["green"] = "\\red0\\green155\\blue12;";
|
["green"] = "\\red0\\green155\\blue12;",
|
||||||
ColorRtf["cyan"] = "\\red0\\green136\\blue159;";
|
["cyan"] = "\\red0\\green136\\blue159;",
|
||||||
ColorRtf["red"] = "\\red255\\green0\\blue0;";
|
["red"] = "\\red255\\green0\\blue0;",
|
||||||
ColorRtf["magenta"] = "\\red202\\green28\\blue175;";
|
["magenta"] = "\\red202\\green28\\blue175;",
|
||||||
ColorRtf["brown"] = "\\red128\\green64\\blue0;";
|
["brown"] = "\\red128\\green64\\blue0;",
|
||||||
ColorRtf["lightgray"] = "\\red100\\green100\\blue100;";
|
["lightgray"] = "\\red100\\green100\\blue100;",
|
||||||
ColorRtf["darkgray"] = "\\red10\\green10\\blue10;";
|
["darkgray"] = "\\red10\\green10\\blue10;",
|
||||||
ColorRtf["lightblue"] = "\\red0\\green0\\blue255;";
|
["lightblue"] = "\\red0\\green0\\blue255;",
|
||||||
ColorRtf["lightgreen"] = "\\red0\\green255\\blue0;";
|
["lightgreen"] = "\\red0\\green255\\blue0;",
|
||||||
ColorRtf["lightcyan"] = "\\red0\\green0\\blue255;";
|
["lightcyan"] = "\\red0\\green0\\blue255;",
|
||||||
ColorRtf["lightred"] = "\\red209\\green29\\blue183;";
|
["lightred"] = "\\red209\\green29\\blue183;",
|
||||||
ColorRtf["lightmagenta"] = "\\red255\\green0\\blue255;";
|
["lightmagenta"] = "\\red255\\green0\\blue255;",
|
||||||
ColorRtf["yellow"] = "\\red255\\green0\\blue0;";
|
["yellow"] = "\\red255\\green0\\blue0;",
|
||||||
ColorRtf["white"] = "\\red128\\green128\\blue128;";
|
["white"] = "\\red128\\green128\\blue128;",
|
||||||
ColorRtf["ro"] = "\\red255\\green128\\blue0;";
|
["ro"] = "\\red255\\green128\\blue0;",
|
||||||
ColorRtf["trans"] = "\\red255\\green128\\blue0;";
|
["trans"] = "\\red255\\green128\\blue0;",
|
||||||
ColorRtf["editbackground"] = "\\red192\\green192\\blue192;";
|
["editbackground"] = "\\red192\\green192\\blue192;"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return ColorRtf[color];
|
return ColorRtf[color];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.Xml;
|
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -80,7 +79,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
string rv = ConvertTransitionToText(tran, newvalue);
|
string rv = ConvertTransitionToText(tran, newvalue);
|
||||||
//Text = Text.Substring(0, myIndex - 14) + gg + Text.Substring(myIndex + myLength);
|
//Text = Text.Substring(0, myIndex - 14) + gg + Text.Substring(myIndex + myLength);
|
||||||
using (Item myitem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
using (Item myitem = ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
||||||
{
|
{
|
||||||
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
||||||
// B2016-225 (follow through) added more descriptive Annotation Type when transition is converted to text]
|
// B2016-225 (follow through) added more descriptive Annotation Type when transition is converted to text]
|
||||||
@@ -161,12 +160,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else
|
else
|
||||||
{ // look for rtf font command and insert it around the special char (i.e. symbol char)
|
{ // look for rtf font command and insert it around the special char (i.e. symbol char)
|
||||||
int ii = orgText.IndexOf(specChar);
|
int ii = orgText.IndexOf(specChar);
|
||||||
int fnt1 = -1;
|
|
||||||
int fnt2 = -1;
|
|
||||||
if (ii > -1)
|
if (ii > -1)
|
||||||
{
|
{
|
||||||
fnt1 = orgText.LastIndexOf(@"\f", ii);
|
int fnt1 = orgText.LastIndexOf(@"\f", ii);
|
||||||
fnt2 = orgText.IndexOf(@"\f", ii);
|
int fnt2 = orgText.IndexOf(@"\f", ii);
|
||||||
if (fnt1 != -1 && fnt2 != -1)
|
if (fnt1 != -1 && fnt2 != -1)
|
||||||
newValue = newValue.Replace(specChar, orgText.Substring(fnt1, 3) + specChar + orgText.Substring(fnt2, 3) + " ");
|
newValue = newValue.Replace(specChar, orgText.Substring(fnt1, 3) + specChar + orgText.Substring(fnt2, 3) + " ");
|
||||||
}
|
}
|
||||||
@@ -199,11 +196,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
||||||
int lastIndex = 0;
|
|
||||||
string newText = MyGrid.Data;
|
|
||||||
foreach (Match mm in ms)
|
foreach (Match mm in ms)
|
||||||
{
|
{
|
||||||
int offset = mm.Index;
|
|
||||||
Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline);
|
Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline);
|
||||||
if (m != null && m.Groups.Count > 1)
|
if (m != null && m.Groups.Count > 1)
|
||||||
{
|
{
|
||||||
@@ -228,7 +222,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
break; // Text has been processed
|
break; // Text has been processed
|
||||||
}
|
}
|
||||||
lastIndex = mm.Index + mm.Length;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -554,13 +547,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
if (value == "?" || gg != newvalue)
|
if (value == "?" || gg != newvalue)
|
||||||
{
|
{
|
||||||
MyGrid.Data = Content.ConvertGridROsToText(MyGrid.Data, mmg, mg, newvalue); // B2017-060 convert the RO in the grid (table) to text
|
MyGrid.Data = ConvertGridROsToText(MyGrid.Data, mmg, mg, newvalue); // B2017-060 convert the RO in the grid (table) to text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retval == null ? "" : retval;
|
return retval ?? "";
|
||||||
}
|
}
|
||||||
// B2017-060 logic pulled from dlgExportImport to covert a RO in a table (grid) to text
|
// B2017-060 logic pulled from dlgExportImport to covert a RO in a table (grid) to text
|
||||||
public static string ConvertGridROsToText(string data, Match mmg, Match mg, string ss)
|
public static string ConvertGridROsToText(string data, Match mmg, Match mg, string ss)
|
||||||
@@ -601,8 +594,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string retval = null;
|
string retval = null;
|
||||||
if (value == "?")
|
if (value == "?")
|
||||||
{
|
{
|
||||||
retval = this.ConvertROToText(rousg, value, rotype, origROFstInfo, roidFrmImportStep);
|
retval = ConvertROToText(rousg, value, rotype, origROFstInfo, roidFrmImportStep);
|
||||||
using (Item myitem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
using (Item myitem = ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
||||||
{
|
{
|
||||||
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
||||||
// B2016-225 (follow through) added more descriptive Annotation Type when RO is converted to text
|
// B2016-225 (follow through) added more descriptive Annotation Type when RO is converted to text
|
||||||
@@ -638,7 +631,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
Text = Text.Substring(0, myIndex) + newvalue + Text.Substring(myIndex + myLength);
|
Text = Text.Substring(0, myIndex) + newvalue + Text.Substring(myIndex + myLength);
|
||||||
if (!saveAnnotation)
|
if (!saveAnnotation)
|
||||||
{
|
{
|
||||||
using (Item myitem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
using (Item myitem = ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
||||||
{
|
{
|
||||||
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
||||||
// B2016-225 (follow through) added more descriptive Annotation Type when RO is converted to text
|
// B2016-225 (follow through) added more descriptive Annotation Type when RO is converted to text
|
||||||
@@ -837,20 +830,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return str.Replace(@"\u8209?", "-").Replace(@"\u160?", " "); //dash and hard space
|
return str.Replace(@"\u8209?", "-").Replace(@"\u160?", " "); //dash and hard space
|
||||||
}
|
}
|
||||||
|
|
||||||
//C2022-028 (only used from Amin Tools) check the RO link text - compare with RO Usage information, annotate RO links that are bad
|
//C2022-028 (only used from Admin Tools) check the RO link text - compare with RO Usage information, annotate RO links that are bad
|
||||||
public bool CheckROLinkTextandUsage(ref int BadROLinksCount, ref int CheckROLinksCount, ref int FixedROLinksCount)
|
public bool CheckROLinkTextandUsage(ref int BadROLinksCount, ref int CheckROLinksCount)
|
||||||
{
|
{
|
||||||
/*** needed if we fix RO link text
|
if (Text.Contains("#Link:ReferencedObject:"))
|
||||||
bool bFixedROLinks = false;
|
|
||||||
bool bFixedTableDataText = false;
|
|
||||||
***/
|
|
||||||
if (this.Text.Contains("#Link:ReferencedObject:"))
|
|
||||||
{
|
{
|
||||||
if (this.ContentRoUsageCount == 0) // Procedure text has one or more links but no RO Usage records
|
if (ContentRoUsageCount == 0) // Procedure text has one or more links but no RO Usage records
|
||||||
{
|
{
|
||||||
CheckROLinksCount++;
|
CheckROLinksCount++;
|
||||||
_MyLog.ErrorFormat(string.Format("No RO usage records for RO link(s) - ContentID = {0}", this.ContentID));
|
_MyLog.ErrorFormat(string.Format("No RO usage records for RO link(s) - ContentID = {0}", ContentID));
|
||||||
using (Item myItem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache
|
using (Item myItem = ContentItems[0].MyItem) // so that myitem does not stay in cache
|
||||||
{
|
{
|
||||||
myItem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed
|
myItem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed
|
||||||
Annotation.MakeAnnotation(myItem, AnnotationType.GetByNameOrCreate("Bad RO link"), "", "Incomplete RO Link Information for all RO References in this text - Relink RO References", null);
|
Annotation.MakeAnnotation(myItem, AnnotationType.GetByNameOrCreate("Bad RO link"), "", "Incomplete RO Link Information for all RO References in this text - Relink RO References", null);
|
||||||
@@ -862,7 +851,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string findLink = @"<START\].*?\[END>";
|
string findLink = @"<START\].*?\[END>";
|
||||||
MatchCollection ms = Regex.Matches(Text, findLink); // finds all the links (both RO and Transitions)
|
MatchCollection ms = Regex.Matches(Text, findLink); // finds all the links (both RO and Transitions)
|
||||||
string lookFor = "#Link:ReferencedObject:";
|
string lookFor = "#Link:ReferencedObject:";
|
||||||
string fixedContentText = Text;
|
|
||||||
if (ms.Count > 0)
|
if (ms.Count > 0)
|
||||||
{
|
{
|
||||||
int roCnt = 0;
|
int roCnt = 0;
|
||||||
@@ -892,18 +880,17 @@ namespace VEPROMS.CSLA.Library
|
|||||||
bool GoodROUsageID = false;
|
bool GoodROUsageID = false;
|
||||||
bool GoodROID = false;
|
bool GoodROID = false;
|
||||||
// Check each ContentRoUsages and look for a matching ROUsageID and ROID
|
// Check each ContentRoUsages and look for a matching ROUsageID and ROID
|
||||||
if (iRousage > 0 && this.ContentRoUsageCount > 0)
|
if (iRousage > 0 && ContentRoUsageCount > 0)
|
||||||
{
|
{
|
||||||
int lastROUsageID = -1;
|
int lastROUsageID = -1;
|
||||||
string lastROID = "";
|
string lastROID = "";
|
||||||
RoUsageInfo badRoUsageInfo = null;
|
RoUsageInfo badRoUsageInfo = null;
|
||||||
foreach (RoUsageInfo rui in this.ContentItems[0].MyItem.MyItemInfo.MyContent.ContentRoUsages)
|
foreach (RoUsageInfo rui in ContentItems[0].MyItem.MyItemInfo.MyContent.ContentRoUsages)
|
||||||
{
|
{
|
||||||
GoodROID = rui.ROID.Equals(sROid); //does this usage record have a matching ROID with the link text?
|
GoodROID = rui.ROID.Equals(sROid); //does this usage record have a matching ROID with the link text?
|
||||||
GoodROUsageID = rui.ROUsageID.Equals(iRousage); //does the usage record have a matching ROUsageID with the link text?
|
GoodROUsageID = rui.ROUsageID.Equals(iRousage); //does the usage record have a matching ROUsageID with the link text?
|
||||||
if (GoodROID && GoodROUsageID)
|
if (GoodROID && GoodROUsageID)
|
||||||
{
|
{
|
||||||
//myROUsages.RemoveAt(myROUsageCnt - 1);
|
|
||||||
break; // jump out loop - valid RO Usage record found
|
break; // jump out loop - valid RO Usage record found
|
||||||
}
|
}
|
||||||
if (GoodROID && !GoodROUsageID)
|
if (GoodROID && !GoodROUsageID)
|
||||||
@@ -918,46 +905,24 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
BadROLinksCount++;
|
BadROLinksCount++;
|
||||||
// Add detail information to the error log
|
// Add detail information to the error log
|
||||||
_MyLog.ErrorFormat(string.Format("Invalid ROID - ContentID = {0} Link - {1}", this.ContentID, mm.Value));
|
_MyLog.ErrorFormat(string.Format("Invalid ROID - ContentID = {0} Link - {1}", ContentID, mm.Value));
|
||||||
sAnnotationText += string.Format("Bad RO Instance {0} - RO Needs Relinked - RO Text different than RO Data\n", roCnt);
|
sAnnotationText += string.Format("Bad RO Instance {0} - RO Needs Relinked - RO Text different than RO Data\n", roCnt);
|
||||||
}
|
}
|
||||||
else if (!GoodROUsageID) // Link does not have a valid ROUsage record for that RO link - add annotation
|
else if (!GoodROUsageID) // Link does not have a valid ROUsage record for that RO link - add annotation
|
||||||
{
|
{
|
||||||
BadROLinksCount++;
|
BadROLinksCount++;
|
||||||
/*********
|
|
||||||
//** below is logic to replace the ROUsageID in the linked text with one (for this contentID) that has the same ROID
|
|
||||||
//** Commented out for now as this was test code for now - don't want to give to customers until we are comfortable
|
|
||||||
//if (lastROUsageID != -1)
|
|
||||||
//{
|
|
||||||
// // set the ROUsageID in the link text to last good ROUsageID found in ROUsage table
|
|
||||||
// linkText = linkText.Replace(string.Format("#Link:ReferencedObject:{0} ", sROusageID), string.Format("#Link:ReferencedObject:{0} ", lastROUsageID));
|
|
||||||
// fixedContentText = fixedContentText.Replace(string.Format("#Link:ReferencedObject:{0} ", sROusageID), string.Format("#Link:ReferencedObject:{0} ", lastROUsageID));
|
|
||||||
// bFixedROLinks = true; // set to true so we know to update content text
|
|
||||||
// _MyLog.InfoFormat(string.Format("Fixed Invalid RO Link - ContentID = {0} badLink - {1} goodLink - {2}",this.ContentID, mm.Value, linkText));
|
|
||||||
// FixedROLinksCount++;
|
|
||||||
// using (Item myItem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
|
||||||
// {
|
|
||||||
// myItem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
|
||||||
// //Annotation.MakeAnnotation(myItem, AnnotationType.GetByNameOrCreate("Bad RO link"), "", string.Format("Invalid RO Usage ID for RO Instance {0}",roCnt), null);
|
|
||||||
// Annotation.MakeAnnotation(myItem, AnnotationType.GetByNameOrCreate("Fixed Bad RO link"), "", string.Format("Fixed RO Instance {0} - Verify RO Value", roCnt), null);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
*********/
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// Add detail information to the error log
|
// Add detail information to the error log
|
||||||
_MyLog.ErrorFormat(string.Format("Invalid ROUsageID - ContentID = {0} Link - {1}", this.ContentID, mm.Value));
|
_MyLog.ErrorFormat(string.Format("Invalid ROUsageID - ContentID = {0} Link - {1}", ContentID, mm.Value));
|
||||||
sAnnotationText += string.Format("RO Instance {0} Needs Relinked - Value Not Able To Update\n", roCnt);
|
sAnnotationText += string.Format("RO Instance {0} Needs Relinked - Value Not Able To Update\n", roCnt);
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (roCnt < this.ContentRoUsageCount)
|
if (roCnt < ContentRoUsageCount)
|
||||||
{
|
{
|
||||||
BadROLinksCount++;
|
BadROLinksCount++;
|
||||||
// there are more RO Usage records then there links in the step
|
// there are more RO Usage records then there links in the step
|
||||||
_MyLog.WarnFormat(string.Format("Possible missing RO links, more RO Usage records than Links - ContentID = {0}", this.ContentID));
|
_MyLog.WarnFormat(string.Format("Possible missing RO links, more RO Usage records than Links - ContentID = {0}", ContentID));
|
||||||
sAnnotationText += "Possible missing RO links.\n";
|
sAnnotationText += "Possible missing RO links.\n";
|
||||||
}
|
}
|
||||||
// if any bad RO links were found, put the information in an Annotation
|
// if any bad RO links were found, put the information in an Annotation
|
||||||
@@ -965,113 +930,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
char[] newLine = { '\n' };
|
char[] newLine = { '\n' };
|
||||||
sAnnotationText = sAnnotationText.TrimEnd(newLine);
|
sAnnotationText = sAnnotationText.TrimEnd(newLine);
|
||||||
using (Item myItem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
using (Item myItem = ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
||||||
{
|
{
|
||||||
myItem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
myItem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
||||||
//Annotation.MakeAnnotation(myItem, AnnotationType.GetByNameOrCreate("Bad RO link"), "", string.Format("Invalid RO Usage ID for RO Instance {0}",roCnt), null);
|
|
||||||
Annotation.MakeAnnotation(myItem, AnnotationType.GetByNameOrCreate("Bad RO link"), "", sAnnotationText, null);
|
Annotation.MakeAnnotation(myItem, AnnotationType.GetByNameOrCreate("Bad RO link"), "", sAnnotationText, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*** COMMENTED OUT BECAUSE WE NOT MAKING CHANGES TO THE DATA - FOR NOW
|
|
||||||
//if (bFixedROLinks)
|
|
||||||
//{
|
|
||||||
// // save content text
|
|
||||||
// Text = fixedContentText;
|
|
||||||
//}
|
|
||||||
*****/
|
|
||||||
|
|
||||||
/*******
|
|
||||||
// if we fix RO links in the RTF then see if there is a grid to update too.
|
|
||||||
// WE DON'T NEED TO ADD ANNOTATIONS AS THAT IS DONE ABOVE (FOR THE RTF OF THE TABLE - BELOW IS THE XML OF THE TABLE
|
|
||||||
// *** bFixedROLinks WILL REMAIN FALSE FOR NOW AS WE ARE NOT CHANGING LINK TEXT - THIS WILL PREVENT THE CHECKING OF THE XML TABLE
|
|
||||||
if (bFixedROLinks && MyGrid != null && MyGrid.Data.Length > 0)
|
|
||||||
{
|
|
||||||
string fixedTableDataText = MyGrid.Data;
|
|
||||||
// **** NEED LOGIC TO CHECK RO TABLES ****
|
|
||||||
|
|
||||||
//if (rotype == (int)E_ROValueType.Table) // if change in rotable data...
|
|
||||||
//{
|
|
||||||
// if (origROFstInfo != null)
|
|
||||||
// {
|
|
||||||
// List<string> retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data));
|
|
||||||
// if (MyGrid.Data != retlist[1])
|
|
||||||
// {
|
|
||||||
// MyGrid.Data = retlist[1];
|
|
||||||
// retval = Text;
|
|
||||||
// if (Text != retlist[0])
|
|
||||||
// Text = retlist[0];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
{
|
|
||||||
// if it's an ro within a table, need to process into an flex grid to save the grid data:
|
|
||||||
string findLinkXml = @"<START\].*?\[END>";
|
|
||||||
//string lookForXml = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousg.ROUsageID);
|
|
||||||
string lookForXml = "#Link:ReferencedObject:";
|
|
||||||
MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml);
|
|
||||||
foreach (Match mmg in msg)
|
|
||||||
{
|
|
||||||
Match mg = Regex.Match(mmg.Value, lookForXml);// look for Referenced Object link in linked text
|
|
||||||
if (mg != null && mg.Groups.Count > 1)
|
|
||||||
{
|
|
||||||
string tblLinkText = mmg.Value; // the link text in the table XML
|
|
||||||
int rousgidx = mg.Index + mg.Length;
|
|
||||||
int rousagid_len = mmg.Value.IndexOf(" ", rousgidx) - rousgidx;
|
|
||||||
string sROusageID = mmg.Value.Substring(rousgidx, rousagid_len); // ROUsageID from link text
|
|
||||||
int roidIdx = rousgidx + rousagid_len + 1;
|
|
||||||
int roid_Len = mmg.Value.IndexOf(" ", roidIdx) - roidIdx;
|
|
||||||
string sROid = mmg.Value.Substring(roidIdx, roid_Len);
|
|
||||||
// initialize to zero for cases where the ROUsage is <CROUSGID or <NEWID> to force a no match below
|
|
||||||
// -when a link has either of these, then the process of inserting that RO link did not complete for some reason
|
|
||||||
int iRousage = 0;
|
|
||||||
if (!sROusageID.StartsWith("<")) // don't try to convert if link has <CROUSGID or <NEWID> for the ROUsageID value
|
|
||||||
iRousage = Convert.ToInt32(sROusageID); //ROUsageID as interger
|
|
||||||
// see if there is a ContentID and ROUsage record match
|
|
||||||
// Both GoodROUsageID and GoodROUID must match in ROUsage record for link to be good
|
|
||||||
bool GoodROUsageID = false;
|
|
||||||
bool GoodROID = false;
|
|
||||||
// Check each ContentRoUsages and look for a matching ROUsageID and ROID
|
|
||||||
if (iRousage > 0 && this.ContentRoUsageCount > 0)
|
|
||||||
{
|
|
||||||
int lastROUsageID = -1;
|
|
||||||
string lastROID = "";
|
|
||||||
RoUsageInfo badRoUsageInfo = null;
|
|
||||||
foreach (RoUsageInfo rui in this.ContentItems[0].MyItem.MyItemInfo.MyContent.ContentRoUsages)
|
|
||||||
{
|
|
||||||
GoodROID = rui.ROID.Equals(sROid); //does this usage record have a matching ROID with the link text?
|
|
||||||
GoodROUsageID = rui.ROUsageID.Equals(iRousage); //does the usage record have a matching ROUsageID with the link text?
|
|
||||||
if (GoodROID && GoodROUsageID) break; // jump out loop - valid RO Usage record found
|
|
||||||
if (GoodROID && !GoodROUsageID)
|
|
||||||
{
|
|
||||||
lastROUsageID = rui.ROUsageID;
|
|
||||||
lastROID = rui.ROID;
|
|
||||||
}
|
|
||||||
else if (!GoodROID && GoodROUsageID)
|
|
||||||
badRoUsageInfo = rui;
|
|
||||||
}
|
|
||||||
if (!GoodROUsageID && GoodROID && lastROUsageID != -1) // Link does not have a valid ROUsage record for that RO link - add annotation
|
|
||||||
{
|
|
||||||
// set the ROUsageID in the link text to last good ROUsageID found in ROUsage table
|
|
||||||
tblLinkText = tblLinkText.Replace(string.Format("#Link:ReferencedObject:{0} ", sROusageID), string.Format("#Link:ReferencedObject:{0} ", lastROUsageID));
|
|
||||||
fixedTableDataText = fixedTableDataText.Replace(string.Format("#Link:ReferencedObject:{0} ", sROusageID), string.Format("#Link:ReferencedObject:{0} ", lastROUsageID));
|
|
||||||
bFixedTableDataText = true; // set to true so we know to update content text
|
|
||||||
}
|
|
||||||
if (bFixedTableDataText) // if we changed the table XML, then save it
|
|
||||||
{
|
|
||||||
this.MyGrid.Data = fixedTableDataText;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
******* End modify table ****/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*** needed if we fix RO links
|
|
||||||
return (bFixedROLinks || bFixedTableDataText);
|
|
||||||
***/
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1079,29 +946,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public delegate void StaticContentInfoEvent(object sender, StaticContentInfoEventArgs args);
|
public delegate void StaticContentInfoEvent(object sender, StaticContentInfoEventArgs args);
|
||||||
public class StaticContentInfoEventArgs
|
public class StaticContentInfoEventArgs
|
||||||
{
|
{
|
||||||
string _OldValue;
|
public string OldValue { get; set; }
|
||||||
public string OldValue
|
public string NewValue { get; set; }
|
||||||
{
|
public string Type { get; set; }
|
||||||
get { return _OldValue; }
|
|
||||||
set { _OldValue = value; }
|
|
||||||
}
|
|
||||||
string _NewValue;
|
|
||||||
public string NewValue
|
|
||||||
{
|
|
||||||
get { return _NewValue; }
|
|
||||||
set { _NewValue = value; }
|
|
||||||
}
|
|
||||||
string _Type;
|
|
||||||
public string Type
|
|
||||||
{
|
|
||||||
get { return _Type; }
|
|
||||||
set { _Type = value; }
|
|
||||||
}
|
|
||||||
public StaticContentInfoEventArgs(string oldValue, string newValue, string type)
|
public StaticContentInfoEventArgs(string oldValue, string newValue, string type)
|
||||||
{
|
{
|
||||||
_OldValue = oldValue;
|
OldValue = oldValue;
|
||||||
_NewValue = newValue;
|
NewValue = newValue;
|
||||||
_Type = type;
|
Type = type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1119,26 +971,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string LastChangedString
|
public string LastChangedString => FormatByteArray(_LastChanged);
|
||||||
{
|
|
||||||
get { return ContentInfo.FormatByteArray(_LastChanged); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Int64 LastChangedInt64
|
public long LastChangedInt64 => Convert.ToInt64(LastChangedString, 16);
|
||||||
{
|
public static bool IsInCache(int contentID) => _CacheByPrimaryKey.ContainsKey(contentID.ToString());
|
||||||
get { return Convert.ToInt64(LastChangedString, 16); }
|
|
||||||
}
|
|
||||||
public static bool IsInCache(int contentID)
|
|
||||||
{
|
|
||||||
return _CacheByPrimaryKey.ContainsKey(contentID.ToString());
|
|
||||||
}
|
|
||||||
public static event StaticContentInfoEvent StaticContentInfoChange;
|
public static event StaticContentInfoEvent StaticContentInfoChange;
|
||||||
// B2018-002 - Invalid Transitions - Changed to Public
|
// B2018-002 - Invalid Transitions - Changed to Public
|
||||||
public static void OnStaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
public static void OnStaticContentInfoChange(object sender, StaticContentInfoEventArgs args) => StaticContentInfoChange?.Invoke(sender, args);
|
||||||
{
|
|
||||||
if (StaticContentInfoChange != null)
|
|
||||||
StaticContentInfoChange(sender, args);
|
|
||||||
}
|
|
||||||
public string MyContentMessage = string.Empty;
|
public string MyContentMessage = string.Empty;
|
||||||
public string MyGridMessage = string.Empty;
|
public string MyGridMessage = string.Empty;
|
||||||
public bool InList(params int[] IDs)
|
public bool InList(params int[] IDs)
|
||||||
@@ -1150,20 +989,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii)
|
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii) => FixTransitionText(tran, tranLookup, ii, "");
|
||||||
{
|
|
||||||
FixTransitionText(tran, tranLookup, ii, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FixTransitionText(TransitionInfo tran, ItemInfo ii)
|
public void FixTransitionText(TransitionInfo tran, ItemInfo ii) => FixTransitionText(tran, ii, "");
|
||||||
{
|
|
||||||
FixTransitionText(tran, ii, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FixTransitionText(TransitionInfo tran, ItemInfo ii, string forceConvertToText)
|
public void FixTransitionText(TransitionInfo tran, ItemInfo ii, string forceConvertToText) => FixTransitionText(tran, null, ii, forceConvertToText);
|
||||||
{
|
|
||||||
FixTransitionText(tran, null, ii, forceConvertToText);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii, string forceConvertToText)
|
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii, string forceConvertToText)
|
||||||
{
|
{
|
||||||
@@ -1199,7 +1029,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
myLength += m.Groups[3].Length;
|
myLength += m.Groups[3].Length;
|
||||||
}
|
}
|
||||||
string gg = Text.Substring(myIndex, myLength);
|
string gg = Text.Substring(myIndex, myLength);
|
||||||
MyContentMessage = string.Format("ContentExt.ContentInfo:Content:{0}, {1}, {2}", this.ContentID, tran.TransitionID, gg);
|
MyContentMessage = string.Format("ContentExt.ContentInfo:Content:{0}, {1}, {2}", ContentID, tran.TransitionID, gg);
|
||||||
newvalue = newvalue.Replace("{", @"\{").Replace("}", @"\}");
|
newvalue = newvalue.Replace("{", @"\{").Replace("}", @"\}");
|
||||||
if ((gg.Replace(@"\u8209?", "-").Replace(@"\u9586?", @"\\")) != (newvalue.Replace("\\u8209?", "-").Replace(@"\u9586?", @"\\")) || newvalue == "?") // B2017-165 added check of newvalue
|
if ((gg.Replace(@"\u8209?", "-").Replace(@"\u9586?", @"\\")) != (newvalue.Replace("\\u8209?", "-").Replace(@"\u9586?", @"\\")) || newvalue == "?") // B2017-165 added check of newvalue
|
||||||
{
|
{
|
||||||
@@ -1230,22 +1060,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// see if there is a grid to update too.
|
// see if there is a grid to update too.
|
||||||
if (tran.MyContent.MyGrid != null)
|
if (tran.MyContent.MyGrid != null)
|
||||||
{
|
{
|
||||||
//string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
|
||||||
//Match mg = Regex.Match(MyGrid.Data, lookForXml);
|
|
||||||
//if (mg != null && mg.Groups.Count > 1)
|
|
||||||
//{
|
|
||||||
// System.Text.RegularExpressions.Group g = mg.Groups[3];
|
|
||||||
// //if (g.ToString() != transText)
|
|
||||||
// // MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length);
|
|
||||||
//}
|
|
||||||
MyGridMessage = string.Empty;
|
MyGridMessage = string.Empty;
|
||||||
string findLinkXml = @"<START\].*?\[END>";
|
string findLinkXml = @"<START\].*?\[END>";
|
||||||
//string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
|
|
||||||
string lookForXml = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
string lookForXml = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
||||||
MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml);
|
MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml);
|
||||||
foreach (Match mmg in msg)
|
foreach (Match mmg in msg)
|
||||||
{
|
{
|
||||||
Match mg = Regex.Match(mmg.Value, lookForXml);// Regex.Match(MyGrid.Data, lookForXml);
|
Match mg = Regex.Match(mmg.Value, lookForXml);
|
||||||
if (mg != null && mg.Groups.Count > 1)
|
if (mg != null && mg.Groups.Count > 1)
|
||||||
{
|
{
|
||||||
int myIndex = mg.Groups[4].Index + mmg.Index;
|
int myIndex = mg.Groups[4].Index + mmg.Index;
|
||||||
@@ -1264,7 +1085,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (m == null)
|
if (m == null)
|
||||||
newvalue = newvalue.Replace(@"\u8209?", "-");
|
newvalue = newvalue.Replace(@"\u8209?", "-");
|
||||||
else
|
else
|
||||||
newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value);
|
newvalue = newvalue.Replace(@"\u8209?", $@"{m.Groups[1].Value}\u8209?{m.Groups[3].Value}");
|
||||||
}
|
}
|
||||||
if (newvalue.Contains(@"\u9586?"))
|
if (newvalue.Contains(@"\u9586?"))
|
||||||
{
|
{
|
||||||
@@ -1272,7 +1093,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (m == null)
|
if (m == null)
|
||||||
newvalue = newvalue.Replace(@"\u9586?", @"\\");
|
newvalue = newvalue.Replace(@"\u9586?", @"\\");
|
||||||
else
|
else
|
||||||
newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value);
|
newvalue = newvalue.Replace(@"\u9586?", $@"{m.Groups[1].Value}\u9586?{m.Groups[3].Value}");
|
||||||
}
|
}
|
||||||
if (newvalue.Contains(@"\u9586?"))
|
if (newvalue.Contains(@"\u9586?"))
|
||||||
{
|
{
|
||||||
@@ -1280,9 +1101,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (m == null)
|
if (m == null)
|
||||||
newvalue = newvalue.Replace(@"\u9586?", @"\\");
|
newvalue = newvalue.Replace(@"\u9586?", @"\\");
|
||||||
else
|
else
|
||||||
newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value);
|
newvalue = newvalue.Replace(@"\u9586?", $@"{m.Groups[1].Value}\u9586?{m.Groups[3].Value}");
|
||||||
}
|
}
|
||||||
MyGridMessage = string.Format("ContentExt.ContentInfo:Grid:{0}, {1}, {2}", this.ContentID, tran.TransitionID, gg);
|
MyGridMessage = string.Format("ContentExt.ContentInfo:Grid:{0}, {1}, {2}", ContentID, tran.TransitionID, gg);
|
||||||
if (gg != newvalue)
|
if (gg != newvalue)
|
||||||
{
|
{
|
||||||
MyGrid.SetData(MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength));
|
MyGrid.SetData(MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength));
|
||||||
@@ -1362,10 +1183,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
newvalue = newvalue.Replace($"{(char)916}", @"\u916?");
|
newvalue = newvalue.Replace($"{(char)916}", @"\u916?");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug - jsj 5-19-2017 - left in for initial check-in
|
|
||||||
//string xx_gg = gg_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
|
||||||
//string xx_nv = newval_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
|
||||||
//Console.WriteLine(xx_gg.CompareTo(xx_nv));
|
|
||||||
OnStaticContentInfoChange(ii, new StaticContentInfoEventArgs(gg, newvalue, "RO"));
|
OnStaticContentInfoChange(ii, new StaticContentInfoEventArgs(gg, newvalue, "RO"));
|
||||||
break; // Text has been processed
|
break; // Text has been processed
|
||||||
}
|
}
|
||||||
@@ -1378,7 +1195,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (rotype == (int)E_ROValueType.Table) // if change in rotable data...
|
if (rotype == (int)E_ROValueType.Table) // if change in rotable data...
|
||||||
{
|
{
|
||||||
List<string> retlist = origROFstInfo.OnROTableUpdate(this.Get(), new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data));
|
List<string> retlist = origROFstInfo.OnROTableUpdate(Get(), new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data));
|
||||||
if (retlist != null && Text != retlist[0]) _Text = retlist[0]; //B2022-075 added null reference check
|
if (retlist != null && Text != retlist[0]) _Text = retlist[0]; //B2022-075 added null reference check
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1412,7 +1229,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (m.Groups.Count < 3)
|
if (m.Groups.Count < 3)
|
||||||
newvalue = newvalue.Replace(@"\u8209?", "-");
|
newvalue = newvalue.Replace(@"\u8209?", "-");
|
||||||
else
|
else
|
||||||
newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value);
|
newvalue = newvalue.Replace(@"\u8209?", $@"{m.Groups[1].Value}\u8209?{m.Groups[3].Value}");
|
||||||
}
|
}
|
||||||
//B2024-003, B2023-113, B2024-093 - Updating RO Values inside a text Grid,
|
//B2024-003, B2023-113, B2024-093 - Updating RO Values inside a text Grid,
|
||||||
// This will handle if there is a delta and the column/row of the grid is removed
|
// This will handle if there is a delta and the column/row of the grid is removed
|
||||||
@@ -1425,7 +1242,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else if (m.Groups.Count < 3)
|
else if (m.Groups.Count < 3)
|
||||||
newvalue = newvalue.Replace(@"\u916?", $"{(char)916}");
|
newvalue = newvalue.Replace(@"\u916?", $"{(char)916}");
|
||||||
else
|
else
|
||||||
newvalue = newvalue.Replace(@"\u916?", m.Groups[1].Value + @"\u916?" + m.Groups[3].Value);
|
newvalue = newvalue.Replace(@"\u916?", $@"{m.Groups[1].Value}\u916?{m.Groups[3].Value}");
|
||||||
}
|
}
|
||||||
if (newvalue.Contains(@"\u8593?"))
|
if (newvalue.Contains(@"\u8593?"))
|
||||||
{
|
{
|
||||||
@@ -1433,7 +1250,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (m.Groups.Count < 3)
|
if (m.Groups.Count < 3)
|
||||||
newvalue = newvalue.Replace(@"\u8593?", "^");
|
newvalue = newvalue.Replace(@"\u8593?", "^");
|
||||||
else
|
else
|
||||||
newvalue = newvalue.Replace(@"\u8593?", m.Groups[1].Value + @"\u8593?" + m.Groups[3].Value);
|
newvalue = newvalue.Replace(@"\u8593?", $@"{m.Groups[1].Value}\u8593?{m.Groups[3].Value}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newvalue.Contains(@"\u9586?"))
|
if (newvalue.Contains(@"\u9586?"))
|
||||||
@@ -1442,7 +1259,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (m.Groups.Count < 3)
|
if (m.Groups.Count < 3)
|
||||||
newvalue = newvalue.Replace(@"\u9586?", @"\\");
|
newvalue = newvalue.Replace(@"\u9586?", @"\\");
|
||||||
else
|
else
|
||||||
newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value);
|
newvalue = newvalue.Replace(@"\u9586?", $@"{m.Groups[1].Value}\u9586?{m.Groups[3].Value}");
|
||||||
}
|
}
|
||||||
// B2022-064: Translate '<' to '<', '<' is xml token, so xml grid string was incorrect for print.
|
// B2022-064: Translate '<' to '<', '<' is xml token, so xml grid string was incorrect for print.
|
||||||
// Note that the '>' symbol was also translated. This method does NOT save the string to database,
|
// Note that the '>' symbol was also translated. This method does NOT save the string to database,
|
||||||
@@ -1470,10 +1287,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
// C2021-018 used to update the content record when displaying Alarm Pont Table information in the step Editor (BNPP alarms)
|
// C2021-018 used to update the content record when displaying Alarm Pont Table information in the step Editor (BNPP alarms)
|
||||||
public void UpdateAlarmTableInfoView(string updateText)
|
public void UpdateAlarmTableInfoView(string updateText) => _Text = updateText;
|
||||||
{
|
|
||||||
_Text = updateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadNonCachedGrid()
|
public void LoadNonCachedGrid()
|
||||||
{
|
{
|
||||||
@@ -1481,10 +1295,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//Console.WriteLine("LoadNonCachedGrid {0},{1},{2}",ContentID,_MyGrid==null,_MyContentInfoUnique);
|
//Console.WriteLine("LoadNonCachedGrid {0},{1},{2}",ContentID,_MyGrid==null,_MyContentInfoUnique);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartInfoList LocalContentParts
|
public PartInfoList LocalContentParts => _ContentParts;
|
||||||
{
|
|
||||||
get { return _ContentParts; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddPart(SafeDataReader dr, ItemInfo itemInfo)
|
public void AddPart(SafeDataReader dr, ItemInfo itemInfo)
|
||||||
{
|
{
|
||||||
@@ -1494,15 +1305,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_ContentParts.AddPartInfo(dr, itemInfo);
|
_ContentParts.AddPartInfo(dr, itemInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString() => $"{Number} {Text}";
|
||||||
{
|
|
||||||
return string.Format("{0} {1}", Number, Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ShowChange()
|
public void ShowChange() => OnChange();
|
||||||
{
|
|
||||||
OnChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal ContentInfo(SafeDataReader dr, bool ForItem)
|
internal ContentInfo(SafeDataReader dr, bool ForItem)
|
||||||
{
|
{
|
||||||
@@ -1587,7 +1392,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
private void DataPortal_Fetch(ContentListCriteria criteria)
|
private void DataPortal_Fetch(ContentListCriteria criteria)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
RaiseListChangedEvents = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
@@ -1604,7 +1409,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -1616,7 +1421,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
Database.LogException("ContentInfoList.DataPortal_Fetch", ex);
|
Database.LogException("ContentInfoList.DataPortal_Fetch", ex);
|
||||||
throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex);
|
throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
this.RaiseListChangedEvents = true;
|
RaiseListChangedEvents = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ContentInfoList GetChangedList(byte[] lastChanged)
|
public static ContentInfoList GetChangedList(byte[] lastChanged)
|
||||||
@@ -1624,7 +1429,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
ContentInfoList tmp = DataPortal.Fetch<ContentInfoList>(new ChangeListCriteria(lastChanged));
|
ContentInfoList tmp = DataPortal.Fetch<ContentInfoList>(new ChangeListCriteria(lastChanged));
|
||||||
// ContentInfo.AddList(tmp);
|
|
||||||
tmp.AddEvents();
|
tmp.AddEvents();
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
@@ -1651,7 +1455,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
private void DataPortal_Fetch(ChangeListCriteria criteria)
|
private void DataPortal_Fetch(ChangeListCriteria criteria)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
RaiseListChangedEvents = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
@@ -1668,7 +1472,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -1680,7 +1484,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
Database.LogException("ContentInfoList.DataPortal_Fetch", ex);
|
Database.LogException("ContentInfoList.DataPortal_Fetch", ex);
|
||||||
throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex);
|
throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
this.RaiseListChangedEvents = true;
|
RaiseListChangedEvents = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region ClearCBOverride
|
#region ClearCBOverride
|
||||||
@@ -1725,7 +1529,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -1760,28 +1564,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public ClearOverrideFormatsByDocVersionCriteria(string dvlist, int? formatID, int? newformatID)
|
public ClearOverrideFormatsByDocVersionCriteria(string dvlist, int? formatID, int? newformatID)
|
||||||
{
|
{
|
||||||
_FormatID = formatID;
|
FormatID = formatID;
|
||||||
_DVList = dvlist;
|
DVList = dvlist;
|
||||||
_NewFormatID = newformatID;
|
NewFormatID = newformatID;
|
||||||
}
|
|
||||||
private int? _FormatID;
|
|
||||||
public int? FormatID
|
|
||||||
{
|
|
||||||
get { return _FormatID; }
|
|
||||||
set { _FormatID = value; }
|
|
||||||
}
|
|
||||||
private int? _NewFormatID;
|
|
||||||
public int? NewFormatID
|
|
||||||
{
|
|
||||||
get { return _NewFormatID; }
|
|
||||||
set { _NewFormatID = value; }
|
|
||||||
}
|
|
||||||
private string _DVList;
|
|
||||||
public string DVList
|
|
||||||
{
|
|
||||||
get { return _DVList; }
|
|
||||||
set { _DVList = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int? FormatID { get; set; }
|
||||||
|
public int? NewFormatID { get; set; }
|
||||||
|
public string DVList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataPortal_Fetch(ClearOverrideFormatsByDocVersionCriteria criteria)
|
private void DataPortal_Fetch(ClearOverrideFormatsByDocVersionCriteria criteria)
|
||||||
@@ -1810,7 +1600,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -1841,28 +1631,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public ClearOverrideFormatsByItemCriteria(int itemID, int? formatID, int? newformatID)
|
public ClearOverrideFormatsByItemCriteria(int itemID, int? formatID, int? newformatID)
|
||||||
{
|
{
|
||||||
_FormatID = formatID;
|
FormatID = formatID;
|
||||||
_NewFormatID = newformatID;
|
NewFormatID = newformatID;
|
||||||
_ItemID = itemID;
|
ItemID = itemID;
|
||||||
}
|
|
||||||
private int? _FormatID;
|
|
||||||
public int? FormatID
|
|
||||||
{
|
|
||||||
get { return _FormatID; }
|
|
||||||
set { _FormatID = value; }
|
|
||||||
}
|
|
||||||
private int? _NewFormatID;
|
|
||||||
public int? NewFormatID
|
|
||||||
{
|
|
||||||
get { return _NewFormatID; }
|
|
||||||
set { _NewFormatID = value; }
|
|
||||||
}
|
|
||||||
private int _ItemID;
|
|
||||||
public int ItemID
|
|
||||||
{
|
|
||||||
get { return _ItemID; }
|
|
||||||
set { _ItemID = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int? FormatID { get; set; }
|
||||||
|
public int? NewFormatID { get; set; }
|
||||||
|
public int ItemID { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataPortal_Fetch(ClearOverrideFormatsByItemCriteria criteria)
|
private void DataPortal_Fetch(ClearOverrideFormatsByItemCriteria criteria)
|
||||||
@@ -1891,7 +1667,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -1975,7 +1751,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -2005,7 +1781,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -2069,7 +1845,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -2146,7 +1922,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
@@ -2222,7 +1998,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
ContentInfo contentInfo = new ContentInfo(dr);
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
this.Add(contentInfo);
|
Add(contentInfo);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,6 @@ using System.IO;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
//using VEPROMS.Properties;
|
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@@ -26,8 +25,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public static DocVersion GetFromDB(int versionID) // get data from database (don't look in cache first)
|
public static DocVersion GetFromDB(int versionID) // get data from database (don't look in cache first)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to view a DocVersion");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DocVersion tmp = DataPortal.Fetch<DocVersion>(new PKCriteria(versionID));
|
DocVersion tmp = DataPortal.Fetch<DocVersion>(new PKCriteria(versionID));
|
||||||
@@ -146,10 +143,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _DocVersionConfig;
|
return _DocVersionConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void _DocVersionConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
private void _DocVersionConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) => Config = _DocVersionConfig.ToString();
|
||||||
{
|
|
||||||
Config = _DocVersionConfig.ToString();
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region UserSettings
|
#region UserSettings
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -182,49 +176,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
rtnstr += Title;
|
rtnstr += Title;
|
||||||
}
|
}
|
||||||
return rtnstr;
|
return rtnstr;
|
||||||
//return string.Format("{0} - {1}", Name, Title);
|
|
||||||
}
|
}
|
||||||
#region IVEDrillDown
|
#region IVEDrillDown
|
||||||
//public System.Collections.IList GetChildren()
|
public ConfigDynamicTypeDescriptor MyConfig => DocVersionConfig;
|
||||||
//{
|
|
||||||
// return null;
|
|
||||||
//}
|
|
||||||
//public bool HasChildren
|
|
||||||
//{
|
|
||||||
// get { return _ItemID > 0; }
|
|
||||||
//}
|
|
||||||
//public IVEDrillDown ActiveParent
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// return MyFolder;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//private Format _ActiveFormat = null;
|
|
||||||
//public Format ActiveFormat
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// if (_ActiveFormat == null)
|
|
||||||
// _ActiveFormat = LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat;
|
|
||||||
// return _ActiveFormat;
|
|
||||||
// }
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// _ActiveFormat = null;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//public Format LocalFormat
|
|
||||||
//{
|
|
||||||
// get { return MyFormat; }
|
|
||||||
//}
|
|
||||||
public ConfigDynamicTypeDescriptor MyConfig
|
|
||||||
{
|
|
||||||
get { return DocVersionConfig; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
public DocVersionInfo MyDocVersionInfo
|
public DocVersionInfo MyDocVersionInfo => DocVersionInfo.Get(VersionID);
|
||||||
{ get { return DocVersionInfo.Get(VersionID); } }
|
|
||||||
}
|
}
|
||||||
public partial class DocVersionInfo : IVEDrillDownReadOnly
|
public partial class DocVersionInfo : IVEDrillDownReadOnly
|
||||||
{
|
{
|
||||||
@@ -251,6 +207,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
// The following dictionary is used to store the state of the ro.fst check so that it is
|
// The following dictionary is used to store the state of the ro.fst check so that it is
|
||||||
// not made repeatedly in NewerRoFst. (B2017-050)
|
// not made repeatedly in NewerRoFst. (B2017-050)
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static Dictionary<string, bool> NewerRoFstLookup = new Dictionary<string, bool>();
|
private static Dictionary<string, bool> NewerRoFstLookup = new Dictionary<string, bool>();
|
||||||
private static bool AddToRoFstLookup(string key, bool result)
|
private static bool AddToRoFstLookup(string key, bool result)
|
||||||
{
|
{
|
||||||
@@ -267,7 +224,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID);
|
RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID);
|
||||||
string rofstPath = rdi.FolderPath + @"\ro.fst";
|
string rofstPath = rdi.FolderPath + @"\ro.fst";
|
||||||
|
|
||||||
//if (!File.Exists(rofstPath)) return false;
|
|
||||||
if (!pathExists(rofstPath))
|
if (!pathExists(rofstPath))
|
||||||
{
|
{
|
||||||
_MyLog.WarnFormat("RO Path '{0}' could not be found", rofstPath);
|
_MyLog.WarnFormat("RO Path '{0}' could not be found", rofstPath);
|
||||||
@@ -369,10 +325,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _SearchDVPath;
|
return _SearchDVPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string SearchPath { get { return ""; } }
|
public string SearchPath => "";
|
||||||
|
|
||||||
// B2021-076: Proms search results are not presented in order when printed to PDF
|
// B2021-076: Proms search results are not presented in order when printed to PDF
|
||||||
public string SearchDefaultSort { get { return string.Empty; } }
|
public string SearchDefaultSort => string.Empty;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region UnlinkEnhancedDocVersion
|
#region UnlinkEnhancedDocVersion
|
||||||
@@ -420,20 +376,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region DocVersion Config
|
#region DocVersion Config
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private DocVersionConfig _DocVersionConfig;
|
private DocVersionConfig _DocVersionConfig;
|
||||||
public DocVersionConfig DocVersionConfig
|
public DocVersionConfig DocVersionConfig => _DocVersionConfig ?? (_DocVersionConfig = new DocVersionConfig(this));
|
||||||
{ get { return (_DocVersionConfig != null ? _DocVersionConfig : _DocVersionConfig = new DocVersionConfig(this)); } }
|
private void DocVersionConfigRefresh() => _DocVersionConfig = null;
|
||||||
private void DocVersionConfigRefresh()
|
|
||||||
{
|
|
||||||
_DocVersionConfig = null;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region MOVE TO DOCVERSION CONFIG
|
#region MOVE TO DOCVERSION CONFIG
|
||||||
|
|
||||||
private string GetProfile(string grp, string nam)
|
private string GetProfile(string grp, string nam) => GetProfile(grp, nam, false);
|
||||||
{
|
|
||||||
return GetProfile(grp, nam, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetProfile(string grp, string nam, bool flag)
|
private string GetProfile(string grp, string nam, bool flag)
|
||||||
{
|
{
|
||||||
@@ -454,11 +403,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
// B2021-066: Procedure PC/PC resolve procedure number with Unit Specific info
|
// B2021-066: Procedure PC/PC resolve procedure number with Unit Specific info
|
||||||
public string UnitSpecific(string str, int len, ItemInfo ii)
|
public string UnitSpecific(ItemInfo ii)
|
||||||
{
|
{
|
||||||
ProcedureInfo pi = ii as ProcedureInfo;
|
if (!(ii is ProcedureInfo pi)) // B2022-004: Don't crash if Proc PC/PC (ii is from a list, so wasn't an ItemInfo)
|
||||||
|
|
||||||
if (pi == null) // B2022-004: Don't crash if Proc PC/PC (ii is from a list, so wasn't an ItemInfo)
|
|
||||||
{
|
{
|
||||||
pi = ProcedureInfo.Get(ii.ItemID);
|
pi = ProcedureInfo.Get(ii.ItemID);
|
||||||
}
|
}
|
||||||
@@ -478,8 +425,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
string unitdes = "ID";
|
string unitdes = "ID";
|
||||||
string prefix = null;
|
string prefix = null;
|
||||||
string fromunitdes = null;
|
string str = ItemInfo.ConvertToDisplayText(pi.MyContent.Number);
|
||||||
str = ItemInfo.ConvertToDisplayText(pi.MyContent.Number);
|
|
||||||
bool hastoken = false;
|
bool hastoken = false;
|
||||||
|
|
||||||
// Determine if there is a token in the procedure number data, default is ID
|
// Determine if there is a token in the procedure number data, default is ID
|
||||||
@@ -503,6 +449,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string fromunitdes;
|
||||||
if (unitdes == "NUMBER")
|
if (unitdes == "NUMBER")
|
||||||
fromunitdes = DocVersionConfig.Unit_Number;
|
fromunitdes = DocVersionConfig.Unit_Number;
|
||||||
else if (unitdes == "ID")
|
else if (unitdes == "ID")
|
||||||
@@ -569,16 +516,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else
|
else
|
||||||
if (procAppl) prefs.Add(tokRepAndPrefix);
|
if (procAppl) prefs.Add(tokRepAndPrefix);
|
||||||
}
|
}
|
||||||
if (procAppl && tokRepAndPrefix != "") prefix = prefix + (prefix == null ? tokRepAndPrefix : (prefix != null && prefix.Length > 0 && prefix[prefix.Length - 1] != ',' ? "," : "") + tokRepAndPrefix);
|
if (procAppl && tokRepAndPrefix != "") prefix += (prefix == null ? tokRepAndPrefix : (prefix != null && prefix.Length > 0 && prefix[prefix.Length - 1] != ',' ? "," : "") + tokRepAndPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
str = Regex.Replace(str, @"\<[uU]-[a-zA-Z]+\>", "");
|
str = Regex.Replace(str, @"\<[uU]-[a-zA-Z]+\>", "");
|
||||||
str = Regex.Replace(str, @"\<[uU]\>", "");
|
str = Regex.Replace(str, @"\<[uU]\>", "");
|
||||||
|
|
||||||
return (!sometext) ? str: "[" + prefix + "]" + str;
|
return (!sometext) ? str: $"[{prefix}]{str}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public string UnitSpecific(string str, int len)
|
public string UnitSpecific(string str)
|
||||||
{
|
{
|
||||||
|
|
||||||
// This routine retrieves the procedure number format from the
|
// This routine retrieves the procedure number format from the
|
||||||
@@ -587,20 +534,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string retvalu = "";
|
string retvalu = "";
|
||||||
string asis = "#";
|
string asis = "#";
|
||||||
if (str == null || str.Equals(string.Empty)) return retvalu; // return a null (empty) string
|
if (str == null || str.Equals(string.Empty)) return retvalu; // return a null (empty) string
|
||||||
/*
|
|
||||||
* Bug fix: B2005-017 3/2/2005
|
|
||||||
* Need to use the largest procedure number length that's in the
|
|
||||||
* SET.DFF file. "LargestNumber" is the largest length after the
|
|
||||||
* procedure number is replaced via the SET.INI file "replace" list.
|
|
||||||
*
|
|
||||||
if(len==0)len=LargestNumber;
|
|
||||||
*/
|
|
||||||
// TODO: Do we need this line?-->>> if(len==0)len=LargestRawSetNumber;
|
|
||||||
|
|
||||||
//GetPrivateProfileString("unit", "procedure number", asis, mstr, MAXPATH, "proc.ini");
|
|
||||||
string pnum = asis;
|
string pnum = asis;
|
||||||
//rhm/jcb stuff 20120511
|
|
||||||
//string mstr = GetProfile("Unit", "ProcedureNumber", true);
|
|
||||||
string mstr = DocVersionConfig.Unit_ProcedureNumber;
|
string mstr = DocVersionConfig.Unit_ProcedureNumber;
|
||||||
if (mstr != null && !mstr.Equals(string.Empty))
|
if (mstr != null && !mstr.Equals(string.Empty))
|
||||||
pnum = mstr;
|
pnum = mstr;
|
||||||
@@ -684,11 +619,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
case 'P':
|
case 'P':
|
||||||
//TODO: THIS IS A GLOBAL IN THE 16 BIT CODE!!!!
|
//TODO: THIS IS A GLOBAL IN THE 16 BIT CODE!!!!
|
||||||
string procnumber = "";
|
string procnumber = "";
|
||||||
pn = UnitSpecific(procnumber, 0);
|
pn = UnitSpecific(procnumber);
|
||||||
retval = GetProfile(pn, substr, true);
|
retval = GetProfile(pn, substr, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (retval == null) // .Equals(string.Empty))
|
if (retval == null)
|
||||||
swptr++;
|
swptr++;
|
||||||
}
|
}
|
||||||
str += sav;
|
str += sav;
|
||||||
@@ -752,12 +687,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
ItemInfoList _Procedures = null;
|
ItemInfoList _Procedures = null;
|
||||||
public ItemInfoList Procedures
|
public ItemInfoList Procedures => _Procedures ?? (_Procedures = ItemInfoList.GetList(_ItemID, (int)E_FromType.Procedure));
|
||||||
{ get { return (_Procedures != null ? _Procedures : _Procedures = ItemInfoList.GetList(_ItemID, (int)E_FromType.Procedure)); } }
|
public void ResetProcedures() => _Procedures = null;
|
||||||
public void ResetProcedures()
|
|
||||||
{
|
|
||||||
_Procedures = null;
|
|
||||||
}
|
|
||||||
public static void ResetProcedures(int versionID)
|
public static void ResetProcedures(int versionID)
|
||||||
{
|
{
|
||||||
string key = versionID.ToString();
|
string key = versionID.ToString();
|
||||||
@@ -779,29 +710,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
dvi.ResetProcedures();
|
dvi.ResetProcedures();
|
||||||
}
|
}
|
||||||
#region IVEReadOnlyItem
|
#region IVEReadOnlyItem
|
||||||
public System.Collections.IList GetChildren()
|
public System.Collections.IList GetChildren() => Procedures;
|
||||||
{
|
public bool HasChildren => _ItemID > 0;
|
||||||
return Procedures;
|
public IVEDrillDownReadOnly ActiveParent => MyFolder;
|
||||||
}
|
public FormatInfo ActiveFormat => LocalFormat ?? ActiveParent.ActiveFormat;
|
||||||
//public bool ChildrenAreLoaded
|
|
||||||
//{
|
|
||||||
// get { return _iil == null; }
|
|
||||||
//}
|
|
||||||
public bool HasChildren
|
|
||||||
{
|
|
||||||
get { return _ItemID > 0; }
|
|
||||||
}
|
|
||||||
public IVEDrillDownReadOnly ActiveParent
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return MyFolder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public FormatInfo ActiveFormat
|
|
||||||
{
|
|
||||||
get { return LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat; }
|
|
||||||
}
|
|
||||||
public FormatInfo LocalFormat
|
public FormatInfo LocalFormat
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -810,16 +722,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return MyFormat;
|
return MyFormat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public ConfigDynamicTypeDescriptor MyConfig
|
public ConfigDynamicTypeDescriptor MyConfig => DocVersionConfig;
|
||||||
{
|
|
||||||
get { return DocVersionConfig; }
|
|
||||||
}
|
|
||||||
//public bool HasStandardSteps()
|
|
||||||
//{ return false; }
|
|
||||||
#region PasteChild
|
#region PasteChild
|
||||||
public ItemInfo PasteChild(int copyStartID) // pastes into an 'empty' docversion
|
public ItemInfo PasteChild(int copyStartID) // pastes into an 'empty' docversion
|
||||||
{
|
{
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - Kept for Side Effect and Debugging
|
||||||
ItemInfo cpItem = ItemInfo.Get(copyStartID);
|
ItemInfo cpItem = ItemInfo.Get(copyStartID);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DocVersionInfo dvi = DataPortal.Fetch<DocVersionInfo>(new VersionPastingPartCriteria(VersionID, copyStartID, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
DocVersionInfo dvi = DataPortal.Fetch<DocVersionInfo>(new VersionPastingPartCriteria(VersionID, copyStartID, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||||
@@ -831,7 +740,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("Details were written to the Error Log.", "Paste Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
|
System.Windows.Forms.MessageBox.Show("Details were written to the Error Log.", "Paste Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
|
||||||
return null;
|
return null;
|
||||||
@@ -869,20 +778,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
rtnstr += Title;
|
rtnstr += Title;
|
||||||
}
|
}
|
||||||
return rtnstr;
|
return rtnstr;
|
||||||
//return string.Format("{0} - {1}", Name, Title);
|
|
||||||
}
|
|
||||||
//public string ToString(string str,System.IFormatProvider ifp)
|
|
||||||
//{
|
|
||||||
// return ToString();
|
|
||||||
//}
|
|
||||||
public ItemInfo LastChild()
|
|
||||||
{
|
|
||||||
return MyItem.LastSibling;
|
|
||||||
}
|
|
||||||
public ItemInfo FirstChild()
|
|
||||||
{
|
|
||||||
return MyItem;
|
|
||||||
}
|
}
|
||||||
|
public ItemInfo LastChild() => MyItem.LastSibling;
|
||||||
|
public ItemInfo FirstChild() => MyItem;
|
||||||
#endregion
|
#endregion
|
||||||
#region DataPortal
|
#region DataPortal
|
||||||
private void DataPortal_Fetch(VersionPastingPartCriteria criteria)
|
private void DataPortal_Fetch(VersionPastingPartCriteria criteria)
|
||||||
@@ -900,8 +798,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@StartItemID", criteria.StartItemID);
|
cm.Parameters.AddWithValue("@StartItemID", criteria.StartItemID);
|
||||||
cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC
|
cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC
|
||||||
cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC
|
cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC
|
||||||
SqlParameter param_ContentID = new SqlParameter("@ThisVersionID", SqlDbType.Int);
|
SqlParameter param_ContentID = new SqlParameter("@ThisVersionID", SqlDbType.Int)
|
||||||
param_ContentID.Direction = ParameterDirection.Output;
|
{
|
||||||
|
Direction = ParameterDirection.Output
|
||||||
|
};
|
||||||
cm.Parameters.Add(param_ContentID);
|
cm.Parameters.Add(param_ContentID);
|
||||||
cm.CommandText = "PasteDocVersionChild";
|
cm.CommandText = "PasteDocVersionChild";
|
||||||
cm.CommandTimeout = Database.DefaultTimeout;
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
@@ -934,10 +834,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Extension
|
#region Extension
|
||||||
partial class DocVersionInfoExtension : extensionBase
|
partial class DocVersionInfoExtension : extensionBase
|
||||||
{
|
{
|
||||||
public override void Refresh(DocVersionInfo tmp)
|
public override void Refresh(DocVersionInfo tmp) => tmp.DocVersionConfigRefresh();
|
||||||
{
|
|
||||||
tmp.DocVersionConfigRefresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -967,6 +864,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
rodbid, DocVersionAssociations.Count, VersionID, MyFolder.Name);
|
rodbid, DocVersionAssociations.Count, VersionID, MyFolder.Name);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static List<int> _HasBadRODBIDProblem = new List<int>();
|
private static List<int> _HasBadRODBIDProblem = new List<int>();
|
||||||
private bool FirstBadRODBIDProblemDetected
|
private bool FirstBadRODBIDProblemDetected
|
||||||
{
|
{
|
||||||
@@ -977,48 +875,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool IsFolder
|
public bool IsFolder => false;
|
||||||
{
|
public bool IsDocVersion => true;
|
||||||
get
|
public bool IsProcedure => false;
|
||||||
{
|
public bool IsSection => false;
|
||||||
return false;
|
public bool IsStep => false;
|
||||||
}
|
public int MultiUnitCount => DocVersionConfig.Unit_Count;
|
||||||
}
|
|
||||||
public bool IsDocVersion
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsProcedure
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsSection
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsStep
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int MultiUnitCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return DocVersionConfig.Unit_Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private string[] _UnitNames;
|
private string[] _UnitNames;
|
||||||
public string[] UnitNames
|
public string[] UnitNames
|
||||||
{
|
{
|
||||||
@@ -1138,6 +1000,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public DocVersionNonEnhancedListCriteria() { ;}
|
public DocVersionNonEnhancedListCriteria() { ;}
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping until replace CSLA")]
|
||||||
private void DataPortal_Fetch(DocVersionNonEnhancedListCriteria criteria)
|
private void DataPortal_Fetch(DocVersionNonEnhancedListCriteria criteria)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
this.RaiseListChangedEvents = false;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using Csla;
|
|||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
//-----------------
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using LBWordLibrary;
|
using LBWordLibrary;
|
||||||
@@ -14,7 +13,6 @@ using System.Drawing.Imaging;
|
|||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
@@ -28,14 +26,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public delegate void VolianStatusChange(VolianStatusType type, int count, string text);
|
public delegate void VolianStatusChange(VolianStatusType type, int count, string text);
|
||||||
public partial class Document
|
public partial class Document
|
||||||
{
|
{
|
||||||
public string DocumentTitle
|
public string DocumentTitle => _LibTitle == string.Empty ? $"Document {_DocID}" : _LibTitle;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_LibTitle == string.Empty) return string.Format("Document {0}", _DocID);
|
|
||||||
return _LibTitle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private static LBApplicationClass _MyApp = null;
|
private static LBApplicationClass _MyApp = null;
|
||||||
public static LBApplicationClass MyApp
|
public static LBApplicationClass MyApp
|
||||||
{
|
{
|
||||||
@@ -84,11 +75,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public void StatusChanged(VolianStatusType type, int count, string text)
|
public void StatusChanged(VolianStatusType type, int count, string text)
|
||||||
{
|
{
|
||||||
//if (Parent != null && Parent.Parent != null && Parent.Parent.Parent is DisplayTabControl)
|
//Do nothing
|
||||||
//{
|
|
||||||
// DisplayTabControl tc = Parent.Parent.Parent as DisplayTabControl;
|
|
||||||
// tc.ONStatusChanged(this, new DisplayTabControlStatusEventArgs(type, count, text));
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RestoreWordDoc(ItemInfo myItemInfo)
|
public void RestoreWordDoc(ItemInfo myItemInfo)
|
||||||
@@ -117,9 +104,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
myDoc.Close();
|
myDoc.Close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
if (myDoc != null) myDoc.Close();
|
myDoc?.Close();
|
||||||
continue; // get next document audit item.
|
continue; // get next document audit item.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,8 +132,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
pdfFile.Delete();
|
pdfFile.Delete();
|
||||||
Pdf.DeleteAll(DocID); // clear the PDF table for DocID first
|
Pdf.DeleteAll(DocID); // clear the PDF table for DocID first
|
||||||
DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle;
|
DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle;
|
||||||
SectionConfig sc = myItemInfo.ActiveSection.MyConfig as SectionConfig;
|
if (myItemInfo.ActiveSection.MyConfig is SectionConfig sc && sc.Section_WordMargin == "Y")
|
||||||
if (sc != null && sc.Section_WordMargin == "Y")
|
|
||||||
{
|
{
|
||||||
using (Pdf myPdf = Pdf.MakePdf(this, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)myItemInfo.MSWordPageCount, buf)) {; }
|
using (Pdf myPdf = Pdf.MakePdf(this, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)myItemInfo.MSWordPageCount, buf)) {; }
|
||||||
}
|
}
|
||||||
@@ -169,16 +155,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public static void ConvertWordSectionToDOCX(ItemInfo itmInfo)
|
public static void ConvertWordSectionToDOCX(ItemInfo itmInfo)
|
||||||
{
|
{
|
||||||
FrmPopupStatusMessage pmsg = null;
|
FrmPopupStatusMessage pmsg = null;
|
||||||
DSOFile myfile = null;
|
|
||||||
LBWordLibrary.LBApplicationClass ap = null;
|
LBWordLibrary.LBApplicationClass ap = null;
|
||||||
LBWordLibrary.LBDocumentClass doc = null;
|
LBWordLibrary.LBDocumentClass doc = null;
|
||||||
string orgFilename = null;
|
|
||||||
string filename = null;
|
|
||||||
FileInfo fi = null;
|
FileInfo fi = null;
|
||||||
FileStream fs = null;
|
FileStream fs = null;
|
||||||
SectionInfo msi = null;
|
|
||||||
Section sec = null;
|
|
||||||
SectionConfig cfg = null;
|
|
||||||
DocumentInfo docInfo = null;
|
DocumentInfo docInfo = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -195,7 +175,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
pmsg.Show();
|
pmsg.Show();
|
||||||
|
|
||||||
// Get Document as file - it's placed in the user's temporary folder (like we do when we edit a Word section)
|
// Get Document as file - it's placed in the user's temporary folder (like we do when we edit a Word section)
|
||||||
myfile = new DSOFile(docInfo);
|
DSOFile myfile = new DSOFile(docInfo);
|
||||||
|
|
||||||
// Open MSWord App
|
// Open MSWord App
|
||||||
ap = new LBWordLibrary.LBApplicationClass();
|
ap = new LBWordLibrary.LBApplicationClass();
|
||||||
@@ -204,11 +184,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// Older versions of PROMS saved the Word section as either a RTF or the old-style Word DOC file
|
// Older versions of PROMS saved the Word section as either a RTF or the old-style Word DOC file
|
||||||
// In either case, we want to convert it to a Word DOCX file
|
// In either case, we want to convert it to a Word DOCX file
|
||||||
// So now create a file name with the .DOCX extension
|
// So now create a file name with the .DOCX extension
|
||||||
orgFilename = myfile.FullName.ToUpper();
|
string orgFilename = myfile.FullName.ToUpper();
|
||||||
filename = orgFilename.Replace(".RTF", ".DOCX").Replace(".DOC", ".DOCX"); // we want to convert either .RTF or .DOC Word sections
|
string filename = orgFilename.Replace(".RTF", ".DOCX").Replace(".DOC", ".DOCX");
|
||||||
|
|
||||||
// This calls Word's convert function to convert the opened .DOC or .RTF to DOCX and save it to our new DOCX file name
|
// This calls Word's convert function to convert the opened .DOC or .RTF to DOCX and save it to our new DOCX file name
|
||||||
doc.SaveAs(filename, LBWordLibrary.LBWdSaveFormat.wdFormatXMLDocument); // Convert to Word DOCX
|
doc.SaveAs(filename, LBWdSaveFormat.wdFormatXMLDocument); // Convert to Word DOCX
|
||||||
doc.Close();
|
doc.Close();
|
||||||
doc = null;
|
doc = null;
|
||||||
|
|
||||||
@@ -222,14 +202,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
bool isLibraryDocument = (docInfo.LibTitle != null && docInfo.LibTitle != "");
|
bool isLibraryDocument = (docInfo.LibTitle != null && docInfo.LibTitle != "");
|
||||||
Document myDoc = null;
|
Document myDoc = null;
|
||||||
if (isLibraryDocument)
|
if (isLibraryDocument)
|
||||||
myDoc = Document.Get(docInfo.DocID);
|
myDoc = Get(docInfo.DocID);
|
||||||
else
|
else
|
||||||
myDoc = Document.MakeDocument(null, ByteArray, docInfo.DocAscii, docInfo.Config, ".DOCX");
|
myDoc = MakeDocument(null, ByteArray, docInfo.DocAscii, docInfo.Config, ".DOCX");
|
||||||
|
|
||||||
// update the document information in the database
|
// update the document information in the database
|
||||||
msi = itmInfo as SectionInfo;
|
SectionInfo msi = itmInfo as SectionInfo;
|
||||||
sec = msi.Get();
|
Section sec = msi.Get();
|
||||||
cfg = sec.SectionConfig;
|
SectionConfig cfg = sec.SectionConfig;
|
||||||
if (!isLibraryDocument)
|
if (!isLibraryDocument)
|
||||||
cfg.MySection.MyContent.MyEntry.MyDocument = myDoc; // resetting MyDocument will clear the library doc link - so don't do if a library document
|
cfg.MySection.MyContent.MyEntry.MyDocument = myDoc; // resetting MyDocument will clear the library doc link - so don't do if a library document
|
||||||
else
|
else
|
||||||
@@ -257,36 +237,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (pmsg != null)
|
pmsg?.Close();// close the statue message
|
||||||
pmsg.Close();// close the statue message
|
ap?.Quit(); // close the Word app
|
||||||
if (ap != null)
|
doc?.Close();
|
||||||
ap.Quit(); // close the Word app
|
fs?.Close();
|
||||||
if (doc != null)
|
|
||||||
doc.Close();
|
|
||||||
if (fs != null)
|
|
||||||
fs.Close();
|
|
||||||
if (fi != null && fi.Exists)
|
if (fi != null && fi.Exists)
|
||||||
fi.Delete();// delete the temporary .DOCX file
|
fi.Delete();// delete the temporary .DOCX file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// FixString processes the string returned and changes any symbols (0xF0??) to normal characters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="str"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
//private static string FixString(string str)
|
|
||||||
//{
|
|
||||||
// StringBuilder results = new StringBuilder();
|
|
||||||
// foreach (char c in str)
|
|
||||||
// {
|
|
||||||
// if ((c & 0xFF00) == 0xF000)
|
|
||||||
// results.Append((char)(c & 0xFF));
|
|
||||||
// else
|
|
||||||
// results.Append((char)(c));
|
|
||||||
// }
|
|
||||||
// return results.ToString();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
public partial class DocumentInfo
|
public partial class DocumentInfo
|
||||||
{
|
{
|
||||||
@@ -297,14 +255,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _ContentIsDirty; }
|
get { return _ContentIsDirty; }
|
||||||
set { _ContentIsDirty = value; }
|
set { _ContentIsDirty = value; }
|
||||||
}
|
}
|
||||||
public string DocumentTitle
|
public string DocumentTitle => _LibTitle == string.Empty ? $"Document {_DocID}" : _LibTitle;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_LibTitle == string.Empty) return string.Format("Document {0}", _DocID);
|
|
||||||
return _LibTitle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string LibraryDocumentUsage
|
public string LibraryDocumentUsage
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -323,11 +274,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
--limit;
|
--limit;
|
||||||
if (limit < 0)
|
if (limit < 0)
|
||||||
{
|
{
|
||||||
sb.Append(sep + "...");
|
sb.Append($"{sep}...");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
ItemInfo proc = myItem.MyProcedure;
|
ItemInfo proc = myItem.MyProcedure;
|
||||||
sb.Append(sep + proc.DisplayNumber + " - " + proc.DisplayText);
|
sb.Append($"{sep}{proc.DisplayNumber} - {proc.DisplayText}");
|
||||||
sep = "\r\n ";
|
sep = "\r\n ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -351,7 +302,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
foreach (ItemInfo myItem in myEntry.MyContent.ContentItems)
|
foreach (ItemInfo myItem in myEntry.MyContent.ContentItems)
|
||||||
{
|
{
|
||||||
ItemInfo proc = myItem.MyProcedure;
|
ItemInfo proc = myItem.MyProcedure;
|
||||||
sb.Append(sep + proc.DisplayNumber + " - " + proc.DisplayText);
|
sb.Append($"{sep}{proc.DisplayNumber} - {proc.DisplayText}");
|
||||||
sep = "\r\n ";
|
sep = "\r\n ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -385,12 +336,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region DocumentConfig
|
#region DocumentConfig
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private DocumentConfig _DocumentConfig;
|
private DocumentConfig _DocumentConfig;
|
||||||
public DocumentConfig DocumentConfig
|
public DocumentConfig DocumentConfig => _DocumentConfig ?? (_DocumentConfig = new DocumentConfig(this));
|
||||||
{ get { return (_DocumentConfig != null ? _DocumentConfig : _DocumentConfig = new DocumentConfig(this)); } }
|
public void RefreshConfig() => _DocumentConfig = null;
|
||||||
public void RefreshConfig()
|
|
||||||
{
|
|
||||||
_DocumentConfig = null;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
public static DocumentInfo GetByLibDocName(string libdoc, int versionID)
|
public static DocumentInfo GetByLibDocName(string libdoc, int versionID)
|
||||||
{
|
{
|
||||||
@@ -407,12 +354,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class LibDocCriteria
|
protected class LibDocCriteria
|
||||||
{
|
{
|
||||||
private string _LibDoc;
|
private readonly string _LibDoc;
|
||||||
public string LibDoc
|
public string LibDoc => _LibDoc;
|
||||||
{ get { return _LibDoc; } }
|
private readonly int _VersionID;
|
||||||
private int _VersionID;
|
public int VersionID => _VersionID;
|
||||||
public int VersionID
|
|
||||||
{ get { return _VersionID; } }
|
|
||||||
public LibDocCriteria(string libdoc, int versionid)
|
public LibDocCriteria(string libdoc, int versionid)
|
||||||
{
|
{
|
||||||
_LibDoc = libdoc;
|
_LibDoc = libdoc;
|
||||||
@@ -482,11 +427,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _IsLibrary; }
|
get { return _IsLibrary; }
|
||||||
set { _IsLibrary = value; }
|
set { _IsLibrary = value; }
|
||||||
}
|
}
|
||||||
public LibraryCriteria(bool islibrary)
|
public LibraryCriteria(bool islibrary) => _IsLibrary = islibrary;
|
||||||
{
|
|
||||||
_IsLibrary = islibrary;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping until CSLA replaced")]
|
||||||
private void DataPortal_Fetch(LibraryCriteria criteria)
|
private void DataPortal_Fetch(LibraryCriteria criteria)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
this.RaiseListChangedEvents = false;
|
||||||
@@ -525,7 +468,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private bool _IsDisposed;
|
private bool _IsDisposed;
|
||||||
private DocumentInfo _MyDocument = null;
|
private DocumentInfo _MyDocument = null;
|
||||||
private FileInfo _MyFile = null;
|
private FileInfo _MyFile = null;
|
||||||
private string _Extension = "DOC";
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
@@ -534,47 +476,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _MyDocument; }
|
get { return _MyDocument; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
// B2017-249 Don't delete last DSOFile
|
|
||||||
//TryDelete();
|
|
||||||
_MyDocument = value;
|
_MyDocument = value;
|
||||||
CreateFile();
|
CreateFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public FileInfo MyFile
|
public FileInfo MyFile => _MyFile;
|
||||||
{
|
public string Extension { get; set; } = "DOC";
|
||||||
get { return _MyFile; }
|
|
||||||
}
|
|
||||||
public string Extension
|
|
||||||
{
|
|
||||||
get { return _Extension; }
|
|
||||||
set { _Extension = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
private void TryDelete()
|
|
||||||
{
|
|
||||||
if (_MyDocument == null) return;
|
|
||||||
if (_MyFile == null) return;
|
|
||||||
// B2017-249 Recover Temporary File And AutoSave support for MSWord
|
|
||||||
_MyFile.Refresh();
|
|
||||||
if (_MyFile.Exists && (TimeSpan.FromTicks(_MyDocument.DTS.Ticks - _MyFile.LastWriteTimeUtc.Ticks).TotalSeconds > 1.0))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_MyFile.Delete();
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
// _MyLog.Error("TryDelete", ex);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_MyFile = null;
|
|
||||||
_MyDocument = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private bool _Created = false;
|
private bool _Created = false;
|
||||||
private int _Unique = 0;
|
private int _Unique = 0;
|
||||||
private string Unique
|
private string Unique
|
||||||
@@ -582,7 +492,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
string retval = string.Empty;
|
string retval = string.Empty;
|
||||||
if (_Unique != 0) retval = "_" + _Unique.ToString();
|
if (_Unique != 0) retval = $"_{_Unique}";
|
||||||
_Unique++;
|
_Unique++;
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@@ -601,19 +511,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _MyFile.Exists && (_MyFile.LastWriteTimeUtc > StartDTS);
|
return _MyFile.Exists && (_MyFile.LastWriteTimeUtc > StartDTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private DateTime _StartDTS;
|
|
||||||
public DateTime StartDTS
|
public DateTime StartDTS { get; set; }
|
||||||
{
|
public static string TempFilePrefix { get; set; } = string.Empty;
|
||||||
get { return _StartDTS; }
|
|
||||||
set { _StartDTS = value; }
|
|
||||||
}
|
|
||||||
//B2017-260 Prefix the Temporary document file with server name and database name
|
|
||||||
private static string _TempFilePrefix = string.Empty;
|
|
||||||
public static string TempFilePrefix
|
|
||||||
{
|
|
||||||
get { return DSOFile._TempFilePrefix; }
|
|
||||||
set { DSOFile._TempFilePrefix = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CreateTemporaryFile()
|
private void CreateTemporaryFile()
|
||||||
{
|
{
|
||||||
@@ -692,7 +592,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveFile(float length, string ascii, ItemInfo myItemInfo, bool cvtLibDoc, VolianStatusChange statusChange)
|
public void SaveFile(string ascii, ItemInfo myItemInfo, bool cvtLibDoc, VolianStatusChange statusChange)
|
||||||
{
|
{
|
||||||
// TODO: Add Try & Catch logic
|
// TODO: Add Try & Catch logic
|
||||||
if (_MyDocument == null) return;
|
if (_MyDocument == null) return;
|
||||||
@@ -734,15 +634,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
doc.FileExtension = MyFile.Extension;
|
doc.FileExtension = MyFile.Extension;
|
||||||
doc.DocContent = buf;
|
doc.DocContent = buf;
|
||||||
doc.DocAscii = ascii;
|
doc.DocAscii = ascii;
|
||||||
//doc.UpdateDocAscii(_MyFile.FullName);
|
|
||||||
|
|
||||||
DocumentConfig cfg = new DocumentConfig(doc);
|
DocumentConfig cfg = new DocumentConfig(doc)
|
||||||
cfg.Edit_Initialized = true;
|
{
|
||||||
|
Edit_Initialized = true
|
||||||
|
};
|
||||||
doc.Config = cfg.ToString();
|
doc.Config = cfg.ToString();
|
||||||
doc.UserID = Volian.Base.Library.VlnSettings.UserID;
|
doc.UserID = VlnSettings.UserID;
|
||||||
// B2017-262 use the date time stamp from the file rather than the clock
|
// B2017-262 use the date time stamp from the file rather than the clock
|
||||||
doc.DTS = _MyFile.LastWriteTimeUtc;
|
doc.DTS = _MyFile.LastWriteTimeUtc;
|
||||||
//doc.DTS = DateTime.Now.ToUniversalTime();
|
|
||||||
doc = doc.Save();
|
doc = doc.Save();
|
||||||
|
|
||||||
if (myItemInfo != null) // B2016-131 if myItemInfo is null, the lib doc is not referenced from any procedure. Just save changes, but don't generate a PDF
|
if (myItemInfo != null) // B2016-131 if myItemInfo is null, the lib doc is not referenced from any procedure. Just save changes, but don't generate a PDF
|
||||||
@@ -760,9 +660,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
Pdf.DeleteAll(doc.DocID); // clear the PDF table for DocID first
|
Pdf.DeleteAll(doc.DocID); // clear the PDF table for DocID first
|
||||||
|
|
||||||
DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle;
|
DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle;
|
||||||
SectionConfig sc = myItemInfo.ActiveSection.MyConfig as SectionConfig;
|
|
||||||
|
|
||||||
if (sc != null && sc.Section_WordMargin == "Y")
|
if (myItemInfo.ActiveSection.MyConfig is SectionConfig sc && sc.Section_WordMargin == "Y")
|
||||||
{
|
{
|
||||||
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)myItemInfo.MSWordPageCount, buf)) {; }
|
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)myItemInfo.MSWordPageCount, buf)) {; }
|
||||||
}
|
}
|
||||||
@@ -784,21 +683,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
// B2017-249 Recover Temporary File And AutoSave support for MSWord
|
// B2017-249 Recover Temporary File And AutoSave support for MSWord
|
||||||
private bool _Temporary = false;
|
public bool Temporary { get; set; } = false;
|
||||||
public bool Temporary
|
|
||||||
{
|
|
||||||
get { return _Temporary; }
|
|
||||||
set { _Temporary = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public DSOFile(DocumentInfo myDocument)
|
public DSOFile(DocumentInfo myDocument) => MyDocument = myDocument;
|
||||||
{
|
|
||||||
MyDocument = myDocument;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DSOFile(DocumentInfo myDocument, bool temporary)
|
public DSOFile(DocumentInfo myDocument, bool temporary)
|
||||||
{
|
{
|
||||||
@@ -821,13 +712,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping disposing to match old signature")]
|
||||||
protected void Dispose(bool disposing)
|
protected void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (!_IsDisposed)
|
if (!_IsDisposed)
|
||||||
{
|
{
|
||||||
_IsDisposed = true;
|
_IsDisposed = true;
|
||||||
// B2017-249 Don't Delete last DSOFile
|
|
||||||
//TryDelete();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,20 +745,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
// B2019-123 Verify that the RO token is the correct format
|
// B2019-123 Verify that the RO token is the correct format
|
||||||
private static Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]");
|
private static readonly Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]");
|
||||||
|
|
||||||
// used to save Word sections with resolved ROs (for export generated from Approve)
|
// used to save Word sections with resolved ROs (for export generated from Approve)
|
||||||
private static LBApplicationClass _MyApp = null;
|
private static LBApplicationClass _MyApp = null;
|
||||||
private static SectionInfo _MySection;
|
private static SectionInfo _MySection;
|
||||||
private static Dictionary<int, byte[]> _DocReplace;
|
|
||||||
private static bool _CloseWordWhenDone = true;
|
|
||||||
private static System.Drawing.Color _OverrideColor = System.Drawing.Color.Transparent;
|
|
||||||
private static System.Windows.Forms.Form _FormForPlotGraphics = null;
|
|
||||||
private static int _DebugStatus = 0;
|
|
||||||
|
|
||||||
// B2018-071 Save list of DocIDs for invalid document so that error log messages are not repeated
|
// B2018-071 Save list of DocIDs for invalid document so that error log messages are not repeated
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static List<int> _MissingDocs = new List<int>();
|
private static List<int> _MissingDocs = new List<int>();
|
||||||
private static bool _Automatic = false;
|
|
||||||
|
|
||||||
// B2022-083: Support Conditional RO Values --> Added an internal rochild dictionary cache specifically for printing
|
// B2022-083: Support Conditional RO Values --> Added an internal rochild dictionary cache specifically for printing
|
||||||
//
|
//
|
||||||
@@ -900,17 +785,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
public static Dictionary<int, byte[]> DocReplace
|
public static Dictionary<int, byte[]> DocReplace { get; set; }
|
||||||
{
|
|
||||||
get { return MSWordToPDF._DocReplace; }
|
|
||||||
set { MSWordToPDF._DocReplace = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool CloseWordWhenDone
|
public static bool CloseWordWhenDone { get; set; } = true;
|
||||||
{
|
|
||||||
get { return MSWordToPDF._CloseWordWhenDone; }
|
|
||||||
set { MSWordToPDF._CloseWordWhenDone = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static LBApplicationClass MyApp
|
public static LBApplicationClass MyApp
|
||||||
{
|
{
|
||||||
@@ -921,30 +798,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int DebugStatus
|
public static int DebugStatus { get; set; } = 0;
|
||||||
{
|
|
||||||
get { return MSWordToPDF._DebugStatus; }
|
|
||||||
set { MSWordToPDF._DebugStatus = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static System.Drawing.Color OverrideColor
|
public static System.Drawing.Color OverrideColor { get; set; } = Color.Transparent;
|
||||||
{
|
|
||||||
get { return MSWordToPDF._OverrideColor; }
|
|
||||||
set { MSWordToPDF._OverrideColor = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static System.Windows.Forms.Form FormForPlotGraphics
|
public static System.Windows.Forms.Form FormForPlotGraphics { get; set; } = null;
|
||||||
{
|
|
||||||
get { return MSWordToPDF._FormForPlotGraphics; }
|
|
||||||
set { MSWordToPDF._FormForPlotGraphics = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool Automatic
|
|
||||||
{
|
|
||||||
// C2018-035 Don't use a MessageBox if in automatic (Baseline) testing mode.
|
// C2018-035 Don't use a MessageBox if in automatic (Baseline) testing mode.
|
||||||
get { return MSWordToPDF._Automatic; }
|
public static bool Automatic { get; set; } = false;
|
||||||
set { MSWordToPDF._Automatic = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -954,8 +814,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
_MySection = sect;
|
_MySection = sect;
|
||||||
|
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - Keeping due to Side Effect Code
|
||||||
DocumentInfo mydoc = sect.MyContent.MyEntry.MyDocument;
|
DocumentInfo mydoc = sect.MyContent.MyEntry.MyDocument;
|
||||||
UpdateDocPdf(mydoc, overrideColor, sect);
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
UpdateDocPdf(overrideColor, sect);
|
||||||
|
|
||||||
string fileName = GetFileName(sect);
|
string fileName = GetFileName(sect);
|
||||||
FileInfo fi = new FileInfo(fileName);
|
FileInfo fi = new FileInfo(fileName);
|
||||||
@@ -967,17 +829,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool UpdateDocPdf(DocumentInfo mydoc, Color overrideColor, ItemInfo sect)
|
public static bool UpdateDocPdf(Color overrideColor, ItemInfo sect)
|
||||||
{
|
{
|
||||||
//B2019-144 Set the document text color to Red (overlay) or Black (normal)
|
//B2019-144 Set the document text color to Red (overlay) or Black (normal)
|
||||||
Color lastColor = MSWordToPDF.OverrideColor;// Remember last override color
|
Color lastColor = OverrideColor;// Remember last override color
|
||||||
if (MSWordToPDF.OverrideColor != overrideColor) MSWordToPDF.OverrideColor = overrideColor;
|
if (OverrideColor != overrideColor) OverrideColor = overrideColor;
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - keeping due to side effect code
|
||||||
PdfInfo myPdf = PdfInfo.Get(sect, DocReplace != null);
|
PdfInfo myPdf = PdfInfo.Get(sect, DocReplace != null);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
|
||||||
//B2019-144 Set the document text color to Red (overlay) or Black (normal)
|
//B2019-144 Set the document text color to Red (overlay) or Black (normal)
|
||||||
if (MSWordToPDF.OverrideColor != lastColor) MSWordToPDF.OverrideColor = lastColor; // Restore last override color
|
if (OverrideColor != lastColor) OverrideColor = lastColor; // Restore last override color
|
||||||
//MSWordToPDF.OverrideColor = Color.Black; // B2019-090 reset to black text (when a Complete RO Report was created after printing procedure, X/Y Plot was in red text)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -988,9 +851,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pdfTmp = MSWordToPDF.ToPDFReplaceROs(docInfo, roids, sect, null);
|
pdfTmp = ToPDFReplaceROs(docInfo, roids, sect, null);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
if (!_MissingDocs.Contains(docInfo.DocID))// B2018-071 Only add the message once to the error log
|
if (!_MissingDocs.Contains(docInfo.DocID))// B2018-071 Only add the message once to the error log
|
||||||
{
|
{
|
||||||
@@ -1014,16 +877,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (Document doc = docInfo.Get())
|
using (Document doc = docInfo.Get())
|
||||||
{
|
{
|
||||||
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
|
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
|
||||||
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
|
|
||||||
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
|
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||||
|
|
||||||
if (sc != null && sc.Section_WordMargin == "Y")
|
if (sect.ActiveSection.MyConfig is SectionConfig sc && sc.Section_WordMargin == "Y")
|
||||||
{
|
{
|
||||||
using (Pdf myPdf = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) {; }
|
using (Pdf myPdf = Pdf.MakePdf(doc, ss * 10 + DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) {; }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
using (Pdf myPdf1 = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
|
using (Pdf myPdf1 = Pdf.MakePdf(doc, ss * 10 + DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
|
||||||
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) {; }
|
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) {; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1036,9 +898,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping doc to match legacy signatures")]
|
||||||
public static string ToPDFReplaceROs(DocumentInfo doc, List<string> roids, ItemInfo sect, VolianStatusChange statusChange)
|
public static string ToPDFReplaceROs(DocumentInfo doc, List<string> roids, ItemInfo sect, VolianStatusChange statusChange)
|
||||||
{
|
{
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("WrdSec SecNum=\"{0}\" SecTitle=\"{1}\" Itemid={2}", sect.ActiveSection.DisplayNumber, sect.ActiveSection.DisplayText, sect.ItemID); // C2018-003 fixed use of getting the active section
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) BaselineMetaFile.WriteLine("WrdSec SecNum=\"{0}\" SecTitle=\"{1}\" Itemid={2}", sect.ActiveSection.DisplayNumber, sect.ActiveSection.DisplayText, sect.ItemID); // C2018-003 fixed use of getting the active section
|
||||||
return ToPDFReplaceROs(sect, false, roids, statusChange);
|
return ToPDFReplaceROs(sect, false, roids, statusChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1054,7 +917,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ROFstInfo rofst = null;
|
ROFstInfo rofst = null;
|
||||||
ROFSTLookup lookup = null;
|
ROFSTLookup lookup = null;
|
||||||
|
|
||||||
bool convertCaretToDeltaSymbol = (sect.ActiveSection != null) ? sect.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta : false; // C2018-003 fixed use of getting the active section
|
bool convertCaretToDeltaSymbol = (sect.ActiveSection != null) && sect.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta; // C2018-003 fixed use of getting the active section
|
||||||
|
|
||||||
if (dvi.DocVersionAssociationCount > 0)
|
if (dvi.DocVersionAssociationCount > 0)
|
||||||
{
|
{
|
||||||
@@ -1092,17 +955,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// Use positions relative to margins
|
// Use positions relative to margins
|
||||||
bool adjustMargins = true;
|
bool adjustMargins = true;
|
||||||
|
|
||||||
// Set Application Level Properties
|
|
||||||
//MyApp.Visible = false;
|
|
||||||
|
|
||||||
// Open new Document
|
// Open new Document
|
||||||
LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName, false);
|
LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName, false);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
|
if (!(sect.ActiveSection.MyConfig is SectionConfig sc) || sc.Section_WordMargin == "N")
|
||||||
|
|
||||||
if (sc == null || sc.Section_WordMargin == "N")
|
|
||||||
{
|
{
|
||||||
AdjustMargins(myDocStyle, myDoc, true);
|
AdjustMargins(myDocStyle, myDoc, true);
|
||||||
|
|
||||||
@@ -1120,18 +978,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
adjustMargins = false; // Use absolute positions
|
adjustMargins = false; // Use absolute positions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
// B2018-089 - Made error log output more useful
|
// B2018-089 - Made error log output more useful
|
||||||
AddErrorLogInfoMarginNotFixed(sect, "Word section could not adjust margins");
|
AddErrorLogInfoMarginNotFixed(sect, "Word section could not adjust margins");
|
||||||
}
|
}
|
||||||
|
|
||||||
string txtForBaseline = string.Empty; // C2018-018 save the contents of Word sections - after resolving RO values
|
string txtForBaseline = string.Empty; // C2018-018 save the contents of Word sections - after resolving RO values
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("++BgnTxt++");
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) BaselineMetaFile.WriteLine("++BgnTxt++");
|
||||||
LBSelection sel = MyApp.Selection;
|
LBSelection sel = MyApp.Selection;
|
||||||
sel.WholeStory();
|
sel.WholeStory();
|
||||||
|
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = sel.Text;
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) txtForBaseline = sel.Text;
|
||||||
LBSelection selxy = hasRos ? FindXyPlot() : null; // look for XY Plot language typed into word section (not an RO)
|
LBSelection selxy = hasRos ? FindXyPlot() : null; // look for XY Plot language typed into word section (not an RO)
|
||||||
string pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
string pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
||||||
|
|
||||||
@@ -1150,7 +1008,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
xyplot = xyplot.Replace("`", "\xB0");
|
xyplot = xyplot.Replace("`", "\xB0");
|
||||||
xyplot = xyplot.Replace("\xF8", "\xB0");
|
xyplot = xyplot.Replace("\xF8", "\xB0");
|
||||||
|
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText)
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText)
|
||||||
{
|
{
|
||||||
txtForBaseline = txtForBaseline.Replace("`", "\xB0");
|
txtForBaseline = txtForBaseline.Replace("`", "\xB0");
|
||||||
txtForBaseline = txtForBaseline.Replace("\xF8", "\xB0");
|
txtForBaseline = txtForBaseline.Replace("\xF8", "\xB0");
|
||||||
@@ -1161,7 +1019,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
xyplot = xyplot.Replace("^", "\x394"); // delta
|
xyplot = xyplot.Replace("^", "\x394"); // delta
|
||||||
xyplot = xyplot.Replace("\x7F", "\x394"); //delta
|
xyplot = xyplot.Replace("\x7F", "\x394"); //delta
|
||||||
|
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText)
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText)
|
||||||
{
|
{
|
||||||
txtForBaseline = txtForBaseline.Replace("^", "\x394");
|
txtForBaseline = txtForBaseline.Replace("^", "\x394");
|
||||||
txtForBaseline = txtForBaseline.Replace("\x7F", "\x394");
|
txtForBaseline = txtForBaseline.Replace("\x7F", "\x394");
|
||||||
@@ -1195,7 +1053,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
selxy.Text = string.Empty;
|
selxy.Text = string.Empty;
|
||||||
if (cnt > 0) for (int icnt = 0; icnt < cnt; icnt++) selxy.Text = selxy.Text + "\r";
|
if (cnt > 0) for (int icnt = 0; icnt < cnt; icnt++) selxy.Text += "\r";
|
||||||
}
|
}
|
||||||
|
|
||||||
pngFile = VlnSettings.TemporaryFolder + @"\XYPlot" + filecount.ToString() + @".png"; //@"C:\Temp\XYPlot1.png";
|
pngFile = VlnSettings.TemporaryFolder + @"\XYPlot" + filecount.ToString() + @".png"; //@"C:\Temp\XYPlot1.png";
|
||||||
@@ -1248,7 +1106,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
sel.WholeStory();
|
sel.WholeStory();
|
||||||
string roTokenForBaseline = string.Empty;
|
string roTokenForBaseline = string.Empty;
|
||||||
if (statusChange != null) statusChange(VolianStatusType.Initialize, sel.End, "Refreshing ROs");
|
statusChange?.Invoke(VolianStatusType.Initialize, sel.End, "Refreshing ROs");
|
||||||
sel = hasRos ? FindRO() : null;
|
sel = hasRos ? FindRO() : null;
|
||||||
int roCount = 0;
|
int roCount = 0;
|
||||||
|
|
||||||
@@ -1262,8 +1120,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(sel.Text))
|
if (!string.IsNullOrEmpty(sel.Text))
|
||||||
{
|
{
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) roTokenForBaseline = sel.Text;
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) roTokenForBaseline = sel.Text;
|
||||||
if (statusChange != null) statusChange(VolianStatusType.Update, sel.Start, string.Format("{0} ROs Refreshed", roCount++));
|
statusChange?.Invoke(VolianStatusType.Update, sel.Start, string.Format("{0} ROs Refreshed", roCount++));
|
||||||
|
|
||||||
// B2022-088: [JPR] Find Doc Ro button not working in Word Sections
|
// B2022-088: [JPR] Find Doc Ro button not working in Word Sections
|
||||||
// B2022-098: [JPR] ROs not being resolved in Word Sections
|
// B2022-098: [JPR] ROs not being resolved in Word Sections
|
||||||
@@ -1286,14 +1144,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
bool imageROTokenReplaced = false;
|
bool imageROTokenReplaced = false;
|
||||||
string[] vals = roValue.Split("\n".ToCharArray());
|
string[] vals = roValue.Split("\n".ToCharArray());
|
||||||
|
|
||||||
ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]);
|
|
||||||
|
|
||||||
if (roImage == null)
|
|
||||||
{
|
|
||||||
// need code to go and get an ROImaage if it exists
|
// need code to go and get an ROImaage if it exists
|
||||||
roImage = rofst.GetROImageByFilename(vals[0], sect);
|
ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]) ?? rofst.GetROImageByFilename(vals[0], sect);
|
||||||
}
|
|
||||||
|
|
||||||
if (roImage != null)
|
if (roImage != null)
|
||||||
{
|
{
|
||||||
ROImageFile roImageFile = new ROImageFile(roImage);
|
ROImageFile roImageFile = new ROImageFile(roImage);
|
||||||
@@ -1335,7 +1187,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
shape.Top = pt.Y;
|
shape.Top = pt.Y;
|
||||||
|
|
||||||
//_MyLog.WarnFormat("Shape.Left={0}, Shape.Top={1}", shape.Left, shape.Top);
|
//_MyLog.WarnFormat("Shape.Left={0}, Shape.Top={1}", shape.Left, shape.Top);
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("[{0}]", vals[0]));
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("[{0}]", vals[0]));
|
||||||
|
|
||||||
imageROTokenReplaced = true;
|
imageROTokenReplaced = true;
|
||||||
}
|
}
|
||||||
@@ -1343,7 +1195,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!imageROTokenReplaced)
|
if (!imageROTokenReplaced)
|
||||||
{
|
{
|
||||||
sel.Text = string.Format("Bad Image Link (Missing Image File:{0})", vals[0]);
|
sel.Text = string.Format("Bad Image Link (Missing Image File:{0})", vals[0]);
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, sel.Text);
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, sel.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1352,7 +1204,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// B2017-007 Fixed logic to properly position an XY Plot
|
// B2017-007 Fixed logic to properly position an XY Plot
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(sel.Text, roValue);
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(sel.Text, roValue);
|
||||||
|
|
||||||
// An X/Y Plot RO type might have text preceding the Plot Commands
|
// An X/Y Plot RO type might have text preceding the Plot Commands
|
||||||
int pstart = roValue.IndexOf("<<G"); // find the starting Plot Command
|
int pstart = roValue.IndexOf("<<G"); // find the starting Plot Command
|
||||||
@@ -1364,7 +1216,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
// B2017-217 Added logic so that underscores are not converted to underline
|
// B2017-217 Added logic so that underscores are not converted to underline
|
||||||
// C2018-003 fixed use of getting the active section
|
// C2018-003 fixed use of getting the active section
|
||||||
AddPrecedingText(sel, roValue.Substring(0, pstart), fx1, (sect.ActiveSection != null) ? sect.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertUnderscoreToUnderline : false);// replace the RO token with what's in front of the X/Y Plot
|
AddPrecedingText(sel, roValue.Substring(0, pstart), fx1, (sect.ActiveSection != null) && sect.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertUnderscoreToUnderline);// replace the RO token with what's in front of the X/Y Plot
|
||||||
roValue = roValue.Substring(pstart); // set rovalue to the start of the plot commands
|
roValue = roValue.Substring(pstart); // set rovalue to the start of the plot commands
|
||||||
|
|
||||||
pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
||||||
@@ -1414,12 +1266,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
shape.Top = pt.Y;
|
shape.Top = pt.Y;
|
||||||
sel.WholeStory();
|
sel.WholeStory();
|
||||||
|
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline, true));
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline, true));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
// something is wrong with the X/Y plot RO. Just print out the un-processed X/Y plot RO value
|
// something is wrong with the X/Y plot RO. Just print out the un-processed X/Y plot RO value
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("BAD XYPLOT: {0}", roValue));
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("BAD XYPLOT: {0}", roValue));
|
||||||
sel.Text = roValue;
|
sel.Text = roValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1427,11 +1279,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
// if roValue is null, then InsertROValue will put in "RO Not Found" for the value
|
// if roValue is null, then InsertROValue will put in "RO Not Found" for the value
|
||||||
float indent = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToTextBoundary);
|
float indent = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToTextBoundary);
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, roValue);
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, roValue);
|
||||||
|
|
||||||
// B2017-217 Added logic so that underscores are not converted to underline
|
// B2017-217 Added logic so that underscores are not converted to underline
|
||||||
// C2018-003 fixed use of getting the active section
|
// C2018-003 fixed use of getting the active section
|
||||||
InsertROValue(sel, roValue, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper, indent, (sect.ActiveSection != null) ? sect.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertUnderscoreToUnderline : false);
|
InsertROValue(sel, roValue, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper, indent, (sect.ActiveSection != null) && sect.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertUnderscoreToUnderline);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1447,17 +1299,17 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (statusChange != null) statusChange(VolianStatusType.Update, 0, "Creating PDF");
|
statusChange?.Invoke(VolianStatusType.Update, 0, "Creating PDF");
|
||||||
sel = MyApp.Selection;
|
sel = MyApp.Selection;
|
||||||
sel.WholeStory();
|
sel.WholeStory();
|
||||||
|
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline, true));
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline, true));
|
||||||
|
|
||||||
if (sel.Range.Font.Color != (LBWdColor)9999999 || OverrideColor == System.Drawing.Color.Red)// B2017-144 If the font color is 9999999 then the color is mixed, and if the override color isn't red, don't change the color.
|
if (sel.Range.Font.Color != (LBWdColor)9999999 || OverrideColor == Color.Red)// B2017-144 If the font color is 9999999 then the color is mixed, and if the override color isn't red, don't change the color.
|
||||||
sel.Range.Font.Color = (LBWdColor)WordColor(OverrideColor == System.Drawing.Color.Transparent ? System.Drawing.Color.Black : OverrideColor);
|
sel.Range.Font.Color = (LBWdColor)WordColor(OverrideColor == Color.Transparent ? Color.Black : OverrideColor);
|
||||||
|
|
||||||
sect.MSWordPageCount = myDoc.Length;
|
sect.MSWordPageCount = myDoc.Length;
|
||||||
fileName = CreatePDF(fileName, openPdf, MSWordToPDF.DebugStatus);
|
fileName = CreatePDF(fileName, openPdf, DebugStatus);
|
||||||
|
|
||||||
if (DocReplace != null)
|
if (DocReplace != null)
|
||||||
{
|
{
|
||||||
@@ -1491,14 +1343,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_MyLog.Warn("Finished collecting reclaimable memory.");
|
_MyLog.Warn("Finished collecting reclaimable memory.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (statusChange != null) statusChange(VolianStatusType.Complete, 0, string.Empty);
|
statusChange?.Invoke(VolianStatusType.Complete, 0, string.Empty);
|
||||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("++EndTxt++");
|
if (BaselineMetaFile.IsOpen && BaselineMetaFile.IncludeWordSecText) BaselineMetaFile.WriteLine("++EndTxt++");
|
||||||
|
|
||||||
// [jpr 2022.07.26] - For memory optimization
|
|
||||||
//GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
|
|
||||||
|
|
||||||
//jsj 2-15-2016 - for memory garbage collection
|
|
||||||
//GC.Collect();
|
|
||||||
|
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
@@ -1516,7 +1362,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string accPageKey = lookup.FormatAccPageKey(selText, ref accPageBase, ref accPageExt);
|
string accPageKey = lookup.FormatAccPageKey(selText, ref accPageBase, ref accPageExt);
|
||||||
|
|
||||||
if (RoPrintCache == null) // B2022-141 if RoPrintCache is null then ititialize it
|
if (RoPrintCache == null) // B2022-141 if RoPrintCache is null then ititialize it
|
||||||
MSWordToPDF.RoPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
|
RoPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
|
||||||
|
|
||||||
// Check if the Rochild is in the PrintCache (use base accPageID without specific extension)
|
// Check if the Rochild is in the PrintCache (use base accPageID without specific extension)
|
||||||
if (!RoPrintCache.ContainsKey(accPageKey)) //B2023-006 pass in the actual key instead of the base key.//old code=> accPageBase))
|
if (!RoPrintCache.ContainsKey(accPageKey)) //B2023-006 pass in the actual key instead of the base key.//old code=> accPageBase))
|
||||||
@@ -1589,19 +1435,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
grfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
|
grfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
|
||||||
grfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
|
grfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
|
||||||
grfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
|
grfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
|
||||||
grfx.Clear(MSWordToPDF.DebugStatus == 1 ? System.Drawing.Color.Transparent : System.Drawing.Color.White);
|
grfx.Clear(DebugStatus == 1 ? Color.Transparent : Color.White);
|
||||||
|
|
||||||
XYPlots.XYPlot.BlackColor = MSWordToPDF.OverrideColor == Color.Red ? Color.Red : Color.Black;
|
XYPlots.XYPlot.BlackColor = OverrideColor == Color.Red ? Color.Red : Color.Black;
|
||||||
XYPlots.XYPlot myPlot = new XYPlots.XYPlot(xyPlot);
|
XYPlots.XYPlot myPlot = new XYPlots.XYPlot(xyPlot);
|
||||||
myPlot.SetMargins(0, 0, 0, 0);
|
myPlot.SetMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
VG.IVGOutput vgOut = new VG.VGOut_Graphics(grfx);
|
VG.IVGOutput vgOut = new VG.VGOut_Graphics(grfx)
|
||||||
vgOut.DebugStatus = MSWordToPDF.DebugStatus;
|
{
|
||||||
|
DebugStatus = DebugStatus
|
||||||
|
};
|
||||||
myPlot.Process(vgOut);
|
myPlot.Process(vgOut);
|
||||||
grfx.Dispose();
|
grfx.Dispose();
|
||||||
|
|
||||||
//GC.Collect(); // memory garbage collection (Regex bug)
|
|
||||||
|
|
||||||
GraphicsUnit gu = new GraphicsUnit();
|
GraphicsUnit gu = new GraphicsUnit();
|
||||||
retval = mf.GetBounds(ref gu);
|
retval = mf.GetBounds(ref gu);
|
||||||
retval.Width *= dpi / resolution;
|
retval.Width *= dpi / resolution;
|
||||||
@@ -1733,10 +1579,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
float newLeft = (float)myDocStyle.Layout.LeftMargin;
|
float newLeft = (float)myDocStyle.Layout.LeftMargin;
|
||||||
float newLength = (float)myDocStyle.Layout.PageLength;
|
float newLength = (float)myDocStyle.Layout.PageLength;
|
||||||
float newWidth = (float)myDocStyle.Layout.PageWidth;
|
float newWidth = (float)myDocStyle.Layout.PageWidth;
|
||||||
float oldTop = myDoc.PageSetup.TopMargin;
|
//For Debugging - Add watches
|
||||||
float oldLeft = myDoc.PageSetup.LeftMargin;
|
//oldTop = myDoc.PageSetup.TopMargin;
|
||||||
float oldBottom = myDoc.PageSetup.BottomMargin;
|
//oldLeft = myDoc.PageSetup.LeftMargin;
|
||||||
float oldRight = myDoc.PageSetup.RightMargin;
|
//oldBottom = myDoc.PageSetup.BottomMargin;
|
||||||
|
//oldRight = myDoc.PageSetup.RightMargin;
|
||||||
float oldHeight = myDoc.PageSetup.PageHeight;
|
float oldHeight = myDoc.PageSetup.PageHeight;
|
||||||
float oldWidth = myDoc.PageSetup.PageWidth;
|
float oldWidth = myDoc.PageSetup.PageWidth;
|
||||||
|
|
||||||
@@ -1775,7 +1622,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
myDoc.PageSetup.LeftMargin = newLeft;
|
myDoc.PageSetup.LeftMargin = newLeft;
|
||||||
myDoc.PageSetup.TopMargin = newTop;
|
myDoc.PageSetup.TopMargin = newTop;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
if (_MySection != null)
|
if (_MySection != null)
|
||||||
{
|
{
|
||||||
@@ -1799,7 +1646,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
myDoc.PageSetup.LeftMargin = newLeft;
|
myDoc.PageSetup.LeftMargin = newLeft;
|
||||||
myDoc.PageSetup.TopMargin = newTop;
|
myDoc.PageSetup.TopMargin = newTop;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
if (_MySection != null)
|
if (_MySection != null)
|
||||||
{
|
{
|
||||||
@@ -2027,8 +1874,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// newline in return string.
|
// newline in return string.
|
||||||
if (nxtIndxCmd > 0)
|
if (nxtIndxCmd > 0)
|
||||||
{
|
{
|
||||||
string mydebug = p.Substring(indxClose + 1);
|
|
||||||
|
|
||||||
for (int i = indxClose + 1; i < nxtIndxCmd; i++)
|
for (int i = indxClose + 1; i < nxtIndxCmd; i++)
|
||||||
{
|
{
|
||||||
if (!System.Char.IsWhiteSpace(p[i]))
|
if (!System.Char.IsWhiteSpace(p[i]))
|
||||||
@@ -2086,7 +1931,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
private static int WordColor(System.Drawing.Color color)
|
private static int WordColor(System.Drawing.Color color)
|
||||||
{
|
{
|
||||||
System.Drawing.Color c1 = System.Drawing.Color.FromArgb(0, color.B, color.G, color.R);
|
System.Drawing.Color c1 = Color.FromArgb(0, color.B, color.G, color.R);
|
||||||
return c1.ToArgb();
|
return c1.ToArgb();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2153,8 +1998,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// space or other word following that text in the table cell. For example, there was a table cell who's text
|
// space or other word following that text in the table cell. For example, there was a table cell who's text
|
||||||
// was "<90" cause the Word Find command to return an entire table row which cause PROMS to stop processing
|
// was "<90" cause the Word Find command to return an entire table row which cause PROMS to stop processing
|
||||||
// the rest of the Word attachment section.
|
// the rest of the Word attachment section.
|
||||||
bool tryagain = false;
|
bool tryagain;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
tryagain = false;
|
tryagain = false;
|
||||||
@@ -2236,19 +2080,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
// B2019-161 When tracking timing time this action
|
// B2019-161 When tracking timing time this action
|
||||||
private static VolianTimer _TimeActivity = new VolianTimer("DocumentExt.cs CloseWordApp_Tick", 1548);
|
private static readonly VolianTimer _TimeActivity = new VolianTimer("DocumentExt.cs CloseWordApp_Tick", 1548);
|
||||||
|
|
||||||
LBApplicationClass _MyApp;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
|
|
||||||
public LBApplicationClass MyApp
|
public LBApplicationClass MyApp { get; set; }
|
||||||
{
|
|
||||||
get { return _MyApp; }
|
|
||||||
set { _MyApp = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.IO;
|
|
||||||
using Volian.Base.Library;
|
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@@ -16,12 +12,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
private class AddByROFstIDImageIDCriteria
|
private class AddByROFstIDImageIDCriteria
|
||||||
{
|
{
|
||||||
private int _ROFstID;
|
private readonly int _ROFstID;
|
||||||
public int ROFstID
|
public int ROFstID => _ROFstID;
|
||||||
{ get { return _ROFstID; } }
|
private readonly string _ImagedIDs;
|
||||||
private string _ImagedIDs;
|
public string ImagedIDs => _ImagedIDs;
|
||||||
public string ImagedIDs
|
|
||||||
{ get { return _ImagedIDs; } }
|
|
||||||
public AddByROFstIDImageIDCriteria(int rOFstID, string imagedIDs)
|
public AddByROFstIDImageIDCriteria(int rOFstID, string imagedIDs)
|
||||||
{
|
{
|
||||||
_ROFstID = rOFstID;
|
_ROFstID = rOFstID;
|
||||||
|
|||||||
@@ -13,10 +13,7 @@ using System.Data;
|
|||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.Configuration;
|
|
||||||
using System.IO;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -40,72 +37,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _FolderConfig;
|
return _FolderConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void FolderConfigRefresh()
|
public void FolderConfigRefresh() => _FolderConfig = null;
|
||||||
{
|
private void _FolderConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) => Config = _FolderConfig.ToString();
|
||||||
_FolderConfig = null;
|
|
||||||
}
|
|
||||||
private void _FolderConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
Config = _FolderConfig.ToString();
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
public override string ToString()
|
public override string ToString() => _Title;
|
||||||
{
|
|
||||||
return _Title;
|
|
||||||
}
|
|
||||||
#region IVEReadOnlyItem
|
#region IVEReadOnlyItem
|
||||||
//public System.Collections.IList GetChildren()
|
public ConfigDynamicTypeDescriptor MyConfig => FolderConfig;
|
||||||
//{
|
|
||||||
// if (FolderDocVersionCount != 0) return FolderDocVersions;
|
|
||||||
// if (ChildFolderCount != 0) return ChildFolders;
|
|
||||||
// return null;
|
|
||||||
//}
|
|
||||||
//public bool HasChildren
|
|
||||||
//{
|
|
||||||
// get { return _FolderDocVersionCount > 0 || _ChildFolderCount > 0; }
|
|
||||||
//}
|
|
||||||
//public IVEDrillDown ActiveParent
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// return MyParent;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//private Format _ActiveFormat = null;
|
|
||||||
//public Format ActiveFormat
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// if (_ActiveFormat == null)
|
|
||||||
// _ActiveFormat = (LocalFormat != null ? LocalFormat : ActiveParent != null ? ActiveParent.ActiveFormat : null);
|
|
||||||
// return _ActiveFormat;
|
|
||||||
// }
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// _ActiveFormat = null; // Reset
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//public Format LocalFormat
|
|
||||||
//{
|
|
||||||
// get { return MyFormat; }
|
|
||||||
//}
|
|
||||||
public ConfigDynamicTypeDescriptor MyConfig
|
|
||||||
{
|
|
||||||
get { return FolderConfig; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region MakeFolders for ManualOrder
|
#region MakeFolders for ManualOrder
|
||||||
public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, string config, DateTime dts, string usrID)
|
public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, string config, DateTime dts, string usrID) => MakeFolder(myParent, myConnection, name, title, shortName, myFormat, null, config, dts, usrID);
|
||||||
{
|
public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, string config) => MakeFolder(myParent, myConnection, name, title, shortName, myFormat, null, config);
|
||||||
return MakeFolder(myParent, myConnection, name, title, shortName, myFormat, null, config, dts, usrID);
|
|
||||||
}
|
|
||||||
public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, string config)
|
|
||||||
{
|
|
||||||
return MakeFolder(myParent, myConnection, name, title, shortName, myFormat, null, config);
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
public FolderInfo MyFolderInfo
|
public FolderInfo MyFolderInfo => FolderInfo.Get(FolderID);
|
||||||
{ get { return FolderInfo.Get(FolderID); } }
|
|
||||||
}
|
}
|
||||||
public partial class FolderInfo:IVEDrillDownReadOnly
|
public partial class FolderInfo:IVEDrillDownReadOnly
|
||||||
{
|
{
|
||||||
@@ -125,23 +68,17 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _SearchDVPath;
|
return _SearchDVPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string SearchPath { get { return ""; } }
|
public string SearchPath => "";
|
||||||
|
|
||||||
// B2021-076: Proms search results are not presented in order when printed to PDF
|
// B2021-076: Proms search results are not presented in order when printed to PDF
|
||||||
public string SearchDefaultSort { get { return string.Empty; } }
|
public string SearchDefaultSort => string.Empty;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Folder Config (Read-Only)
|
#region Folder Config (Read-Only)
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private FolderConfig _FolderConfig;
|
private FolderConfig _FolderConfig;
|
||||||
public FolderConfig FolderConfig
|
public FolderConfig FolderConfig => _FolderConfig ?? (_FolderConfig = new FolderConfig(this));
|
||||||
{ get {
|
private void FolderConfigRefresh() => _FolderConfig = null;
|
||||||
return (_FolderConfig != null ? _FolderConfig : _FolderConfig = new FolderConfig(this));
|
|
||||||
} }
|
|
||||||
private void FolderConfigRefresh()
|
|
||||||
{
|
|
||||||
_FolderConfig = null;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region SortingChildren
|
#region SortingChildren
|
||||||
private static bool IsInManualOrderNullFix = false;
|
private static bool IsInManualOrderNullFix = false;
|
||||||
@@ -180,8 +117,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (_SortedChildFolders == null)
|
if (_SortedChildFolders == null)
|
||||||
{
|
{
|
||||||
_SortedChildFolders = new SortedBindingList<FolderInfo>(ChildFolders);
|
_SortedChildFolders = new SortedBindingList<FolderInfo>(ChildFolders);
|
||||||
//_SortedChildFolders.ApplySort("FolderID", ListSortDirection.Ascending);
|
|
||||||
//_SortedChildFolders.ApplySort("Name", ListSortDirection.Ascending);
|
|
||||||
}
|
}
|
||||||
else if (_SortedChildFolders.Count != ChildFolders.Count)
|
else if (_SortedChildFolders.Count != ChildFolders.Count)
|
||||||
{
|
{
|
||||||
@@ -266,37 +201,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public System.Collections.IList GetChildren()
|
public System.Collections.IList GetChildren()
|
||||||
{
|
{
|
||||||
if(FolderDocVersionCount != 0)return FolderDocVersions;
|
if(FolderDocVersionCount != 0)return FolderDocVersions;
|
||||||
//if (ChildFolderCount != 0) return ChildFolders;
|
|
||||||
if (ChildFolderCount != 0) return SortedChildFolders;
|
if (ChildFolderCount != 0) return SortedChildFolders;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//public bool ChildrenAreLoaded
|
public bool HasChildren => FolderDocVersionCount > 0 || ChildFolderCount > 0;
|
||||||
//{
|
public IVEDrillDownReadOnly ActiveParent => MyParent;
|
||||||
// get { return _FolderDocVersions != null || _ChildFolders != null; }
|
public FormatInfo ActiveFormat => LocalFormat ?? (ActiveParent?.ActiveFormat);
|
||||||
//}
|
public FormatInfo LocalFormat => MyFormat;
|
||||||
public bool HasChildren
|
public ConfigDynamicTypeDescriptor MyConfig => FolderConfig;
|
||||||
{
|
|
||||||
get { return FolderDocVersionCount > 0 || ChildFolderCount > 0; }
|
|
||||||
}
|
|
||||||
public IVEDrillDownReadOnly ActiveParent
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return MyParent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public FormatInfo ActiveFormat
|
|
||||||
{
|
|
||||||
get { return LocalFormat != null ? LocalFormat : ( ActiveParent != null ? ActiveParent.ActiveFormat : null); }
|
|
||||||
}
|
|
||||||
public FormatInfo LocalFormat
|
|
||||||
{
|
|
||||||
get { return MyFormat; }
|
|
||||||
}
|
|
||||||
public ConfigDynamicTypeDescriptor MyConfig
|
|
||||||
{
|
|
||||||
get { return FolderConfig; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// These settings are set on the user interface side.
|
/// These settings are set on the user interface side.
|
||||||
/// This is used to control whether the Name and/or Title is displayed
|
/// This is used to control whether the Name and/or Title is displayed
|
||||||
@@ -326,12 +238,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
rtnstr += Title;
|
rtnstr += Title;
|
||||||
}
|
}
|
||||||
return rtnstr;
|
return rtnstr;
|
||||||
//return string.Format("{0} - {1}", Name, Title);
|
|
||||||
}
|
}
|
||||||
//public string ToString(string str, System.IFormatProvider ifp)
|
|
||||||
//{
|
|
||||||
// return ToString();
|
|
||||||
//}
|
|
||||||
#endregion
|
#endregion
|
||||||
public Color BackColor
|
public Color BackColor
|
||||||
{ get { return FolderConfig.Default_BkColor; } }
|
{ get { return FolderConfig.Default_BkColor; } }
|
||||||
@@ -351,15 +258,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Extension
|
#region Extension
|
||||||
partial class FolderInfoExtension : extensionBase
|
partial class FolderInfoExtension : extensionBase
|
||||||
{
|
{
|
||||||
public override void Refresh(FolderInfo tmp)
|
public override void Refresh(FolderInfo tmp) => tmp.FolderConfigRefresh();
|
||||||
{
|
|
||||||
tmp.FolderConfigRefresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static FolderInfo GetTop()
|
public static FolderInfo GetTop()
|
||||||
{
|
{
|
||||||
//if (!CanGetObject())
|
|
||||||
// throw new System.Security.SecurityException("User not authorized to view a Folder");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FolderInfo tmp = DataPortal.Fetch<FolderInfo>(new TopCriteria());
|
FolderInfo tmp = DataPortal.Fetch<FolderInfo>(new TopCriteria());
|
||||||
@@ -375,6 +277,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Error on FolderInfo.GetTop", ex);
|
throw new DbCslaException("Error on FolderInfo.GetTop", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping until replace CSLA")]
|
||||||
private void DataPortal_Fetch(TopCriteria criteria)
|
private void DataPortal_Fetch(TopCriteria criteria)
|
||||||
{
|
{
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfo.DataPortal_Fetch", GetHashCode());
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfo.DataPortal_Fetch", GetHashCode());
|
||||||
@@ -416,41 +319,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public TopCriteria() { ;}
|
public TopCriteria() { ;}
|
||||||
}
|
}
|
||||||
public bool IsFolder
|
public bool IsFolder => true;
|
||||||
{
|
public bool IsDocVersion => false;
|
||||||
get
|
public bool IsProcedure => false;
|
||||||
{
|
public bool IsSection => false;
|
||||||
return true;
|
public bool IsStep => false;
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsDocVersion
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsProcedure
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsSection
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsStep
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
|
||||||
{
|
|
||||||
//public static class FontTab
|
|
||||||
//{
|
|
||||||
// private static Dictionary<string, int> FontIndx = null;
|
|
||||||
// // This dictionary takes a color name and converts it to the rtf string:
|
|
||||||
// private static Dictionary<string, string> FontRtf = null;
|
|
||||||
// public enum E_Fonts : int
|
|
||||||
// {
|
|
||||||
// None = 0, PrestigeEliteTall = 64, CourierNew = 2, TimesNewRoman = 0, LetterGothic = 66, Arial = 202, VolianDraw = 70, GothicUltra = 63, LetterGothicTall = 67, VolianScript = 71, ArialUnicode = 35
|
|
||||||
// }
|
|
||||||
// #region FontIndex
|
|
||||||
// /// <summary>
|
|
||||||
// /// GetIndex - Use this to get the number of the font in the font table based on the input
|
|
||||||
// /// string.
|
|
||||||
// /// </summary>
|
|
||||||
// /// <param name="font"></param>
|
|
||||||
// /// <returns></returns>
|
|
||||||
// public static int GetIndex(string font)
|
|
||||||
// {
|
|
||||||
// // if the dictionary hasn't been set yet,
|
|
||||||
// if (FontIndx==null)
|
|
||||||
// {
|
|
||||||
// FontIndx = new Dictionary<string, int>();
|
|
||||||
// FontIndx["Prestige Elite Tall"] = 64;
|
|
||||||
// FontIndx["Courier New"] = 2;
|
|
||||||
// FontIndx["Times New Roman"] = 0;
|
|
||||||
// FontIndx["Letter Gothic"] = 66;
|
|
||||||
// FontIndx["Arial"] = 202;
|
|
||||||
// FontIndx["Volian Draw"] = 70;
|
|
||||||
// FontIndx["Gothic Ultra"] = 63;
|
|
||||||
// FontIndx["Letter Gothic Tall"] = 67;
|
|
||||||
// FontIndx["VolianScript"] = 71;
|
|
||||||
// FontIndx["Arial Unicode"] = 35;
|
|
||||||
|
|
||||||
// }
|
|
||||||
// return FontIndx[font];
|
|
||||||
// }
|
|
||||||
// #endregion
|
|
||||||
// #region ColorRtf
|
|
||||||
// /// <summary>
|
|
||||||
// /// GetTableString - Use this to get the string to add to font table based on the input
|
|
||||||
// /// string.
|
|
||||||
// /// </summary>
|
|
||||||
// public static string GetTableString(string font)
|
|
||||||
// {
|
|
||||||
// if (FontRtf == null)
|
|
||||||
// {
|
|
||||||
// FontRtf = new Dictionary<string, string>();
|
|
||||||
// FontRtf["Prestige Elite Tall"] = "{\\f64\\fmodern\\fcharset2\\fprq1 Prestige Elite Tall;}";
|
|
||||||
// FontRtf["Courier New"] = "{\\f2\\fmodern\\fcharset0\\fprq1 Courier New;}";
|
|
||||||
// FontRtf["Times New Roman"] = "{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}";
|
|
||||||
// FontRtf["Letter Gothic"] = "{\\f66\\fmodern\\fcharset2\\fprq1 Letter Gothic;}";
|
|
||||||
// FontRtf["Arial"] = "{\\f1\\fswiss\\fcharset0\\fprq2 Arial;}";
|
|
||||||
// FontRtf["Volian Draw"] = "{\\f70\\fmodern\\fcharset2\\fprq1 VolianDraw;}";
|
|
||||||
// FontRtf["Gothic Ultra"] = "{\\f63\\fmodern\\fcharset2\\fprq1 Gothic Ultra;}";
|
|
||||||
// FontRtf["Letter Gothic Tall"] = "{\\f67\\fmodern\\fcharset2\\fprq1 Letter Gothic Tall;}";
|
|
||||||
// FontRtf["VolianScript"] = "{\\f71\\fswiss\\fcharset2\\fprq2 VolianScript;}";
|
|
||||||
// FontRtf["Arial Unicode"] = "{\\f35\\fswiss\\fcharset128\\fprq2 Arial Unicode MS;}";
|
|
||||||
// }
|
|
||||||
// return FontRtf[font];
|
|
||||||
// }
|
|
||||||
// #endregion
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
@@ -13,10 +13,8 @@ using System.Data;
|
|||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.Configuration;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Drawing;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
@@ -33,17 +31,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _AllFormats; }
|
get { return _AllFormats; }
|
||||||
set { _AllFormats = value; }
|
set { _AllFormats = value; }
|
||||||
}
|
}
|
||||||
public CriteriaAllFormats(bool allFormats)
|
public CriteriaAllFormats(bool allFormats) => _AllFormats = allFormats;
|
||||||
{
|
|
||||||
_AllFormats = allFormats;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class Format
|
public partial class Format
|
||||||
{
|
{
|
||||||
public static Format GetJustFormat(int formatID)
|
public static Format GetJustFormat(int formatID)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to view a Format");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Format tmp = GetCachedByPrimaryKey(formatID);
|
Format tmp = GetCachedByPrimaryKey(formatID);
|
||||||
@@ -67,13 +60,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PKCriteriaJustFormat
|
protected class PKCriteriaJustFormat
|
||||||
{
|
{
|
||||||
private int _FormatID;
|
private readonly int _FormatID;
|
||||||
public int FormatID
|
public int FormatID => _FormatID;
|
||||||
{ get { return _FormatID; } }
|
public PKCriteriaJustFormat(int formatID) => _FormatID = formatID;
|
||||||
public PKCriteriaJustFormat(int formatID)
|
|
||||||
{
|
|
||||||
_FormatID = formatID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(PKCriteriaJustFormat criteria)
|
private void DataPortal_Fetch(PKCriteriaJustFormat criteria)
|
||||||
{
|
{
|
||||||
@@ -123,16 +112,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public class FormatEventArgs
|
public class FormatEventArgs
|
||||||
{
|
{
|
||||||
private string _Status;
|
public string Status { get; set; }
|
||||||
public string Status
|
public FormatEventArgs(string status) => Status = status;
|
||||||
{
|
|
||||||
get { return _Status; }
|
|
||||||
set { _Status = value; }
|
|
||||||
}
|
|
||||||
public FormatEventArgs(string status)
|
|
||||||
{
|
|
||||||
_Status = status;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public delegate void FormatEvent(object sender,FormatEventArgs args);
|
public delegate void FormatEvent(object sender,FormatEventArgs args);
|
||||||
public partial class Format:IFormatOrFormatInfo
|
public partial class Format:IFormatOrFormatInfo
|
||||||
@@ -140,75 +121,57 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region PlantFormat
|
#region PlantFormat
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private PlantFormat _PlantFormat;
|
private PlantFormat _PlantFormat;
|
||||||
public PlantFormat PlantFormat
|
public PlantFormat PlantFormat => _PlantFormat ?? (_PlantFormat = new PlantFormat(this, Config));
|
||||||
{ get { return (_PlantFormat != null ? _PlantFormat : _PlantFormat = new PlantFormat(this, Config)); } }
|
|
||||||
#endregion
|
#endregion
|
||||||
public static event FormatEvent FormatLoaded;
|
public static event FormatEvent FormatLoaded;
|
||||||
private static void OnFormatLoaded(object sender, FormatEventArgs args)
|
private static void OnFormatLoaded(object sender, FormatEventArgs args) => FormatLoaded?.Invoke(sender, args);
|
||||||
{
|
public IFormatOrFormatInfo MyIParent => MyParent;
|
||||||
if (FormatLoaded != null)
|
public override string ToString() => FullName;
|
||||||
FormatLoaded(sender, args);
|
|
||||||
}
|
|
||||||
public IFormatOrFormatInfo MyIParent { get { return MyParent; } }
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
//return Name;
|
|
||||||
//return PlantFormat.FormatData.Name;
|
|
||||||
return FullName;
|
|
||||||
}
|
|
||||||
public string FullName
|
public string FullName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (ParentID == 1) return Description + " (" + Name + ")";
|
if (ParentID == 1) return $"{Description} ({Name})";
|
||||||
if (Description.StartsWith("*")) return Description.Substring(1) + " (" + Name + ")";
|
if (Description.StartsWith("*")) return $"{Description.Substring(1)} ({Name})";
|
||||||
// C2019-029: if UCF, just use description & name, using parent is confusing
|
// C2019-029: if UCF, just use description & name, using parent is confusing
|
||||||
if (Config != null && Config != "") return Description + " (" + Name + ")";
|
if (Config != null && Config != "") return $"{Description} ({Name})";
|
||||||
return MyParent.Description + " - " + Description + " (" + Name + ")";
|
return $"{MyParent.Description} - {Description} ({Name})";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateFormats(string fmtPath, string genmacPath)
|
public static void UpdateFormats(string fmtPath, string genmacPath)
|
||||||
{
|
{
|
||||||
Format basefmt = null;
|
|
||||||
Format parent = null;
|
|
||||||
|
|
||||||
|
|
||||||
// Load base format.
|
// Load base format.
|
||||||
basefmt = AddFormatToDB(null, "base", false, DateTime.Now, "Migration", fmtPath, genmacPath);
|
Format basefmt = AddFormatToDB(null, "base", false, "Migration", fmtPath, genmacPath);
|
||||||
if (basefmt == null) return;
|
if (basefmt == null) return;
|
||||||
// now loop through all files... If there is an _ in the name, it's a subformat
|
// now loop through all files... If there is an _ in the name, it's a subformat
|
||||||
// (for example, AEP_00.xml) skip it in main loop, it's handled for each format.
|
// (for example, AEP_00.xml) skip it in main loop, it's handled for each format.
|
||||||
DirectoryInfo di = new DirectoryInfo(fmtPath); //(@"c:\development\fmtall");
|
DirectoryInfo di = new DirectoryInfo(fmtPath); //(@"c:\development\fmtall");
|
||||||
FileInfo[] fis = di.GetFiles("*.xml");
|
FileInfo[] fis = di.GetFiles("*.xml");
|
||||||
OnFormatLoaded(null, new FormatEventArgs(fis.Length.ToString() + " Formats to Load"));
|
OnFormatLoaded(null, new FormatEventArgs($"{fis.Length} Formats to Load"));
|
||||||
foreach (FileInfo fi in fis)
|
foreach (FileInfo fi in fis)
|
||||||
{
|
{
|
||||||
//if (fi.Name.ToUpper() == "WCN2ALL.XML"|| fi.Name.ToUpper() == "OHLPALL.XML")
|
bool issub = (fi.Name.IndexOf("_") > 0);
|
||||||
//{
|
|
||||||
bool issub = (fi.Name.IndexOf("_") > 0) ? true : false;
|
|
||||||
if (!issub && fi.Name.ToLower() != "baseall.xml")
|
if (!issub && fi.Name.ToLower() != "baseall.xml")
|
||||||
{
|
{
|
||||||
string fmtname = fi.Name.Substring(0, fi.Name.Length - 7);
|
string fmtname = fi.Name.Substring(0, fi.Name.Length - 7);
|
||||||
// remove the all.xml part of the filename.
|
// remove the all.xml part of the filename.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
parent = AddFormatToDB(basefmt, fmtname, issub, DateTime.Now, "Migration", fmtPath, genmacPath);
|
Format parent = AddFormatToDB(basefmt, fmtname, issub, "Migration", fmtPath, genmacPath);
|
||||||
if (parent != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// now see if there are any subformats associated with this, if so
|
// now see if there are any subformats associated with this, if so
|
||||||
// add them here...
|
// add them here...
|
||||||
DirectoryInfo sdi = new DirectoryInfo(fmtPath); //("c:\\development\\fmtall");
|
DirectoryInfo sdi = new DirectoryInfo(fmtPath); //("c:\\development\\fmtall");
|
||||||
FileInfo[] sfis = di.GetFiles(fmtname + "_*.xml");
|
FileInfo[] sfis = di.GetFiles($"{fmtname}_*.xml");
|
||||||
foreach (FileInfo sfi in sfis)
|
foreach (FileInfo sfi in sfis)
|
||||||
{
|
{
|
||||||
string nm = sfi.Name.Substring(0, sfi.Name.Length - 7);
|
string nm = sfi.Name.Substring(0, sfi.Name.Length - 7);
|
||||||
OnFormatLoaded(null, new FormatEventArgs("Loading SubFormat " + sfi.Name));
|
OnFormatLoaded(null, new FormatEventArgs($"Loading SubFormat {sfi.Name}"));
|
||||||
//Console.WriteLine("Processing {0}", sfi.Name);
|
|
||||||
//frmMain.Status = string.Format("Processing Format {0}", sfi.Name);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
AddFormatToDB(parent, nm, true, DateTime.Now, "Migration",fmtPath,genmacPath);
|
AddFormatToDB(parent, nm, true, "Migration",fmtPath,genmacPath);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -242,7 +205,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string fmtname = Path.GetFileNameWithoutExtension(fi.Name);
|
string fmtname = Path.GetFileNameWithoutExtension(fi.Name);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
AddEPFormatToDB(fmtname, DateTime.Now, VlnSettings.UserID, epPath);
|
AddEPFormatToDB(fmtname, VlnSettings.UserID, epPath);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -283,16 +246,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_ = LookupFormats;
|
_ = LookupFormats;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid, string fmtPath, string genmacPath)
|
private static Format AddFormatToDB(Format parent, string format, bool issub, string Userid, string fmtPath, string genmacPath)
|
||||||
{
|
{
|
||||||
string fmtdata = null;
|
string fmtdata = null;
|
||||||
FileInfo fmtfi = null;
|
FileInfo fmtfi = null;
|
||||||
string genmacdata = null;
|
string genmacdata = null;
|
||||||
XmlDocument xd = null;
|
XmlDocument xd = null;
|
||||||
|
|
||||||
OnFormatLoaded(null, new FormatEventArgs("Loading Format "+format));
|
OnFormatLoaded(null, new FormatEventArgs($"Loading Format {format}"));
|
||||||
//string path = "c:\\development\\fmtall\\" + format + "all.xml";
|
string path = $"{fmtPath}\\{format}all.xml";
|
||||||
string path = fmtPath + "\\" + format + "all.xml";
|
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -301,12 +263,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
fmtfi = new FileInfo(path);
|
fmtfi = new FileInfo(path);
|
||||||
xd = new XmlDocument();
|
xd = new XmlDocument();
|
||||||
xd.Load(srf);
|
xd.Load(srf);
|
||||||
//xd.Load(path);
|
|
||||||
fmtdata = xd.OuterXml;
|
fmtdata = xd.OuterXml;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
OnFormatLoaded(null, new FormatEventArgs("Error Loading Format " + format));
|
OnFormatLoaded(null, new FormatEventArgs($"Error Loading Format {format}"));
|
||||||
_MyLog.ErrorFormat("AddFormatToDB('{0}','{1}')", (parent == null)?"Base": parent.Name, path);
|
_MyLog.ErrorFormat("AddFormatToDB('{0}','{1}')", (parent == null)?"Base": parent.Name, path);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -315,8 +276,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// Do we need genmac - only if non-subformat
|
// Do we need genmac - only if non-subformat
|
||||||
if (!issub)
|
if (!issub)
|
||||||
{
|
{
|
||||||
//path = "c:\\development\\genmacall\\" + format + ".svg";
|
path = $"{genmacPath}\\{format}.svg";
|
||||||
path = genmacPath + "\\" + format + ".svg";
|
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -327,9 +287,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//xdg.Load(path);
|
//xdg.Load(path);
|
||||||
genmacdata = xdg.OuterXml;
|
genmacdata = xdg.OuterXml;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
//frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
|
|
||||||
_MyLog.ErrorFormat("AddFormatToDB('{0}','{1}')", parent.Name, path);
|
_MyLog.ErrorFormat("AddFormatToDB('{0}','{1}')", parent.Name, path);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -344,9 +303,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (parent != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
XmlNode nmnode = xd.SelectSingleNode("//FormatData");
|
XmlNode nmnode = xd.SelectSingleNode("//FormatData");
|
||||||
if (nmnode is XmlElement)
|
if (nmnode is XmlElement xm)
|
||||||
{
|
{
|
||||||
XmlElement xm = (XmlElement)nmnode;
|
|
||||||
nmattr = xm.GetAttribute("Name");
|
nmattr = xm.GetAttribute("Name");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -369,40 +327,39 @@ namespace VEPROMS.CSLA.Library
|
|||||||
rec = rec.Save();
|
rec = rec.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
//frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
|
//Do Nothing --- if Debugging: frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
|
||||||
}
|
}
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
//C2025-023 - Electronic Procedures - Modifications to PROMS
|
//C2025-023 - Electronic Procedures - Modifications to PROMS
|
||||||
//Procedure to load the EP format fiels into the DB
|
//Procedure to load the EP format fiels into the DB
|
||||||
private static void AddEPFormatToDB(string formatname, DateTime Dts, string Userid, string epPath)
|
private static void AddEPFormatToDB(string formatname, string Userid, string epPath)
|
||||||
{
|
{
|
||||||
string fmtdata = null;
|
string fmtdata = null;
|
||||||
FileInfo fmtfi = null;
|
OnFormatLoaded(null, new FormatEventArgs($"Loading Format {formatname}"));
|
||||||
XmlDocument xd = null;
|
|
||||||
|
|
||||||
OnFormatLoaded(null, new FormatEventArgs("Loading Format " + formatname));
|
string path = Path.Combine(epPath, $"{formatname}.xml");
|
||||||
|
|
||||||
string path = Path.Combine(epPath, formatname + ".xml");
|
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (StreamReader srf = new StreamReader(path))
|
using (StreamReader srf = new StreamReader(path))
|
||||||
{
|
{
|
||||||
fmtfi = new FileInfo(path);
|
FileInfo fmtfi = new FileInfo(path);
|
||||||
xd = new XmlDocument();
|
XmlDocument xd = new XmlDocument
|
||||||
xd.XmlResolver = null;
|
{
|
||||||
|
XmlResolver = null
|
||||||
|
};
|
||||||
xd.Load(srf);
|
xd.Load(srf);
|
||||||
fmtdata = xd.OuterXml;
|
fmtdata = xd.OuterXml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
OnFormatLoaded(null, new FormatEventArgs("Error Loading Format " + formatname));
|
OnFormatLoaded(null, new FormatEventArgs($"Error Loading Format {formatname}"));
|
||||||
_MyLog.ErrorFormat($"AddEPFormatToDB('{path}')");
|
_MyLog.ErrorFormat($"AddEPFormatToDB('{path}')");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -414,7 +371,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
EPFormatFile.UpdateEPFormat(formatname, fmtdata, Userid);
|
EPFormatFile.UpdateEPFormat(formatname, fmtdata, Userid);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
_MyLog.ErrorFormat($"AddFormatToDB-make format('{path}')");
|
_MyLog.ErrorFormat($"AddFormatToDB-make format('{path}')");
|
||||||
}
|
}
|
||||||
@@ -441,12 +398,9 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
private class FormatIDCriteria
|
private class FormatIDCriteria
|
||||||
{
|
{
|
||||||
private int _FormatID;
|
private readonly int _FormatID;
|
||||||
public int FormatID { get { return _FormatID; } }
|
public int FormatID => _FormatID;
|
||||||
public FormatIDCriteria(int formatID)
|
public FormatIDCriteria(int formatID) => _FormatID = formatID;
|
||||||
{
|
|
||||||
_FormatID = formatID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(FormatIDCriteria criteria)
|
private void DataPortal_Fetch(FormatIDCriteria criteria)
|
||||||
{
|
{
|
||||||
@@ -479,15 +433,8 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//end transition report stuff
|
//end transition report stuff
|
||||||
public virtual Format GetJustFormat()
|
public virtual Format GetJustFormat() => _Editable = Format.GetJustFormat(_FormatID);
|
||||||
{
|
public static bool HasLatestChanges() => HasSeqTabFmtTabToken();
|
||||||
return _Editable = Format.GetJustFormat(_FormatID);
|
|
||||||
}
|
|
||||||
public static bool HasLatestChanges()
|
|
||||||
{
|
|
||||||
if (!HasSeqTabFmtTabToken()) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
private static bool HasSeqTabFmtTabToken()
|
private static bool HasSeqTabFmtTabToken()
|
||||||
{
|
{
|
||||||
using (FormatInfo fi = FormatInfo.Get("WCN2"))
|
using (FormatInfo fi = FormatInfo.Get("WCN2"))
|
||||||
@@ -517,17 +464,13 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
return _PROMSBaseFormat;
|
return _PROMSBaseFormat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void Reset()
|
public static void Reset() => _PROMSBaseFormat = null;
|
||||||
{
|
|
||||||
_PROMSBaseFormat = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FormatInfo Get(string name)
|
public static FormatInfo Get(string name)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FormatInfo tmp = DataPortal.Fetch<FormatInfo>(new NameCriteria(name));
|
FormatInfo tmp = DataPortal.Fetch<FormatInfo>(new NameCriteria(name));
|
||||||
//AddToCache(tmp);
|
|
||||||
if (tmp.ErrorMessage == "No Record Found")
|
if (tmp.ErrorMessage == "No Record Found")
|
||||||
{
|
{
|
||||||
tmp.Dispose(); // Clean-up FormatInfo
|
tmp.Dispose(); // Clean-up FormatInfo
|
||||||
@@ -563,13 +506,9 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
}
|
}
|
||||||
protected class NameCriteria
|
protected class NameCriteria
|
||||||
{
|
{
|
||||||
private string _Name;
|
private readonly string _Name;
|
||||||
public string Name
|
public string Name => _Name;
|
||||||
{ get { return _Name; } }
|
public NameCriteria(string name) => _Name = name;
|
||||||
public NameCriteria(string name)
|
|
||||||
{
|
|
||||||
_Name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(NameCriteria criteria)
|
private void DataPortal_Fetch(NameCriteria criteria)
|
||||||
{
|
{
|
||||||
@@ -611,16 +550,10 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
#region PlantFormat
|
#region PlantFormat
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private PlantFormat _PlantFormat;
|
private PlantFormat _PlantFormat;
|
||||||
public PlantFormat PlantFormat
|
public PlantFormat PlantFormat => _PlantFormat ?? (_PlantFormat = new PlantFormat(this, Config));
|
||||||
{ get { return (_PlantFormat != null ? _PlantFormat : _PlantFormat = new PlantFormat(this, Config)); } }
|
|
||||||
#endregion
|
#endregion
|
||||||
public IFormatOrFormatInfo MyIParent { get { return MyParent; } }
|
public IFormatOrFormatInfo MyIParent => MyParent;
|
||||||
public override string ToString()
|
public override string ToString() => FullName;
|
||||||
{
|
|
||||||
//return Name;
|
|
||||||
//return PlantFormat.FormatData.Name;
|
|
||||||
return FullName;
|
|
||||||
}
|
|
||||||
public string FullName
|
public string FullName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -632,14 +565,8 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
return MyParent.Description + " - " + Description + " (" + Name + ")";
|
return MyParent.Description + " - " + Description + " (" + Name + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public StepSectionLayoutData MyStepSectionLayoutData
|
public StepSectionLayoutData MyStepSectionLayoutData => PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData;
|
||||||
{
|
public StepSectionPrintData MyStepSectionPrintData => PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData;
|
||||||
get { return PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData; }
|
|
||||||
}
|
|
||||||
public StepSectionPrintData MyStepSectionPrintData
|
|
||||||
{
|
|
||||||
get { return PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class FormatInfoList
|
public partial class FormatInfoList
|
||||||
{
|
{
|
||||||
@@ -658,6 +585,7 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
throw new DbCslaException("Error on FormatInfoList.GetAll", ex);
|
throw new DbCslaException("Error on FormatInfoList.GetAll", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping until replace CSLA")]
|
||||||
private void DataPortal_Fetch(CriteriaAllFormats myCrit)
|
private void DataPortal_Fetch(CriteriaAllFormats myCrit)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
this.RaiseListChangedEvents = false;
|
||||||
@@ -716,6 +644,7 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
protected class FormatInfoListUsedCriteria
|
protected class FormatInfoListUsedCriteria
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping until replace CSLA")]
|
||||||
private void DataPortal_Fetch(FormatInfoListUsedCriteria criteria)
|
private void DataPortal_Fetch(FormatInfoListUsedCriteria criteria)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -749,12 +678,12 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
|||||||
}
|
}
|
||||||
public class FormatVersion
|
public class FormatVersion
|
||||||
{
|
{
|
||||||
private string _Title;
|
private readonly string _Title;
|
||||||
public string Title { get { return _Title; } }
|
public string Title => _Title;
|
||||||
private int _FormatID;
|
private readonly int _FormatID;
|
||||||
public int FormatID { get { return _FormatID; } }
|
public int FormatID => _FormatID;
|
||||||
private int _VersionID;
|
private readonly int _VersionID;
|
||||||
public int VersionID { get { return _VersionID; } }
|
public int VersionID => _VersionID;
|
||||||
public FormatVersion(string title, int formatID, int versionID)
|
public FormatVersion(string title, int formatID, int versionID)
|
||||||
{
|
{
|
||||||
_Title = title;
|
_Title = title;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
@@ -12,16 +11,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// B2022-047 - refresh the Content/Text field for table. Get all grids in database.
|
// B2022-047 - refresh the Content/Text field for table. Get all grids in database.
|
||||||
public class CriteriaAllGridIds
|
public class CriteriaAllGridIds
|
||||||
{
|
{
|
||||||
bool _AllGridIds;
|
public bool AllGridIds { get; set; }
|
||||||
public bool AllGridIds
|
public CriteriaAllGridIds(bool allGridIds) => AllGridIds = allGridIds;
|
||||||
{
|
|
||||||
get { return _AllGridIds; }
|
|
||||||
set { _AllGridIds = value; }
|
|
||||||
}
|
|
||||||
public CriteriaAllGridIds(bool allGridIds)
|
|
||||||
{
|
|
||||||
_AllGridIds = allGridIds;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
[TypeConverter(typeof(FormatInfoListConverter))]
|
[TypeConverter(typeof(FormatInfoListConverter))]
|
||||||
@@ -30,51 +21,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Log4Net
|
#region Log4Net
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#endregion
|
#endregion
|
||||||
internal new IList<GridInfo> Items
|
|
||||||
{ get { return base.Items; } }
|
|
||||||
private bool _Disposed = false;
|
private bool _Disposed = false;
|
||||||
private static int _CountCreated = 0;
|
|
||||||
private static int _CountDisposed = 0;
|
|
||||||
private static int _CountFinalized = 0;
|
|
||||||
private static int IncrementCountCreated
|
|
||||||
{ get { return ++_CountCreated; } }
|
|
||||||
private int _CountWhenCreated = IncrementCountCreated;
|
|
||||||
public static int CountCreated
|
|
||||||
{ get { return _CountCreated; } }
|
|
||||||
public static int CountNotDisposed
|
|
||||||
{ get { return _CountCreated - _CountDisposed; } }
|
|
||||||
public static int CountNotFinalized
|
|
||||||
{ get { return _CountCreated - _CountFinalized; } }
|
|
||||||
~GridInfoList()
|
|
||||||
{
|
|
||||||
_CountFinalized++;
|
|
||||||
}
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (_Disposed) return;
|
if (_Disposed) return;
|
||||||
_CountDisposed++;
|
|
||||||
_Disposed = true;
|
_Disposed = true;
|
||||||
}
|
}
|
||||||
public static GridInfoList _GridInfoList = null;
|
public static GridInfoList _GridInfoList = null;
|
||||||
/// <summary>
|
|
||||||
/// Return a list of all GridInfo. Commented out - GridInfoList was added to fix B2022-047. Have this code here in
|
|
||||||
/// case it is needed in the future.
|
|
||||||
/// </summary>
|
|
||||||
//public static GridInfoList Get()
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// if (_GridInfoList != null)
|
|
||||||
// return _GridInfoList;
|
|
||||||
// GridInfoList tmp = DataPortal.Fetch<GridInfoList>();
|
|
||||||
// _GridInfoList = tmp;
|
|
||||||
// return tmp;
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// throw new DbCslaException("Error on FormatInfoList.Get", ex);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
public static List<int> GetIds()
|
public static List<int> GetIds()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -108,44 +61,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Error on GridInfoList.Get", ex);
|
throw new DbCslaException("Error on GridInfoList.Get", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Commented out - GridInfoList was added to fix B2022-047. Have this code here in
|
|
||||||
// case it is needed in the future. The associated query 'getGrids' does not exist.
|
|
||||||
//private void DataPortal_Fetch()
|
|
||||||
//{
|
|
||||||
// this.RaiseListChangedEvents = false;
|
|
||||||
// if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GridInfoList.DataPortal_Fetch", GetHashCode());
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
|
||||||
// {
|
|
||||||
// using (SqlCommand cm = cn.CreateCommand())
|
|
||||||
// {
|
|
||||||
// cm.CommandType = CommandType.StoredProcedure;
|
|
||||||
// cm.CommandText = "getGrids";
|
|
||||||
// cm.CommandTimeout = Database.DefaultTimeout;
|
|
||||||
// using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
|
||||||
// {
|
|
||||||
// IsReadOnly = false;
|
|
||||||
// while (dr.Read()) this.Add(new GridInfo(dr));
|
|
||||||
// IsReadOnly = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// if (_MyLog.IsErrorEnabled) _MyLog.Error("GridInfoList.DataPortal_Fetch", ex);
|
|
||||||
// throw new DbCslaException("GridInfoList.DataPortal_Fetch", ex);
|
|
||||||
// }
|
|
||||||
// this.RaiseListChangedEvents = true;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
public partial class GridInfo
|
public partial class GridInfo
|
||||||
{
|
{
|
||||||
public void ResetContent(Grid myGrid)
|
public void ResetContent(Grid myGrid) => RefreshFields(myGrid);
|
||||||
{
|
|
||||||
RefreshFields(myGrid);
|
|
||||||
}
|
|
||||||
public void SetData(string myData)
|
public void SetData(string myData)
|
||||||
{
|
{
|
||||||
_Data = myData;
|
_Data = myData;
|
||||||
@@ -153,8 +72,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public static GridInfo GetNonCached(int contentID)
|
public static GridInfo GetNonCached(int contentID)
|
||||||
{
|
{
|
||||||
//if (!CanGetObject())
|
|
||||||
// throw new System.Security.SecurityException("User not authorized to view a Grid");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GridInfo tmp = DataPortal.Fetch<GridInfo>(new PKCriteria(contentID));
|
GridInfo tmp = DataPortal.Fetch<GridInfo>(new PKCriteria(contentID));
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,8 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
public partial class ItemInfo
|
public partial class ItemInfo
|
||||||
{
|
{
|
||||||
public ItemInfo SearchNext
|
public ItemInfo SearchNext => SearchNextSkip(SkipPartType.This);
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return SearchNextSkip(SkipPartType.This);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private ItemInfo SearchNextSkip(SkipPartType skip)
|
private ItemInfo SearchNextSkip(SkipPartType skip)
|
||||||
{
|
{
|
||||||
if (skip < SkipPartType.Caution && Cautions != null && Cautions.Count > 0) return Cautions[0].SearchTop;
|
if (skip < SkipPartType.Caution && Cautions != null && Cautions.Count > 0) return Cautions[0].SearchTop;
|
||||||
@@ -28,8 +18,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
bool iseditable = true;
|
bool iseditable = true;
|
||||||
if (IsSection)
|
if (IsSection)
|
||||||
{
|
{
|
||||||
SectionConfig sc = MyConfig as SectionConfig;
|
if (MyConfig is SectionConfig sc && sc.SubSection_Edit != "Y") iseditable = false;
|
||||||
if (sc != null && sc.SubSection_Edit != "Y") iseditable = false;
|
|
||||||
}
|
}
|
||||||
if (iseditable && skip < SkipPartType.Steps && Steps != null && Steps.Count > 0) return Steps[0].SearchTop;
|
if (iseditable && skip < SkipPartType.Steps && Steps != null && Steps.Count > 0) return Steps[0].SearchTop;
|
||||||
|
|
||||||
@@ -49,8 +38,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
ItemInfo parentItem = ActiveParent as ItemInfo;
|
if (!(ActiveParent is ItemInfo parentItem)) return null;
|
||||||
if (parentItem == null) return null;
|
|
||||||
if (IsCautionPart) return parentItem.SearchNextSkip(SkipPartType.Caution);
|
if (IsCautionPart) return parentItem.SearchNextSkip(SkipPartType.Caution);
|
||||||
if (IsNotePart) return parentItem.SearchNextSkip(SkipPartType.Note);
|
if (IsNotePart) return parentItem.SearchNextSkip(SkipPartType.Note);
|
||||||
if (IsRNOPart) return parentItem.SearchNextSkip(SkipPartType.RNO);
|
if (IsRNOPart) return parentItem.SearchNextSkip(SkipPartType.RNO);
|
||||||
@@ -63,13 +51,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return parentItem.UpOneNext;
|
return parentItem.UpOneNext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public ItemInfo SearchPrev
|
public ItemInfo SearchPrev => SearchPrevSkip(SkipPartType.This);
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return SearchPrevSkip(SkipPartType.This);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private ItemInfo SearchPrevSkip(SkipPartType skip)
|
private ItemInfo SearchPrevSkip(SkipPartType skip)
|
||||||
{
|
{
|
||||||
if (skip > SkipPartType.Steps && Steps != null) return Steps[0].LastSibling.SearchBottom;
|
if (skip > SkipPartType.Steps && Steps != null) return Steps[0].LastSibling.SearchBottom;
|
||||||
@@ -101,8 +83,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
ItemInfo parentItem = ActiveParent as ItemInfo;
|
if (!(ActiveParent is ItemInfo parentItem)) return null;
|
||||||
if (parentItem == null) return null;
|
|
||||||
if (IsCautionPart) return parentItem.SearchPrevSkip(SkipPartType.Caution);
|
if (IsCautionPart) return parentItem.SearchPrevSkip(SkipPartType.Caution);
|
||||||
if (IsNotePart) return parentItem.SearchPrevSkip(SkipPartType.Note);
|
if (IsNotePart) return parentItem.SearchPrevSkip(SkipPartType.Note);
|
||||||
if (IsRNOPart) return parentItem.SearchPrevSkip(SkipPartType.RNO);
|
if (IsRNOPart) return parentItem.SearchPrevSkip(SkipPartType.RNO);
|
||||||
|
|||||||
@@ -1,35 +1,24 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
public delegate void ItemInfoInsertEvent(object sender, ItemInfoInsertEventArgs args);
|
public delegate void ItemInfoInsertEvent(object sender, ItemInfoInsertEventArgs args);
|
||||||
public class ItemInfoInsertEventArgs
|
public class ItemInfoInsertEventArgs
|
||||||
{
|
{
|
||||||
private ItemInfo _ItemInserted;
|
public ItemInfo ItemInserted { get; set; }
|
||||||
public ItemInfo ItemInserted
|
public ItemInfo.EAddpingPart AddingPart { get; set; }
|
||||||
{
|
|
||||||
get { return _ItemInserted; }
|
|
||||||
set { _ItemInserted = value; }
|
|
||||||
}
|
|
||||||
private ItemInfo.EAddpingPart _AddingPart;
|
|
||||||
public ItemInfo.EAddpingPart AddingPart
|
|
||||||
{
|
|
||||||
get { return _AddingPart; }
|
|
||||||
set { _AddingPart = value; }
|
|
||||||
}
|
|
||||||
public ItemInfoInsertEventArgs(ItemInfo itemInserted,ItemInfo.EAddpingPart addingPart)
|
public ItemInfoInsertEventArgs(ItemInfo itemInserted,ItemInfo.EAddpingPart addingPart)
|
||||||
{
|
{
|
||||||
_ItemInserted = itemInserted;
|
ItemInserted = itemInserted;
|
||||||
_AddingPart = addingPart;
|
AddingPart = addingPart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public partial class ItemInfo
|
public partial class ItemInfo
|
||||||
@@ -39,7 +28,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// C2020-033: The dialog message has been changed to reference the Tools/Search/Incoming Transitions tab and
|
// C2020-033: The dialog message has been changed to reference the Tools/Search/Incoming Transitions tab and
|
||||||
// the return value was changed to return null (this was returning first in list, but now user gets all
|
// the return value was changed to return null (this was returning first in list, but now user gets all
|
||||||
// listed in the search dialog). This comment is for each of the dialogs below.
|
// listed in the search dialog). This comment is for each of the dialogs below.
|
||||||
string itemDesc = this.GetTypeDescription(); // C2020-018 made the message more accurate when deleting a Procedure, Section, or Step
|
string itemDesc = GetTypeDescription(); // C2020-018 made the message more accurate when deleting a Procedure, Section, or Step
|
||||||
if (ex.Message.Contains("has External Transitions and has no next step"))
|
if (ex.Message.Contains("has External Transitions and has no next step"))
|
||||||
{
|
{
|
||||||
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
|
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
|
||||||
@@ -75,8 +64,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
|
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
|
||||||
{
|
{
|
||||||
//C2020-018 build the message based on the type description
|
//C2020-018 build the message based on the type description
|
||||||
string msg1 = string.Format("Transitions exist to {0} this {1} and cannot be adjusted automatically.", (this.IsSection) ? "steps in" : "children of", itemDesc);
|
string msg1 = string.Format("Transitions exist to {0} this {1} and cannot be adjusted automatically.", (IsSection) ? "steps in" : "children of", itemDesc);
|
||||||
DialogResult ans = FlexibleMessageBox.Show(msg1 +
|
_ = FlexibleMessageBox.Show(msg1 +
|
||||||
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
|
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
|
||||||
"Cannot Delete This " + itemDesc, MessageBoxButtons.OK, MessageBoxIcon.Information);
|
"Cannot Delete This " + itemDesc, MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
@@ -85,114 +74,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
FlexibleMessageBox.Show(ex.Message, "SQL Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
FlexibleMessageBox.Show(ex.Message, "SQL Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Old Insert
|
|
||||||
//public ItemInfo InsertSiblingBeforeOld(string text)
|
|
||||||
//{
|
|
||||||
// return InsertSiblingBefore(text, null);
|
|
||||||
//}
|
|
||||||
//public ItemInfo InsertSiblingBeforeOld(string text, string number)
|
|
||||||
//{
|
|
||||||
// ItemInfo prevItemInfo = MyPrevious;
|
|
||||||
// ItemInfo newItemInfo = null;
|
|
||||||
// PartInfoList partInfoList = null;
|
|
||||||
// if (MyParent != null && MyParent.MyContent != null)
|
|
||||||
// {
|
|
||||||
// MyParent.MyContent.RefreshContentParts();
|
|
||||||
// partInfoList = MyParent.MyContent.ContentParts;
|
|
||||||
// }
|
|
||||||
// using (Item prevItem = prevItemInfo == null ? null : prevItemInfo.Get()) // Get the previous Item
|
|
||||||
// {
|
|
||||||
// using (Item newItem = Item.MakeItem(prevItem, Content.MakeContent(number, text, MyContent.Type, null, null))) // Create the new Item
|
|
||||||
// {
|
|
||||||
// using (Item thisItem = Get()) // Get the next item in the list
|
|
||||||
// {
|
|
||||||
// thisItem.MyPrevious = newItem; // Point to the new item
|
|
||||||
// thisItem.Save(); // Save Changes
|
|
||||||
// if (prevItem == null)
|
|
||||||
// {
|
|
||||||
// PartInfo partInfo = partInfoList.Find(this);
|
|
||||||
// using (Part part = partInfo.Get())
|
|
||||||
// {
|
|
||||||
// part.MyItem = newItem;
|
|
||||||
// part.Save();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // ToDo: Need change PartInfo in PartInfoList
|
|
||||||
// newItemInfo = ItemInfo.Get(newItem.ItemID);
|
|
||||||
// newItemInfo.ResetOrdinal();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return newItemInfo;
|
|
||||||
//}
|
|
||||||
//public ItemInfo InsertSiblingAfterOld(string text)
|
|
||||||
//{
|
|
||||||
// return InsertSiblingAfter(text, null);
|
|
||||||
//}
|
|
||||||
//public ItemInfo InsertSiblingAfterOld(string text, string number)
|
|
||||||
//{
|
|
||||||
// return InsertSiblingAfter(text, number, MyContent.Type);
|
|
||||||
//}
|
|
||||||
//public ItemInfo InsertSiblingAfterOld(string text, string number, int? type)
|
|
||||||
//{
|
|
||||||
// ItemInfo nextItemInfo = NextItem;
|
|
||||||
// ItemInfo newItemInfo = null;
|
|
||||||
// using (Item thisItem = Get()) // Get the Current Item
|
|
||||||
// {
|
|
||||||
// using (Item newItem = Item.MakeItem(thisItem, Content.MakeContent(number, text, type, null, null))) // Create the new Item
|
|
||||||
// {
|
|
||||||
// if (nextItemInfo != null) // Simple case, adding to end of list:
|
|
||||||
// using (Item nextItem = nextItemInfo.Get()) // Get the next item in the list
|
|
||||||
// {
|
|
||||||
// nextItem.MyPrevious = newItem; // Point to the new item
|
|
||||||
// nextItem.Save(); // Save Changes
|
|
||||||
// }
|
|
||||||
// // ToDo: Need change PartInfo in PartInfoList
|
|
||||||
// newItemInfo = ItemInfo.Get(newItem.ItemID);
|
|
||||||
// newItemInfo.ResetOrdinal();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return newItemInfo;
|
|
||||||
//}
|
|
||||||
//public ItemInfo InsertChildOld(E_FromType fromType, int type, string text)
|
|
||||||
//{
|
|
||||||
// return InsertChild(fromType, type, text, null);
|
|
||||||
//}
|
|
||||||
//public ItemInfo InsertChildOld(E_FromType fromType, int type, string text, string number)
|
|
||||||
//{
|
|
||||||
// ItemInfo newItemInfo = null;
|
|
||||||
// using (Item thisItem = Get()) // Get the Current Item
|
|
||||||
// {
|
|
||||||
// using (Item newItem = Item.MakeItem(null, Content.MakeContent(number, text, type, null, null))) // Create the new Item
|
|
||||||
// {
|
|
||||||
// PartInfo partInfo = MyContent.ContentParts == null ? null : MyContent.ContentParts.Find(fromType);
|
|
||||||
// if (partInfo != null)
|
|
||||||
// {
|
|
||||||
// //this could be equivalent to adding a sibling with a specific type
|
|
||||||
// using (Part part = partInfo.Get())
|
|
||||||
// {
|
|
||||||
// part.MyItem.MyPrevious = newItem;
|
|
||||||
// part.MyItem.Save();
|
|
||||||
// part.MyItem = newItem;
|
|
||||||
// part.Save();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// // This means that a part needs to be added to point to the new item
|
|
||||||
// //using (Part part = Part.MakePart(thisItem.MyContent, ))
|
|
||||||
// //{ ;}
|
|
||||||
// thisItem.MyContent.ContentParts.Add((int)fromType, newItem);
|
|
||||||
// thisItem.Save();
|
|
||||||
// }
|
|
||||||
// newItemInfo = ItemInfo.Get(newItem.ItemID);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ResetParts();
|
|
||||||
// return newItemInfo;
|
|
||||||
//}
|
|
||||||
#endregion
|
|
||||||
#region Events
|
#region Events
|
||||||
public event ItemInfoEvent BeforeDelete;
|
public event ItemInfoEvent BeforeDelete;
|
||||||
public void OnBeforeDelete()
|
public void OnBeforeDelete()
|
||||||
@@ -209,16 +90,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if (ItemPartCount > 0)
|
|
||||||
//{
|
|
||||||
// foreach (PartInfo pi in ItemParts)
|
|
||||||
// {
|
|
||||||
// foreach (ItemInfo ii in pi.MyItems)
|
|
||||||
// {
|
|
||||||
// ii.OnBeforeDelete();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnBeforeDelete(int ItemID)
|
private void OnBeforeDelete(int ItemID)
|
||||||
@@ -227,10 +98,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
List<ItemInfo> itmlst = _CacheByPrimaryKey[ItemID.ToString()];
|
List<ItemInfo> itmlst = _CacheByPrimaryKey[ItemID.ToString()];
|
||||||
foreach (ItemInfo itm in itmlst)
|
foreach (ItemInfo itm in itmlst)
|
||||||
if (itm.BeforeDelete != null)
|
itm.BeforeDelete?.Invoke(itm);
|
||||||
{
|
|
||||||
itm.BeforeDelete(itm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static event ItemInfoEvent ItemDeleted;
|
public static event ItemInfoEvent ItemDeleted;
|
||||||
@@ -238,47 +106,30 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public event ItemInfoEvent Deleted;
|
public event ItemInfoEvent Deleted;
|
||||||
internal void OnDeleted(object sender)
|
internal void OnDeleted(object sender)
|
||||||
{
|
{
|
||||||
if (Deleted != null) Deleted(sender);
|
Deleted?.Invoke(sender);
|
||||||
if (ItemDeleted != null) ItemDeleted(sender);
|
ItemDeleted?.Invoke(sender);
|
||||||
if (MyParent != null)
|
if (MyParent != null)
|
||||||
{
|
{
|
||||||
MyParent.OnChildrenDeleted(sender);
|
MyParent.OnChildrenDeleted(sender);
|
||||||
MyParent.MyContent.RefreshContentParts();
|
MyParent.MyContent.RefreshContentParts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//internal void OnDeleted(object sender, Volian.Base.Library.VlnTimer tmr)
|
|
||||||
//{
|
|
||||||
//tmr.ActiveProcess = "Deleted";
|
|
||||||
//if (Deleted != null) Deleted(sender);
|
|
||||||
//tmr.ActiveProcess = "ItemDeleted";
|
|
||||||
//if (ItemDeleted != null) ItemDeleted(sender);
|
|
||||||
//if (MyParent != null)
|
|
||||||
//{
|
|
||||||
//tmr.ActiveProcess = "OnChildrenDeleted";
|
|
||||||
//MyParent.OnChildrenDeleted(sender);
|
|
||||||
//tmr.ActiveProcess = "RefreshContentParts";
|
|
||||||
//MyParent.MyContent.RefreshContentParts();
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
public event ItemInfoEvent ChildrenDeleted;
|
public event ItemInfoEvent ChildrenDeleted;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping sender for possible future use / debugging")]
|
||||||
internal void OnChildrenDeleted(object sender)
|
internal void OnChildrenDeleted(object sender)
|
||||||
{
|
{
|
||||||
if (_CacheByPrimaryKey.ContainsKey(ItemID.ToString()))
|
if (_CacheByPrimaryKey.ContainsKey(ItemID.ToString()))
|
||||||
{
|
{
|
||||||
List<ItemInfo> itmlst = _CacheByPrimaryKey[ItemID.ToString()];
|
List<ItemInfo> itmlst = _CacheByPrimaryKey[ItemID.ToString()];
|
||||||
foreach (ItemInfo itm in itmlst)
|
foreach (ItemInfo itm in itmlst)
|
||||||
if (itm.ChildrenDeleted != null)
|
itm.ChildrenDeleted?.Invoke(itm);
|
||||||
{
|
|
||||||
itm.ChildrenDeleted(itm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public event ItemInfoInsertEvent NewSiblingAfter;
|
public event ItemInfoInsertEvent NewSiblingAfter;
|
||||||
internal void OnNewSiblingAfter(object sender, ItemInfoInsertEventArgs args)
|
internal void OnNewSiblingAfter(object sender, ItemInfoInsertEventArgs args)
|
||||||
{
|
{
|
||||||
if (NewSiblingAfter != null) NewSiblingAfter(sender,args);
|
NewSiblingAfter?.Invoke(sender, args);
|
||||||
if (MyParent != null)
|
MyParent?.MyContent.RefreshContentParts();
|
||||||
MyParent.MyContent.RefreshContentParts();
|
|
||||||
}
|
}
|
||||||
internal void OnNewSiblingAfter(ItemInfoInsertEventArgs args)
|
internal void OnNewSiblingAfter(ItemInfoInsertEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -295,9 +146,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public event ItemInfoInsertEvent NewSiblingBefore;
|
public event ItemInfoInsertEvent NewSiblingBefore;
|
||||||
internal void OnNewSiblingBefore(object sender, ItemInfoInsertEventArgs args)
|
internal void OnNewSiblingBefore(object sender, ItemInfoInsertEventArgs args)
|
||||||
{
|
{
|
||||||
if (NewSiblingBefore != null) NewSiblingBefore(sender,args);
|
NewSiblingBefore?.Invoke(sender, args);
|
||||||
if (MyParent != null)
|
MyParent?.MyContent.RefreshContentParts();
|
||||||
MyParent.MyContent.RefreshContentParts();
|
|
||||||
}
|
}
|
||||||
internal void OnNewSiblingBefore(ItemInfoInsertEventArgs args)
|
internal void OnNewSiblingBefore(ItemInfoInsertEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -314,7 +164,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public event ItemInfoInsertEvent NewChild;
|
public event ItemInfoInsertEvent NewChild;
|
||||||
internal void OnNewChild(object sender, ItemInfoInsertEventArgs args)
|
internal void OnNewChild(object sender, ItemInfoInsertEventArgs args)
|
||||||
{
|
{
|
||||||
if (NewChild != null) NewChild(sender, args);
|
NewChild?.Invoke(sender, args);
|
||||||
MyContent.RefreshContentParts();
|
MyContent.RefreshContentParts();
|
||||||
}
|
}
|
||||||
internal void OnNewChild(ItemInfoInsertEventArgs args)
|
internal void OnNewChild(ItemInfoInsertEventArgs args)
|
||||||
@@ -331,14 +181,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Insert Before
|
#region Insert Before
|
||||||
public ItemInfo InsertSiblingBefore(string text)
|
public ItemInfo InsertSiblingBefore(string text) => InsertSiblingBefore(text, null);
|
||||||
{
|
public ItemInfo InsertSiblingBefore(string text, string number) => InsertSiblingBefore(text, number, null);
|
||||||
return InsertSiblingBefore(text, null);
|
|
||||||
}
|
|
||||||
public ItemInfo InsertSiblingBefore(string text, string number)
|
|
||||||
{
|
|
||||||
return InsertSiblingBefore(text, number, null);
|
|
||||||
}
|
|
||||||
public ItemInfo InsertSiblingBefore(string text, string number,int? type)
|
public ItemInfo InsertSiblingBefore(string text, string number,int? type)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp = null;
|
||||||
@@ -521,7 +365,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
: (cpItem.IsSection ? E_FromType.Section : E_FromType.Step)));
|
: (cpItem.IsSection ? E_FromType.Section : E_FromType.Step)));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, this.ItemID, type, fromtype, EAddpingPart.Child);
|
ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, ItemID, type, fromtype, EAddpingPart.Child);
|
||||||
using (Item item = Get()) ItemInfo.Refresh(item);
|
using (Item item = Get()) ItemInfo.Refresh(item);
|
||||||
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
|
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
|
||||||
RefreshNextItems();
|
RefreshNextItems();
|
||||||
@@ -563,17 +407,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return GetMaxSubStepLevel(cpyItem);
|
return GetMaxSubStepLevel(cpyItem);
|
||||||
}
|
}
|
||||||
// F2021-009 Find the number of defined sequential tabs. We use this to determin the number of defined sub-step levels
|
// F2021-009 Find the number of defined sequential tabs. We use this to determin the number of defined sub-step levels
|
||||||
public int GetDefinedSubStepCount()
|
public int GetDefinedSubStepCount() => GetDefinedSubStepCount(this);
|
||||||
{
|
|
||||||
return GetDefinedSubStepCount(this);
|
|
||||||
}
|
|
||||||
// F2021-009 Find the number of defined sequential tabs. We use this to determin the number of defined sub-step levels
|
// F2021-009 Find the number of defined sequential tabs. We use this to determin the number of defined sub-step levels
|
||||||
public static int GetDefinedSubStepCount(ItemInfo curStep)
|
public static int GetDefinedSubStepCount(ItemInfo curStep) => curStep.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList.Count - 1; // -1 to account for the high level step level
|
||||||
{
|
|
||||||
int cnt = 0;
|
|
||||||
cnt = curStep.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList.Count;
|
|
||||||
return cnt-1; // -1 to account for the high level step level
|
|
||||||
}
|
|
||||||
// F2021-009 for PROMS Express, display a message if the Paste of a CopyStep will results in sub-step levels
|
// F2021-009 for PROMS Express, display a message if the Paste of a CopyStep will results in sub-step levels
|
||||||
// greater than what is defined in the format
|
// greater than what is defined in the format
|
||||||
public static bool PasteStepIsWithinDefinedSubStepLevels(int copyStartID, ItemInfo pasteTarget, bool doingReplace)
|
public static bool PasteStepIsWithinDefinedSubStepLevels(int copyStartID, ItemInfo pasteTarget, bool doingReplace)
|
||||||
@@ -601,7 +437,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// B2023-049: crash when copied step is no longer available (may have been deleted in previous operation)
|
// B2023-049: crash when copied step is no longer available (may have been deleted in previous operation)
|
||||||
if (cpyItem == null)
|
if (cpyItem == null)
|
||||||
{
|
{
|
||||||
DialogResult msgBoxResult = FlexibleMessageBox.Show("The step you are pasting no longer exists - it may have been deleted as part of a previous operation.", "Paste Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
_ = FlexibleMessageBox.Show("The step you are pasting no longer exists - it may have been deleted as part of a previous operation.", "Paste Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// B2017-065 use MyContent instead of _Mycontent so that if null it will get the needed content
|
// B2017-065 use MyContent instead of _Mycontent so that if null it will get the needed content
|
||||||
@@ -616,31 +452,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// B2016-009 - added a message box explaining to the user that the copyed step will take on the destination type. 16-bit PROMS had also done this way.
|
|
||||||
// - this one is used for Insert Copyed step Before or After
|
|
||||||
// C2022-017 Added a Cancel button to the message box to allow the user to cancel the paste operation
|
|
||||||
private bool CheckSourceDestinationType(int? DestType, int? SourceType)
|
|
||||||
{
|
|
||||||
if (DestType >= 20000 && DestType != SourceType)
|
|
||||||
{
|
|
||||||
string msg = "The step you are copying TO is a different type than the step you are copying FROM.\n\nThe copied step will inherit the destination step type.\n\nOnce copied, the step type can be changed from the Tags tab on the Step Properties panel.";
|
|
||||||
DialogResult msgBoxResult = FlexibleMessageBox.Show(msg, "Different Step Types", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
|
|
||||||
if (msgBoxResult == DialogResult.Cancel)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public ItemInfo PasteSiblingBefore(int copyStartID, string chgid)
|
public ItemInfo PasteSiblingBefore(int copyStartID, string chgid)
|
||||||
{
|
{
|
||||||
// To determine 'type' of pasted item, if it's a step (type >=20000), use the originating
|
// To determine 'type' of pasted item, if it's a step (type >=20000), use the originating
|
||||||
// item, i.e. item inserting after. If it's a section or procedure, use the copied item's type.
|
// item, i.e. item inserting after. If it's a section or procedure, use the copied item's type.
|
||||||
ItemInfo cpItem = ItemInfo.Get(copyStartID);
|
ItemInfo cpItem = ItemInfo.Get(copyStartID);
|
||||||
// B2016-009 check source and desintation types and display message box if needed
|
// B2016-009 check source and desintation types and display message box if needed
|
||||||
// C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon
|
|
||||||
int? type = MyContent.Type >= 20000 ? MyContent.Type : cpItem.MyContent.Type;
|
int? type = MyContent.Type >= 20000 ? MyContent.Type : cpItem.MyContent.Type;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, this.ItemID, type, type, EAddpingPart.Before);
|
ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, ItemID, type, type, EAddpingPart.Before);
|
||||||
using (Item item = Get()) ItemInfo.Refresh(item);
|
using (Item item = Get()) ItemInfo.Refresh(item);
|
||||||
tmp.UpdateTransitionText();
|
tmp.UpdateTransitionText();
|
||||||
tmp.UpdateROText();
|
tmp.UpdateROText();
|
||||||
@@ -663,11 +484,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// item, i.e. item inserting after. If it's a section or procedure, use the copied item's type.
|
// item, i.e. item inserting after. If it's a section or procedure, use the copied item's type.
|
||||||
ItemInfo cpItem = ItemInfo.Get(copyStartID);
|
ItemInfo cpItem = ItemInfo.Get(copyStartID);
|
||||||
// B2016-009 check source and desintation types and display message box if needed
|
// B2016-009 check source and desintation types and display message box if needed
|
||||||
// C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon
|
|
||||||
int? type = MyContent.Type >= 20000 ? MyContent.Type : cpItem.MyContent.Type;
|
int? type = MyContent.Type >= 20000 ? MyContent.Type : cpItem.MyContent.Type;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, this.ItemID, type, type, EAddpingPart.After);
|
ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, ItemID, type, type, EAddpingPart.After);
|
||||||
using (Item item = Get()) ItemInfo.Refresh(item);
|
using (Item item = Get()) ItemInfo.Refresh(item);
|
||||||
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
|
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
|
||||||
RefreshNextItems();
|
RefreshNextItems();
|
||||||
@@ -712,7 +532,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
private ItemInfo CopyPasteItemInfoFetch(int copyStartID, int itemID, int? type, int? fromType, EAddpingPart addType)
|
private ItemInfo CopyPasteItemInfoFetch(int copyStartID, int itemID, int? type, int? fromType, EAddpingPart addType)
|
||||||
{
|
{
|
||||||
ItemInfo tmp=null;
|
ItemInfo tmp;
|
||||||
if (addType == EAddpingPart.Child) // has to add in child relationship - uses 'fromtype'
|
if (addType == EAddpingPart.Child) // has to add in child relationship - uses 'fromtype'
|
||||||
{
|
{
|
||||||
// adding children. Type is based on 'fromType'
|
// adding children. Type is based on 'fromType'
|
||||||
@@ -744,14 +564,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Insert After
|
#region Insert After
|
||||||
public ItemInfo InsertSiblingAfter(string text)
|
public ItemInfo InsertSiblingAfter(string text) => InsertSiblingAfter(text, null);
|
||||||
{
|
public ItemInfo InsertSiblingAfter(string text, string number) => InsertSiblingAfter(text, number, MyContent.Type);
|
||||||
return InsertSiblingAfter(text, null);
|
|
||||||
}
|
|
||||||
public ItemInfo InsertSiblingAfter(string text, string number)
|
|
||||||
{
|
|
||||||
return InsertSiblingAfter(text, number, MyContent.Type);
|
|
||||||
}
|
|
||||||
public ItemInfo InsertSiblingAfter(string text, string number, int? type)
|
public ItemInfo InsertSiblingAfter(string text, string number, int? type)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null; // KBR need template code in tree view?
|
ItemInfo tmp = null; // KBR need template code in tree view?
|
||||||
@@ -807,10 +621,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public void UpdateTransitionText()
|
public void UpdateTransitionText()
|
||||||
{
|
{
|
||||||
// Update Ordinals from here down for Steps
|
// Update Ordinals from here down for Steps
|
||||||
//if (!IsStep) return;
|
|
||||||
ResetOrdinal();
|
ResetOrdinal();
|
||||||
// This returns a list of all of the transitions that may have been affected
|
// This returns a list of all of the transitions that may have been affected
|
||||||
using(TransitionInfoList trans = TransitionInfoList.GetAffected(this.ItemID))
|
using(TransitionInfoList trans = TransitionInfoList.GetAffected(ItemID))
|
||||||
{
|
{
|
||||||
#region B2012-071 fix JCB
|
#region B2012-071 fix JCB
|
||||||
foreach (TransitionInfo tran in trans)
|
foreach (TransitionInfo tran in trans)
|
||||||
@@ -826,7 +639,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
oldContent.DTS = DateTime.Now;
|
oldContent.DTS = DateTime.Now;
|
||||||
#region B2012-079 fix JCB
|
#region B2012-079 fix JCB
|
||||||
oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber";
|
oldContent.UserID = $"{Volian.Base.Library.VlnSettings.UserID} - Renumber";
|
||||||
#endregion B2012-079 fix JCB
|
#endregion B2012-079 fix JCB
|
||||||
oldContent.Save();
|
oldContent.Save();
|
||||||
}
|
}
|
||||||
@@ -840,7 +653,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (tran.MyItemToID.ActiveSection != null)
|
if (tran.MyItemToID.ActiveSection != null)
|
||||||
{
|
{
|
||||||
SectionConfig sc = tran.MyItemToID.ActiveSection.MyConfig as SectionConfig;
|
SectionConfig sc = tran.MyItemToID.ActiveSection.MyConfig as SectionConfig;
|
||||||
//SectionConfig sc = new SectionConfig(tran.MyItemToID.ActiveSection.MyConfig.ToString());
|
|
||||||
forceConvertToText = (sc.SubSection_Edit == "N" && tran.MyItemToID.IsStep); // Bug fix B2016-081 also check if transition is to a step element
|
forceConvertToText = (sc.SubSection_Edit == "N" && tran.MyItemToID.IsStep); // Bug fix B2016-081 also check if transition is to a step element
|
||||||
}
|
}
|
||||||
if (!forceConvertToText) //check to see if external with internal format
|
if (!forceConvertToText) //check to see if external with internal format
|
||||||
@@ -853,18 +665,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
forceConvertToText = true;
|
forceConvertToText = true;
|
||||||
}
|
}
|
||||||
oldContent.FixTransitionText(tran, forceConvertToText);
|
oldContent.FixTransitionText(tran, forceConvertToText);
|
||||||
//if (content.IsDirty)
|
|
||||||
//{
|
|
||||||
// content.DTS = DateTime.Now;
|
|
||||||
// content.Save();
|
|
||||||
//}
|
|
||||||
if (oldContent != null)
|
if (oldContent != null)
|
||||||
{
|
{
|
||||||
if (oldContent.IsDirty)
|
if (oldContent.IsDirty)
|
||||||
{
|
{
|
||||||
oldContent.DTS = DateTime.Now;
|
oldContent.DTS = DateTime.Now;
|
||||||
#region B2012-079 fix JCB
|
#region B2012-079 fix JCB
|
||||||
oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber";
|
oldContent.UserID = $"{Volian.Base.Library.VlnSettings.UserID} - Renumber";
|
||||||
#endregion B2012-079 fix JCB
|
#endregion B2012-079 fix JCB
|
||||||
oldContent.Save();
|
oldContent.Save();
|
||||||
}
|
}
|
||||||
@@ -881,7 +688,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
// Get a list of all of the transitions included in this step & its children.
|
// Get a list of all of the transitions included in this step & its children.
|
||||||
// Their transition text may have been affected, i.e. depending on the format, etc
|
// Their transition text may have been affected, i.e. depending on the format, etc
|
||||||
using (TransitionInfoList trans = TransitionInfoList.GetPastedAffected(this.ItemID))
|
using (TransitionInfoList trans = TransitionInfoList.GetPastedAffected(ItemID))
|
||||||
{
|
{
|
||||||
foreach (TransitionInfo tran in trans)
|
foreach (TransitionInfo tran in trans)
|
||||||
{
|
{
|
||||||
@@ -892,7 +699,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (tran.MyItemToID.ActiveSection != null)
|
if (tran.MyItemToID.ActiveSection != null)
|
||||||
{
|
{
|
||||||
SectionConfig sc = tran.MyItemToID.ActiveSection.MyConfig as SectionConfig;
|
SectionConfig sc = tran.MyItemToID.ActiveSection.MyConfig as SectionConfig;
|
||||||
//SectionConfig sc = new SectionConfig(tran.MyItemToID.ActiveSection.MyConfig.ToString());
|
|
||||||
forceConvertToText = (sc.SubSection_Edit == "N" && tran.MyItemToID.IsStep); // Bug fix B2016-081 also check if transition is to a step element
|
forceConvertToText = (sc.SubSection_Edit == "N" && tran.MyItemToID.IsStep); // Bug fix B2016-081 also check if transition is to a step element
|
||||||
}
|
}
|
||||||
if (!forceConvertToText) //check to see if external with internal format
|
if (!forceConvertToText) //check to see if external with internal format
|
||||||
@@ -923,7 +729,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!dvsLinked)
|
if (!dvsLinked)
|
||||||
{
|
{
|
||||||
string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber;
|
string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber;
|
||||||
foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures)
|
foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures.OfType<ProcedureInfo>())
|
||||||
{
|
{
|
||||||
if (prci.DisplayNumber == destProcNumber)
|
if (prci.DisplayNumber == destProcNumber)
|
||||||
{
|
{
|
||||||
@@ -986,15 +792,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Insert Child
|
#region Insert Child
|
||||||
public ItemInfo InsertChild(E_FromType fromType, int type, string text)
|
public ItemInfo InsertChild(E_FromType fromType, int type, string text) => InsertChild(fromType, type, text, null);
|
||||||
{
|
|
||||||
return InsertChild(fromType, type, text, null);
|
|
||||||
}
|
|
||||||
public ItemInfo InsertChild(E_FromType fromType, int type, string text, string number)
|
public ItemInfo InsertChild(E_FromType fromType, int type, string text, string number)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp = null;
|
||||||
tmp = InsertSmartTemplateSubStep(text, number, tmp, EAddpingPart.Child, type, fromType);
|
tmp = InsertSmartTemplateSubStep(text, number, tmp, EAddpingPart.Child, type, fromType);
|
||||||
//tmp = InsertSmartTemplateSubStep(text, number, tmp, EAddpingPart.After, type);
|
|
||||||
if (tmp == null)
|
if (tmp == null)
|
||||||
tmp = NewItemInfoFetch(ItemID, EAddpingPart.Child, number, text, type, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
tmp = NewItemInfoFetch(ItemID, EAddpingPart.Child, number, text, type, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
||||||
// if next exists, it is updated in SQL so we have to manually force the iteminfo updates
|
// if next exists, it is updated in SQL so we have to manually force the iteminfo updates
|
||||||
@@ -1016,7 +818,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// its children can be done:
|
// its children can be done:
|
||||||
ItemInfo existingEnhancedItemInfo = ItemInfo.Get(enhItemID);
|
ItemInfo existingEnhancedItemInfo = ItemInfo.Get(enhItemID);
|
||||||
int type = GetEnhancedTypeForAdd(); // B2018-115: use the correct step type for the add.
|
int type = GetEnhancedTypeForAdd(); // B2018-115: use the correct step type for the add.
|
||||||
ItemInfo newEnhancedItemInfo = existingEnhancedItemInfo.InsertEnhancedSteps(MyContent.Text, null, addpart, type, enhType, ItemID);
|
ItemInfo newEnhancedItemInfo = existingEnhancedItemInfo.InsertEnhancedSteps(MyContent.Text, null, addpart, type, ItemID);
|
||||||
if (newEnhancedItemInfo == null) return null;
|
if (newEnhancedItemInfo == null) return null;
|
||||||
StepConfig sc = new StepConfig(MyContent.Config);
|
StepConfig sc = new StepConfig(MyContent.Config);
|
||||||
sc.AddEnhancedDocument(enhType, newEnhancedItemInfo.ItemID);
|
sc.AddEnhancedDocument(enhType, newEnhancedItemInfo.ItemID);
|
||||||
@@ -1026,30 +828,28 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
// this method handles inserting new procedures & sections for enhanced documents.
|
// this method handles inserting new procedures & sections for enhanced documents.
|
||||||
// It also handles the case of inserting a step within an EMPTY section. In this case, the template steps
|
// It also handles the case of inserting a step within an EMPTY section. In this case, the template steps
|
||||||
public ItemInfo InsertEnhancedItems(string text, string number, EAddpingPart addType, int? type, int eDocType, int newSourceID)
|
public ItemInfo InsertEnhancedItems(string text, string number, EAddpingPart addType, int? type, int newSourceID)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp;
|
||||||
if (this.IsProcedure && addType == EAddpingPart.Child) // Created a section off a procedure
|
if (IsProcedure && addType == EAddpingPart.Child) // Created a section off a procedure
|
||||||
{
|
{
|
||||||
string scng = null;
|
|
||||||
ProcedureConfig pc = new ProcedureConfig("<Config/>");
|
ProcedureConfig pc = new ProcedureConfig("<Config/>");
|
||||||
pc.AddEnhancedDocument(0, newSourceID);
|
pc.AddEnhancedDocument(0, newSourceID);
|
||||||
scng = pc.ToString();
|
string scng = pc.ToString();
|
||||||
tmp = InsertChild(E_FromType.Section, 10000, "New Section", null);
|
tmp = InsertChild(E_FromType.Section, 10000, "New Section", null);
|
||||||
tmp.SaveConfig(scng);
|
tmp.SaveConfig(scng);
|
||||||
}
|
}
|
||||||
else if (this.IsSection && addType == EAddpingPart.Child) // Created a HLS off a section, note that the template gets added for the HLS
|
else if (IsSection && addType == EAddpingPart.Child) // Created a HLS off a section, note that the template gets added for the HLS
|
||||||
{
|
{
|
||||||
string scng = null;
|
|
||||||
StepConfig sc = new StepConfig("<Config/>");
|
StepConfig sc = new StepConfig("<Config/>");
|
||||||
sc.AddEnhancedDocument(0, newSourceID);
|
sc.AddEnhancedDocument(0, newSourceID);
|
||||||
scng = sc.ToString();
|
string scng = sc.ToString();
|
||||||
tmp = InsertChild(E_FromType.Step, 20002, "New Step", null);
|
tmp = InsertChild(E_FromType.Step, 20002, "New Step", null);
|
||||||
tmp.SaveConfig(scng);
|
tmp.SaveConfig(scng);
|
||||||
}
|
}
|
||||||
else // the following code is used for inserting before/after.
|
else // the following code is used for inserting before/after.
|
||||||
{
|
{
|
||||||
string scng = null;
|
string scng;
|
||||||
if (IsSection)
|
if (IsSection)
|
||||||
{
|
{
|
||||||
SectionConfig sc = new SectionConfig();
|
SectionConfig sc = new SectionConfig();
|
||||||
@@ -1066,7 +866,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// B2017-083: first child - adjust the docversion itemid to point to this new one:
|
// B2017-083: first child - adjust the docversion itemid to point to this new one:
|
||||||
if (IsProcedure && tmp != null && tmp.MyPrevious == null)
|
if (IsProcedure && tmp != null && tmp.MyPrevious == null)
|
||||||
{
|
{
|
||||||
if (this.MyDocVersion != null)
|
if (MyDocVersion != null)
|
||||||
{
|
{
|
||||||
using (DocVersion parentItemDV = MyDocVersion.Get())
|
using (DocVersion parentItemDV = MyDocVersion.Get())
|
||||||
{
|
{
|
||||||
@@ -1092,13 +892,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
|
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
public ItemInfo InsertEnhancedSteps(string text, string number, EAddpingPart addType, int? type, int eDocType, int newSourceID)
|
public ItemInfo InsertEnhancedSteps(string text, string number, EAddpingPart addType, int? type, int newSourceID)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp;
|
||||||
if (addType == EAddpingPart.Child)
|
if (addType == EAddpingPart.Child)
|
||||||
{
|
{
|
||||||
E_FromType fromType = E_FromType.Caution;
|
E_FromType fromType = E_FromType.Caution;
|
||||||
if (this.IsSection) fromType = E_FromType.Step;
|
if (IsSection) fromType = E_FromType.Step;
|
||||||
else if (ActiveFormat.PlantFormat.FormatData.StepDataList[(int)type - 20000].Type.ToUpper() == "NOTE") fromType = E_FromType.Note;
|
else if (ActiveFormat.PlantFormat.FormatData.StepDataList[(int)type - 20000].Type.ToUpper() == "NOTE") fromType = E_FromType.Note;
|
||||||
tmp = InsertEnhancedSmartTemplateSubStep(text, number, this, addType, (int)type, fromType, newSourceID);
|
tmp = InsertEnhancedSmartTemplateSubStep(text, number, this, addType, (int)type, fromType, newSourceID);
|
||||||
}
|
}
|
||||||
@@ -1277,7 +1077,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// The ed.Type & ed.itemid show what type of enhanced document (use to create new
|
// The ed.Type & ed.itemid show what type of enhanced document (use to create new
|
||||||
// config Type).
|
// config Type).
|
||||||
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||||
newEnh = exEnh.InsertEnhancedSteps(tmpCopyStartSourceItem.MyContent.Text, null, addType, MyContent.Type, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedSteps(tmpCopyStartSourceItem.MyContent.Text, null, addType, MyContent.Type, ItemID);
|
||||||
if (newEnh == null) return null;
|
if (newEnh == null) return null;
|
||||||
StepConfig sc = new StepConfig(MyContent.Config);
|
StepConfig sc = new StepConfig(MyContent.Config);
|
||||||
sc.AddEnhancedDocument(edSource.Type, newEnh.ItemID);
|
sc.AddEnhancedDocument(edSource.Type, newEnh.ItemID);
|
||||||
@@ -1325,24 +1125,21 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string cfgEnhStr = null;
|
string cfgEnhStr = null;
|
||||||
if (newEnhancedItemInfo.IsStep)
|
if (newEnhancedItemInfo.IsStep)
|
||||||
{
|
{
|
||||||
StepConfig scnewenh = newEnhancedItemInfo.MyConfig as StepConfig;
|
if (!(newEnhancedItemInfo.MyConfig is StepConfig scnewenh)) break; //error here, i.e. should have a related enhanced step
|
||||||
if (scnewenh == null) break; //error here, i.e. should have a related enhanced step
|
|
||||||
scnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
scnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
||||||
scnewenh.SaveEnhancedDocuments();
|
scnewenh.SaveEnhancedDocuments();
|
||||||
cfgEnhStr = scnewenh.ToString();
|
cfgEnhStr = scnewenh.ToString();
|
||||||
}
|
}
|
||||||
else if (newEnhancedItemInfo.IsSection)
|
else if (newEnhancedItemInfo.IsSection)
|
||||||
{
|
{
|
||||||
SectionConfig secnewenh = newEnhancedItemInfo.MyConfig as SectionConfig;
|
if (!(newEnhancedItemInfo.MyConfig is SectionConfig secnewenh)) break; //error here, i.e. should have a related enhanced step
|
||||||
if (secnewenh == null) break; //error here, i.e. should have a related enhanced step
|
|
||||||
secnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
secnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
||||||
secnewenh.SaveEnhancedDocuments();
|
secnewenh.SaveEnhancedDocuments();
|
||||||
cfgEnhStr = secnewenh.ToString();
|
cfgEnhStr = secnewenh.ToString();
|
||||||
}
|
}
|
||||||
else if (newEnhancedItemInfo.IsProcedure)
|
else if (newEnhancedItemInfo.IsProcedure)
|
||||||
{
|
{
|
||||||
ProcedureConfig pnewenh = newEnhancedItemInfo.MyConfig as ProcedureConfig;
|
if (!(newEnhancedItemInfo.MyConfig is ProcedureConfig pnewenh)) break; //error here, i.e. should have a related enhanced step
|
||||||
if (pnewenh == null) break; //error here, i.e. should have a related enhanced step
|
|
||||||
pnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
pnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
||||||
pnewenh.SaveEnhancedDocuments();
|
pnewenh.SaveEnhancedDocuments();
|
||||||
cfgEnhStr = pnewenh.ToString();
|
cfgEnhStr = pnewenh.ToString();
|
||||||
@@ -1546,16 +1343,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region HandleEnhancedStepConfigLinks
|
#region HandleEnhancedStepConfigLinks
|
||||||
private void EnhancedSetStepLinks(ItemInfo newSourceSectionInfo, int enhType)
|
private void EnhancedSetStepLinks(ItemInfo newSourceSectionInfo, int enhType)
|
||||||
{
|
{
|
||||||
//for the input source section, link all HLS to enhanced HLS (and any associated cautions/notes). Note that
|
|
||||||
// this assumes that all source steps are linked, but there may be 'deleted' steps in enhanced that may not be linked back.
|
|
||||||
ItemInfo newEnhSectionInfo = null;
|
|
||||||
ItemInfo enhStep = null; // in enhanced document, find first step that has links (there may be enhanced steps that don't have links)
|
ItemInfo enhStep = null; // in enhanced document, find first step that has links (there may be enhanced steps that don't have links)
|
||||||
SectionConfig newSectCfg = newSourceSectionInfo.MyConfig as SectionConfig;
|
SectionConfig newSectCfg = newSourceSectionInfo.MyConfig as SectionConfig;
|
||||||
foreach (EnhancedDocument ed in newSectCfg.MyEnhancedDocuments)
|
foreach (EnhancedDocument ed in newSectCfg.MyEnhancedDocuments)
|
||||||
{
|
{
|
||||||
if (ed.Type == enhType)
|
if (ed.Type == enhType)
|
||||||
{
|
{
|
||||||
newEnhSectionInfo = ItemInfo.Get(ed.ItemID);
|
//for the input source section, link all HLS to enhanced HLS (and any associated cautions/notes). Note that
|
||||||
|
// this assumes that all source steps are linked, but there may be 'deleted' steps in enhanced that may not be linked back.
|
||||||
|
ItemInfo newEnhSectionInfo = ItemInfo.Get(ed.ItemID);
|
||||||
// B2020-009 if section does not have steps (empty step section) then skip it.
|
// B2020-009 if section does not have steps (empty step section) then skip it.
|
||||||
if (newEnhSectionInfo.Steps != null)
|
if (newEnhSectionInfo.Steps != null)
|
||||||
{
|
{
|
||||||
@@ -1629,7 +1425,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// the following pastes each type of enhanced procedure, including its sections/steps
|
// the following pastes each type of enhanced procedure, including its sections/steps
|
||||||
EnhancedPasteItem(copyStartID, pasteFromItem, addType, chgid);
|
EnhancedPasteItem(copyStartID, pasteFromItem, addType, chgid);
|
||||||
// for each enhanced type for this procedure, adjust the config data for its sections/steps:
|
// for each enhanced type for this procedure, adjust the config data for its sections/steps:
|
||||||
ProcedureConfig sourceProcConfig = this.MyConfig as ProcedureConfig;
|
ProcedureConfig sourceProcConfig = MyConfig as ProcedureConfig;
|
||||||
foreach (EnhancedDocument enhProc in sourceProcConfig.MyEnhancedDocuments)
|
foreach (EnhancedDocument enhProc in sourceProcConfig.MyEnhancedDocuments)
|
||||||
{
|
{
|
||||||
if (enhProc.Type != 0)
|
if (enhProc.Type != 0)
|
||||||
@@ -1646,8 +1442,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
foreach (ItemInfo sourceSect in Sections)
|
foreach (ItemInfo sourceSect in Sections)
|
||||||
{
|
{
|
||||||
SectionConfig srcCfg = sourceSect.MyConfig as SectionConfig;
|
if (sourceSect.MyConfig is SectionConfig srcCfg && (srcCfg.Section_LnkEnh != "N") && srcCfg.MyEnhancedDocuments != null && srcCfg.MyEnhancedDocuments.Count > 0)
|
||||||
if (srcCfg != null && (srcCfg.Section_LnkEnh != "N") && srcCfg.MyEnhancedDocuments != null && srcCfg.MyEnhancedDocuments.Count > 0)
|
|
||||||
{
|
{
|
||||||
// use pastedEnhancedCurrentSection to link to:
|
// use pastedEnhancedCurrentSection to link to:
|
||||||
foreach (EnhancedDocument ed in srcCfg.MyEnhancedDocuments)
|
foreach (EnhancedDocument ed in srcCfg.MyEnhancedDocuments)
|
||||||
@@ -1676,7 +1471,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else if (IsSection)
|
else if (IsSection)
|
||||||
{
|
{
|
||||||
ItemInfo pastedSect = EnhancedPasteItem(copyStartID, pasteFromItem, addType, chgid);
|
ItemInfo pastedSect = EnhancedPasteItem(copyStartID, pasteFromItem, addType, chgid);
|
||||||
SectionConfig sourceSectConfig = this.MyConfig as SectionConfig;
|
SectionConfig sourceSectConfig = MyConfig as SectionConfig;
|
||||||
foreach (EnhancedDocument enhSect in sourceSectConfig.MyEnhancedDocuments)
|
foreach (EnhancedDocument enhSect in sourceSectConfig.MyEnhancedDocuments)
|
||||||
if (enhSect.Type != 0) EnhancedSetStepLinks(this, enhSect.Type);
|
if (enhSect.Type != 0) EnhancedSetStepLinks(this, enhSect.Type);
|
||||||
retItem = pastedSect;
|
retItem = pastedSect;
|
||||||
@@ -1704,7 +1499,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// go to parent
|
// go to parent
|
||||||
ItemInfo newEnh = null;
|
ItemInfo newEnh = null;
|
||||||
// look through pervious first:
|
// look through pervious first:
|
||||||
ItemInfo iiCur = this.MyPrevious;
|
ItemInfo iiCur = MyPrevious;
|
||||||
EAddpingPart addtype = EAddpingPart.After;
|
EAddpingPart addtype = EAddpingPart.After;
|
||||||
|
|
||||||
// C2019-045: For enhanced procedures, allow modifications of number & text. When a procedure is inserted, if allowing updates, the number/text doesn't
|
// C2019-045: For enhanced procedures, allow modifications of number & text. When a procedure is inserted, if allowing updates, the number/text doesn't
|
||||||
@@ -1726,22 +1521,20 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||||
int enhType = (int)MyContent.Type;
|
int enhType = (int)MyContent.Type;
|
||||||
// B2017-272 did not need the if-check to set the enhanced type (commented it out)
|
|
||||||
//if (iiCur.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (bryon data)
|
|
||||||
enhType = (int)exEnh.MyContent.Type;
|
enhType = (int)exEnh.MyContent.Type;
|
||||||
if (exEnh.IsStep)
|
if (exEnh.IsStep)
|
||||||
{
|
{
|
||||||
// B2018-115: use the correct step type for the add.
|
// B2018-115: use the correct step type for the add.
|
||||||
// if coming from a HLS, note or caution, the enhanced type should be the base hls/note/caution type (from GetEnhancedTypeForAdd)
|
// if coming from a HLS, note or caution, the enhanced type should be the base hls/note/caution type (from GetEnhancedTypeForAdd)
|
||||||
enhType = GetEnhancedTypeForAdd();
|
enhType = GetEnhancedTypeForAdd();
|
||||||
newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, ItemID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!IsProcedure || !exEnh.MyDocVersion.DocVersionConfig.Enhanced_AllowMods)
|
if (!IsProcedure || !exEnh.MyDocVersion.DocVersionConfig.Enhanced_AllowMods)
|
||||||
newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, enhType, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, enhType, ItemID);
|
||||||
else
|
else
|
||||||
newEnh = exEnh.InsertEnhancedItems(ptext, pnum, addtype, enhType, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedItems(ptext, pnum, addtype, enhType, ItemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1749,7 +1542,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
// no previous have enhanced links. now go through next:
|
// no previous have enhanced links. now go through next:
|
||||||
ItemInfo iiNxt = this.NextItem;
|
ItemInfo iiNxt = NextItem;
|
||||||
addtype = EAddpingPart.Before;
|
addtype = EAddpingPart.Before;
|
||||||
while (iiNxt != null && newEnh == null)
|
while (iiNxt != null && newEnh == null)
|
||||||
{
|
{
|
||||||
@@ -1759,22 +1552,20 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||||
int enhType = (int)MyContent.Type;
|
int enhType = (int)MyContent.Type;
|
||||||
// B2017-272 did not need the if-check to set the enhanced type (commented it out)
|
|
||||||
//if (iiNxt != null && iiNxt.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (byron data) (B2017-174: added null check)
|
|
||||||
enhType = (int)exEnh.MyContent.Type;
|
enhType = (int)exEnh.MyContent.Type;
|
||||||
if (exEnh.IsStep)
|
if (exEnh.IsStep)
|
||||||
{
|
{
|
||||||
// B2018-115: use the correct step type for the add.
|
// B2018-115: use the correct step type for the add.
|
||||||
// if coming from a HLS, note or caution, the enhanced type should be the base hls/note/caution type (from GetEnhancedTypeForAdd)
|
// if coming from a HLS, note or caution, the enhanced type should be the base hls/note/caution type (from GetEnhancedTypeForAdd)
|
||||||
enhType = GetEnhancedTypeForAdd();
|
enhType = GetEnhancedTypeForAdd();
|
||||||
newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, ItemID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!IsProcedure || !exEnh.MyDocVersion.DocVersionConfig.Enhanced_AllowMods)
|
if (!IsProcedure || !exEnh.MyDocVersion.DocVersionConfig.Enhanced_AllowMods)
|
||||||
newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, enhType, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, enhType, ItemID);
|
||||||
else
|
else
|
||||||
newEnh = exEnh.InsertEnhancedItems(ptext, pnum, addtype, enhType, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedItems(ptext, pnum, addtype, enhType, ItemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1782,13 +1573,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
// no next either, try the parent.
|
// no next either, try the parent.
|
||||||
if (this.IsProcedure && newEnh == null) // procedure is a special case since it has to be added from the doc version:
|
if (IsProcedure && newEnh == null) // procedure is a special case since it has to be added from the doc version:
|
||||||
{
|
{
|
||||||
// need to make a new procedure off working draft of enhanced set:
|
// need to make a new procedure off working draft of enhanced set:
|
||||||
DocVersionConfig dvc = this.MyDocVersion.MyConfig as DocVersionConfig;
|
ProcedureInfo pi = ProcedureInfo.Get(ItemID);
|
||||||
ProcedureInfo pi = ProcedureInfo.Get(this.ItemID);
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - Keeping for Debugging / Side Effect
|
||||||
ProcedureConfig sourcecfg = pi.ProcedureConfig;
|
ProcedureConfig sourcecfg = pi.ProcedureConfig;
|
||||||
if (dvc != null)
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
if (MyDocVersion.MyConfig is DocVersionConfig dvc)
|
||||||
{
|
{
|
||||||
foreach (DVEnhancedDocument ded in dvc.MyEnhancedDocuments)
|
foreach (DVEnhancedDocument ded in dvc.MyEnhancedDocuments)
|
||||||
{
|
{
|
||||||
@@ -1817,7 +1609,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ItemInfo iiPar = this.MyParent;
|
ItemInfo iiPar = MyParent;
|
||||||
addtype = EAddpingPart.Child;
|
addtype = EAddpingPart.Child;
|
||||||
while (iiPar != null && newEnh == null)
|
while (iiPar != null && newEnh == null)
|
||||||
{
|
{
|
||||||
@@ -1831,10 +1623,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// B2018-115: use the correct step type for the add.
|
// B2018-115: use the correct step type for the add.
|
||||||
// if coming from a HLS, note or caution, the enhanced type should be the base hls/note/caution type (from GetEnhancedTypeForAdd)
|
// if coming from a HLS, note or caution, the enhanced type should be the base hls/note/caution type (from GetEnhancedTypeForAdd)
|
||||||
int enhType = GetEnhancedTypeForAdd();
|
int enhType = GetEnhancedTypeForAdd();
|
||||||
newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, ItemID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, MyContent.Type, edSource.Type, this.ItemID);
|
newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, MyContent.Type, ItemID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1852,7 +1644,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else if (IsSection)
|
else if (IsSection)
|
||||||
{
|
{
|
||||||
SectionConfig sc = new SectionConfig(SectionInfo.Get(this.ItemID));
|
SectionConfig sc = new SectionConfig(SectionInfo.Get(ItemID));
|
||||||
sc.AddEnhancedDocument(enhtype, newEnh.ItemID);
|
sc.AddEnhancedDocument(enhtype, newEnh.ItemID);
|
||||||
sc.Section_LnkEnh = "Y";
|
sc.Section_LnkEnh = "Y";
|
||||||
SaveConfig(sc.ToString());
|
SaveConfig(sc.ToString());
|
||||||
@@ -1885,9 +1677,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// Link the 2 items, srcII & enhii:
|
// Link the 2 items, srcII & enhii:
|
||||||
if (IsStep)
|
if (IsStep)
|
||||||
{
|
{
|
||||||
using (Item ii = this.Get())
|
using (Item ii = Get())
|
||||||
{
|
{
|
||||||
StepConfig sc = this.MyConfig as StepConfig;
|
StepConfig sc = MyConfig as StepConfig;
|
||||||
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
||||||
sc.SaveEnhancedDocuments();
|
sc.SaveEnhancedDocuments();
|
||||||
ii.MyContent.Config = sc.ToString();
|
ii.MyContent.Config = sc.ToString();
|
||||||
@@ -1899,7 +1691,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
StepConfig sc = enhii.MyConfig as StepConfig;
|
StepConfig sc = enhii.MyConfig as StepConfig;
|
||||||
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||||
{
|
{
|
||||||
sc.AddEnhancedDocument(0, this.ItemID);
|
sc.AddEnhancedDocument(0, ItemID);
|
||||||
sc.SaveEnhancedDocuments();
|
sc.SaveEnhancedDocuments();
|
||||||
ei.MyContent.Text = DisplayText;
|
ei.MyContent.Text = DisplayText;
|
||||||
ei.MyContent.Config = sc.ToString();
|
ei.MyContent.Config = sc.ToString();
|
||||||
@@ -1910,9 +1702,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else if (IsSection)
|
else if (IsSection)
|
||||||
{
|
{
|
||||||
using (Item ii = this.Get())
|
using (Item ii = Get())
|
||||||
{
|
{
|
||||||
SectionConfig sc = this.MyConfig as SectionConfig;
|
SectionConfig sc = MyConfig as SectionConfig;
|
||||||
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
||||||
sc.SaveEnhancedDocuments();
|
sc.SaveEnhancedDocuments();
|
||||||
sc.Section_LnkEnh = "Y";
|
sc.Section_LnkEnh = "Y";
|
||||||
@@ -1925,7 +1717,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
SectionConfig sc = enhii.MyConfig as SectionConfig;
|
SectionConfig sc = enhii.MyConfig as SectionConfig;
|
||||||
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||||
{
|
{
|
||||||
sc.AddEnhancedDocument(0, this.ItemID);
|
sc.AddEnhancedDocument(0, ItemID);
|
||||||
sc.SaveEnhancedDocuments();
|
sc.SaveEnhancedDocuments();
|
||||||
ei.MyContent.Text = DisplayText;
|
ei.MyContent.Text = DisplayText;
|
||||||
ei.MyContent.Config = sc.ToString();
|
ei.MyContent.Config = sc.ToString();
|
||||||
@@ -1941,7 +1733,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (Item ei = Item.Get(enhii.ItemID))
|
using (Item ei = Item.Get(enhii.ItemID))
|
||||||
{
|
{
|
||||||
ProcedureConfig sc = enhii.MyConfig as ProcedureConfig;
|
ProcedureConfig sc = enhii.MyConfig as ProcedureConfig;
|
||||||
sc.AddEnhancedDocument(0, this.ItemID);
|
sc.AddEnhancedDocument(0, ItemID);
|
||||||
sc.SaveEnhancedDocuments();
|
sc.SaveEnhancedDocuments();
|
||||||
ei.MyContent.Number = MyContent.Number;
|
ei.MyContent.Number = MyContent.Number;
|
||||||
ei.MyContent.Text = DisplayText;
|
ei.MyContent.Text = DisplayText;
|
||||||
@@ -1949,9 +1741,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ei.Save();
|
ei.Save();
|
||||||
enhii.RefreshConfig();
|
enhii.RefreshConfig();
|
||||||
}
|
}
|
||||||
using (Item ii = this.Get())
|
using (Item ii = Get())
|
||||||
{
|
{
|
||||||
ProcedureConfig sc = this.MyConfig as ProcedureConfig;
|
ProcedureConfig sc = MyConfig as ProcedureConfig;
|
||||||
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||||
{
|
{
|
||||||
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
||||||
@@ -1982,8 +1774,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@Type", criteria.Type);
|
cm.Parameters.AddWithValue("@Type", criteria.Type);
|
||||||
cm.Parameters.AddWithValue("@DTS", criteria.DTS);
|
cm.Parameters.AddWithValue("@DTS", criteria.DTS);
|
||||||
cm.Parameters.AddWithValue("@UserID", criteria.UserID);
|
cm.Parameters.AddWithValue("@UserID", criteria.UserID);
|
||||||
SqlParameter param_ContentID = new SqlParameter("@NewItemID", SqlDbType.Int);
|
SqlParameter param_ContentID = new SqlParameter("@NewItemID", SqlDbType.Int)
|
||||||
param_ContentID.Direction = ParameterDirection.Output;
|
{
|
||||||
|
Direction = ParameterDirection.Output
|
||||||
|
};
|
||||||
cm.Parameters.Add(param_ContentID);
|
cm.Parameters.Add(param_ContentID);
|
||||||
cm.CommandText = "PasteItemEnhancedReplace";
|
cm.CommandText = "PasteItemEnhancedReplace";
|
||||||
cm.CommandTimeout = Database.DefaultTimeout;
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
@@ -2028,8 +1822,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@Type", criteria.Type); //ABC
|
cm.Parameters.AddWithValue("@Type", criteria.Type); //ABC
|
||||||
cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC
|
cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC
|
||||||
cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC
|
cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC
|
||||||
SqlParameter param_ContentID = new SqlParameter("@NewItemID", SqlDbType.Int);
|
SqlParameter param_ContentID = new SqlParameter("@NewItemID", SqlDbType.Int)
|
||||||
param_ContentID.Direction = ParameterDirection.Output;
|
{
|
||||||
|
Direction = ParameterDirection.Output
|
||||||
|
};
|
||||||
cm.Parameters.Add(param_ContentID);
|
cm.Parameters.Add(param_ContentID);
|
||||||
switch (criteria.AddType)
|
switch (criteria.AddType)
|
||||||
{
|
{
|
||||||
@@ -2093,8 +1889,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@Type", criteria.Type); //ABC
|
cm.Parameters.AddWithValue("@Type", criteria.Type); //ABC
|
||||||
cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC
|
cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC
|
||||||
cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC
|
cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC
|
||||||
SqlParameter param_ContentID = new SqlParameter("@newItemID", SqlDbType.Int);
|
SqlParameter param_ContentID = new SqlParameter("@newItemID", SqlDbType.Int)
|
||||||
param_ContentID.Direction = ParameterDirection.Output;
|
{
|
||||||
|
Direction = ParameterDirection.Output
|
||||||
|
};
|
||||||
cm.Parameters.Add(param_ContentID);
|
cm.Parameters.Add(param_ContentID);
|
||||||
switch (criteria.AddType)
|
switch (criteria.AddType)
|
||||||
{
|
{
|
||||||
@@ -2208,12 +2006,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _StartItemID; }
|
get { return _StartItemID; }
|
||||||
set { _StartItemID = value; }
|
set { _StartItemID = value; }
|
||||||
}
|
}
|
||||||
//private int _CopyEndID;
|
|
||||||
//public int CopyEndID
|
|
||||||
//{
|
|
||||||
// get { return _CopyEndID; }
|
|
||||||
// set { _CopyEndID = value; }
|
|
||||||
//}
|
|
||||||
private int _ItemID; // paste relative to this itemid
|
private int _ItemID; // paste relative to this itemid
|
||||||
public int ItemID
|
public int ItemID
|
||||||
{
|
{
|
||||||
@@ -2393,11 +2185,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string key = itemID.ToString();
|
string key = itemID.ToString();
|
||||||
if(_CacheByPrimaryKey.ContainsKey(key))
|
if(_CacheByPrimaryKey.ContainsKey(key))
|
||||||
{
|
{
|
||||||
|
|
||||||
ItemInfo [] items = _CacheByPrimaryKey[key].ToArray();
|
ItemInfo [] items = _CacheByPrimaryKey[key].ToArray();
|
||||||
ItemInfo parent = items[0].ActiveParent as ItemInfo;
|
|
||||||
//_MyTimer.ActiveProcess = "ResetParts";
|
//_MyTimer.ActiveProcess = "ResetParts";
|
||||||
if (parent != null)
|
if (items[0].ActiveParent is ItemInfo parent)
|
||||||
ItemInfo.ResetParts(parent.ItemID);
|
ItemInfo.ResetParts(parent.ItemID);
|
||||||
//Console.WriteLine("\r\n\r\n'Deleting Item {0}'\r\n{0}'Type ','ParentID','ParentUnique','ItemID','Unique'",itemID);
|
//Console.WriteLine("\r\n\r\n'Deleting Item {0}'\r\n{0}'Type ','ParentID','ParentUnique','ItemID','Unique'",itemID);
|
||||||
foreach (ItemInfo item in items)
|
foreach (ItemInfo item in items)
|
||||||
@@ -2441,21 +2231,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
foreach (ItemInfo itm in itemz)
|
foreach (ItemInfo itm in itemz)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("'{0}cache ',{1},{2},{3},{4}", depth + depth, this.ItemID, this._MyItemInfoUnique, itm.ItemID, itm._MyItemInfoUnique);
|
//Console.WriteLine("'{0}cache ',{1},{2},{3},{4}", depth + depth, this.ItemID, this._MyItemInfoUnique, itm.ItemID, itm._MyItemInfoUnique);
|
||||||
//whereami = 2;
|
|
||||||
itm.OnDeleted(itm);
|
itm.OnDeleted(itm);
|
||||||
//whereami = 4;
|
|
||||||
itm.DeleteItemInfoAndChildren(depth + " ");
|
itm.DeleteItemInfoAndChildren(depth + " ");
|
||||||
//whereami = 3;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Console.WriteLine("'{0}noncache',{1},{2},{3},{4}", depth + depth, this.ItemID, this._MyItemInfoUnique, item.ItemID, item._MyItemInfoUnique);
|
//Console.WriteLine("'{0}noncache',{1},{2},{3},{4}", depth + depth, this.ItemID, this._MyItemInfoUnique, item.ItemID, item._MyItemInfoUnique);
|
||||||
//whereami = 5;
|
|
||||||
item.OnDeleted(item);
|
item.OnDeleted(item);
|
||||||
//whereami = 7;
|
|
||||||
item.DeleteItemInfoAndChildren(depth + " ");
|
item.DeleteItemInfoAndChildren(depth + " ");
|
||||||
//whereami = 6;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2481,23 +2265,22 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (_PreviousID != previousID)
|
if (_PreviousID != previousID)
|
||||||
{
|
{
|
||||||
if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for old value
|
MyPrevious?.RefreshNextItems(); // Update List for old value
|
||||||
_PreviousID = previousID; // Update the value
|
_PreviousID = previousID; // Update the value
|
||||||
}
|
}
|
||||||
_MyPrevious = null; // Reset list so that the next line gets a new list
|
_MyPrevious = null; // Reset list so that the next line gets a new list
|
||||||
if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value
|
MyPrevious?.RefreshNextItems(); // Update List for new value
|
||||||
}
|
}
|
||||||
// C2017-031: Support for paste/replace an enhanced step
|
// C2017-031: Support for paste/replace an enhanced step
|
||||||
internal static ItemInfo CopyPasteReplaceEnhancedItemInfoFetch(int copyStartID, ItemInfo itemInfo)
|
internal static ItemInfo CopyPasteReplaceEnhancedItemInfoFetch(int copyStartID, ItemInfo itemInfo)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp = DataPortal.Fetch<StepInfo>(new PastingPartEnhancedCriteria(copyStartID, itemInfo.ItemID, EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||||
tmp = DataPortal.Fetch<StepInfo>(new ItemInfo.PastingPartEnhancedCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
|
||||||
AddToCache(tmp);
|
AddToCache(tmp);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
internal static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
internal static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp;
|
||||||
if (itemInfo.GetType() == typeof(ProcedureInfo) || itemInfo.MyContent.Type < 10000)
|
if (itemInfo.GetType() == typeof(ProcedureInfo) || itemInfo.MyContent.Type < 10000)
|
||||||
tmp = DataPortal.Fetch<ProcedureInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
tmp = DataPortal.Fetch<ProcedureInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||||
else if (itemInfo.GetType() == typeof(SectionInfo) || itemInfo.MyContent.Type < 20000)
|
else if (itemInfo.GetType() == typeof(SectionInfo) || itemInfo.MyContent.Type < 20000)
|
||||||
@@ -2515,8 +2298,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public static void DeleteItemAndChildren(ItemInfo item)
|
public static void DeleteItemAndChildren(ItemInfo item)
|
||||||
{
|
{
|
||||||
//Volian.Base.Library.VlnTimer _MyTimer = new Volian.Base.Library.VlnTimer();
|
//Volian.Base.Library.VlnTimer _MyTimer = new Volian.Base.Library.VlnTimer();
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Item");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ItemInfo nextItem = item.NextItem;
|
ItemInfo nextItem = item.NextItem;
|
||||||
@@ -2552,8 +2333,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children
|
ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children
|
||||||
if (prevItem != null)
|
if (prevItem != null)
|
||||||
prevItem.UpdateTransitionText();
|
prevItem.UpdateTransitionText();
|
||||||
else if (nextItem != null) // B2020-050 needed check for null nextItem - found when deleting empty equation sub-step
|
else // B2020-050 needed check for null nextItem - found when deleting empty equation sub-step
|
||||||
nextItem.ResetOrdinal(); // B2020-043: Fix transition text, code moved from above, so that DeleteItemInfoAndChildren is called first.
|
nextItem?.ResetOrdinal(); // B2020-043: Fix transition text, code moved from above, so that DeleteItemInfoAndChildren is called first.
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -2593,9 +2374,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class DeleteCriteria
|
protected class DeleteCriteria
|
||||||
{
|
{
|
||||||
private int _ItemID;
|
private readonly int _ItemID;
|
||||||
public int ItemID
|
public int ItemID => _ItemID;
|
||||||
{ get { return _ItemID; } }
|
|
||||||
private string _UserID;
|
private string _UserID;
|
||||||
public string UserID
|
public string UserID
|
||||||
{
|
{
|
||||||
@@ -2648,8 +2428,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, ref bool firstTrans)
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, ref bool firstTrans)
|
||||||
{
|
{
|
||||||
firstTrans = false;
|
firstTrans = false;
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Item");
|
|
||||||
// B2016-009 check source and destination types and display message box if needed
|
// B2016-009 check source and destination types and display message box if needed
|
||||||
// C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon
|
// C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon
|
||||||
// B2023-101 Handle Paste Replace when procedure to be replaced has Incoming Transitions, i.e. do a separate try/catch for this case
|
// B2023-101 Handle Paste Replace when procedure to be replaced has Incoming Transitions, i.e. do a separate try/catch for this case
|
||||||
@@ -2790,8 +2568,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// B2024-045, 049 and 050: if not a single procedure replace, update user interface by using the 'OnNewChild'. Single
|
// B2024-045, 049 and 050: if not a single procedure replace, update user interface by using the 'OnNewChild'. Single
|
||||||
// procedure's MyParent is null because its parent is a working draft (docversion) since MyParent's type is iteminfo.
|
// procedure's MyParent is null because its parent is a working draft (docversion) since MyParent's type is iteminfo.
|
||||||
// For the single procedure case, the user interface code in vlntreeview will update the tree.
|
// For the single procedure case, the user interface code in vlntreeview will update the tree.
|
||||||
if (newItemInfo.MyParent != null)
|
newItemInfo.MyParent?.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
|
||||||
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
|
|
||||||
}
|
}
|
||||||
return newItemInfo;
|
return newItemInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
@@ -23,12 +21,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
public class CanCheckOutItemCriteria
|
public class CanCheckOutItemCriteria
|
||||||
{
|
{
|
||||||
private int _ObjectID;
|
private readonly int _ObjectID;
|
||||||
public int ObjectID
|
public int ObjectID => _ObjectID;
|
||||||
{ get { return _ObjectID; } }
|
private readonly CheckOutType _ObjectType;
|
||||||
private CheckOutType _ObjectType;
|
public CheckOutType ObjectType => _ObjectType;
|
||||||
public CheckOutType ObjectType
|
|
||||||
{ get { return _ObjectType; } }
|
|
||||||
public CanCheckOutItemCriteria(int objectID, CheckOutType objectType)
|
public CanCheckOutItemCriteria(int objectID, CheckOutType objectType)
|
||||||
{
|
{
|
||||||
_ObjectID = objectID;
|
_ObjectID = objectID;
|
||||||
@@ -37,7 +33,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
private void DataPortal_Fetch(CanCheckOutItemCriteria criteria)
|
private void DataPortal_Fetch(CanCheckOutItemCriteria criteria)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
RaiseListChangedEvents = false;
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfoList.DataPortal_Fetch", GetHashCode());
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfoList.DataPortal_Fetch", GetHashCode());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -53,7 +49,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||||
{
|
{
|
||||||
IsReadOnly = false;
|
IsReadOnly = false;
|
||||||
while (dr.Read()) this.Add(new SessionInfo(dr));
|
while (dr.Read()) Add(new SessionInfo(dr));
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,7 +60,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfoList.DataPortal_Fetch", ex);
|
if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfoList.DataPortal_Fetch", ex);
|
||||||
throw new DbCslaException("SessionInfoList.DataPortal_Fetch", ex);
|
throw new DbCslaException("SessionInfoList.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
this.RaiseListChangedEvents = true;
|
RaiseListChangedEvents = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -72,8 +68,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region SessionInfo stuff
|
#region SessionInfo stuff
|
||||||
public partial class SessionInfo
|
public partial class SessionInfo
|
||||||
{
|
{
|
||||||
private Int64 _LastContentChange;
|
private long _LastContentChange;
|
||||||
public Int64 LastContentChange
|
public long LastContentChange
|
||||||
{
|
{
|
||||||
get { return _LastContentChange; }
|
get { return _LastContentChange; }
|
||||||
set { _LastContentChange = value; }
|
set { _LastContentChange = value; }
|
||||||
@@ -88,14 +84,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
set { _LastChanged = value; }
|
set { _LastChanged = value; }
|
||||||
}
|
}
|
||||||
public string LastChangedString
|
public string LastChangedString => ContentInfo.FormatByteArray(_LastChanged);
|
||||||
{
|
public long LastChangedInt64 => Convert.ToInt64(LastChangedString, 16);
|
||||||
get { return ContentInfo.FormatByteArray(_LastChanged); }
|
|
||||||
}
|
|
||||||
public Int64 LastChangedInt64
|
|
||||||
{
|
|
||||||
get { return Convert.ToInt64(LastChangedString, 16); }
|
|
||||||
}
|
|
||||||
public static SessionInfo BeginSession(string machineName, int processID)
|
public static SessionInfo BeginSession(string machineName, int processID)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -113,14 +103,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Error on SessionInfo.BeginSession", ex);
|
throw new DbCslaException("Error on SessionInfo.BeginSession", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private Dictionary<int, Int64> _ChangedContents;
|
private Dictionary<int, long> _ChangedContents;
|
||||||
public Dictionary<int, Int64> ChangedContents
|
public Dictionary<int, long> ChangedContents
|
||||||
{
|
{
|
||||||
get { return _ChangedContents; }
|
get { return _ChangedContents; }
|
||||||
set { _ChangedContents = value; }
|
set { _ChangedContents = value; }
|
||||||
}
|
}
|
||||||
private Dictionary<int, Int64> _ChangedItems;
|
private Dictionary<int, long> _ChangedItems;
|
||||||
public Dictionary<int, Int64> ChangedItems
|
public Dictionary<int, long> ChangedItems
|
||||||
{
|
{
|
||||||
get { return _ChangedItems; }
|
get { return _ChangedItems; }
|
||||||
set { _ChangedItems = value; }
|
set { _ChangedItems = value; }
|
||||||
@@ -131,10 +121,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<int> myList = new List<int>();
|
List<int> myList = new List<int>();
|
||||||
SessionPing.Execute(this.SessionID);
|
SessionPing.Execute(SessionID);
|
||||||
ChangedContents = SessionChangedContents.Execute(this.LastContentChange);
|
ChangedContents = SessionChangedContents.Execute(LastContentChange);
|
||||||
ChangedItems = SessionChangedItems.Execute(this.LastContentChange);
|
ChangedItems = SessionChangedItems.Execute(LastContentChange);
|
||||||
OwnerInfoList oil = OwnerInfoList.GetBySessionID(this.SessionID);
|
OwnerInfoList oil = OwnerInfoList.GetBySessionID(SessionID);
|
||||||
foreach (OwnerInfo oi in oil)
|
foreach (OwnerInfo oi in oil)
|
||||||
myList.Add(oi.OwnerID);
|
myList.Add(oi.OwnerID);
|
||||||
return myList;
|
return myList;
|
||||||
@@ -144,10 +134,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void EndSession()
|
public void EndSession() => SessionEnd.Execute(SessionID);
|
||||||
{
|
|
||||||
SessionEnd.Execute(this.SessionID);
|
|
||||||
}
|
|
||||||
public bool CanCheckOutItem(int objectID, CheckOutType objectType, ref string message)
|
public bool CanCheckOutItem(int objectID, CheckOutType objectType, ref string message)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -178,7 +165,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// C2015-022 part of separate windows logic, check the processID instead of the sessionID
|
// C2015-022 part of separate windows logic, check the processID instead of the sessionID
|
||||||
foreach (SessionInfo si in sil)
|
foreach (SessionInfo si in sil)
|
||||||
{
|
{
|
||||||
if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure)
|
if (si.ProcessID != ProcessID && objectType == CheckOutType.Procedure)
|
||||||
{
|
{
|
||||||
//B2024-074 If no Number for Procedure, Display Title
|
//B2024-074 If no Number for Procedure, Display Title
|
||||||
ProcedureInfo tmpproc = ItemInfo.Get(objectID).MyProcedure;
|
ProcedureInfo tmpproc = ItemInfo.Get(objectID).MyProcedure;
|
||||||
@@ -189,12 +176,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
message = string.Format("The procedure {0} is already checked out to {1}.\r\nWould You like to open the procedure in View Only Mode?", name, si.UserID);
|
message = string.Format("The procedure {0} is already checked out to {1}.\r\nWould You like to open the procedure in View Only Mode?", name, si.UserID);
|
||||||
rv = rv && false;
|
rv = rv && false;
|
||||||
}
|
}
|
||||||
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document)
|
else if (si.ProcessID != ProcessID && objectType == CheckOutType.Document)
|
||||||
{
|
{
|
||||||
message = string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(objectID).DocumentEntries[0].MyContent.Text, si.UserID);
|
message = string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(objectID).DocumentEntries[0].MyContent.Text, si.UserID);
|
||||||
rv = rv && false;
|
rv = rv && false;
|
||||||
}
|
}
|
||||||
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.DocVersion)
|
else if (si.ProcessID != ProcessID && objectType == CheckOutType.DocVersion)
|
||||||
{
|
{
|
||||||
// gets here if other session has working draft open & click on sam working draft.
|
// gets here if other session has working draft open & click on sam working draft.
|
||||||
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
||||||
@@ -213,10 +200,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
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)
|
||||||
message = message + string.Format("The working draft is already checked out to {0}", si.UserID);
|
message += string.Format("The working draft is already checked out to {0}", si.UserID);
|
||||||
rv = rv && false;
|
rv = rv && false;
|
||||||
}
|
}
|
||||||
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Folder)
|
else if (si.ProcessID != ProcessID && objectType == CheckOutType.Folder)
|
||||||
{
|
{
|
||||||
// gets here if other session has working draft open & click on folder above. Gets here
|
// gets here if other session has working draft open & click on folder above. Gets here
|
||||||
// if other session has wd open and click on top folder - query returns empty.
|
// if other session has wd open and click on top folder - query returns empty.
|
||||||
@@ -236,9 +223,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
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)
|
||||||
message = message + string.Format("The working draft is already checked out to {0}", si.UserID);
|
message += string.Format("The working draft is already checked out to {0}", si.UserID);
|
||||||
else if (oi.OwnerType == 3)
|
else if (oi.OwnerType == 3)
|
||||||
message = message + string.Format("The folder is already checked out to {0}", si.UserID);
|
message += string.Format("The folder is already checked out to {0}", si.UserID);
|
||||||
rv = rv && false;
|
rv = rv && false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,15 +238,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Error on SessionInfo.Get", ex);
|
throw new DbCslaException("Error on SessionInfo.Get", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public int CheckOutItem(int itemID, CheckOutType itemType)
|
public int CheckOutItem(int itemID, CheckOutType itemType) => SessionCheckOutItem.Execute(SessionID, itemID, itemType);
|
||||||
{
|
public void CheckInItem(int ownerID) => SessionCheckInItem.Execute(ownerID);
|
||||||
int ownerID = SessionCheckOutItem.Execute(this.SessionID, itemID, itemType);
|
|
||||||
return ownerID;
|
|
||||||
}
|
|
||||||
public void CheckInItem(int ownerID)
|
|
||||||
{
|
|
||||||
SessionCheckInItem.Execute(ownerID);
|
|
||||||
}
|
|
||||||
private void DataPortal_Fetch(BeginSessionCriteria criteria)
|
private void DataPortal_Fetch(BeginSessionCriteria criteria)
|
||||||
{
|
{
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode());
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode());
|
||||||
@@ -298,56 +278,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex);
|
throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//private void DataPortal_Fetch(CanCheckOutItemCriteria criteria)
|
|
||||||
//{
|
|
||||||
// if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode());
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
|
||||||
// {
|
|
||||||
// ApplicationContext.LocalContext["cn"] = cn;
|
|
||||||
// using (SqlCommand cm = cn.CreateCommand())
|
|
||||||
// {
|
|
||||||
// cm.CommandType = CommandType.StoredProcedure;
|
|
||||||
// cm.CommandText = "vesp_SessionCanCheckOutItem";
|
|
||||||
// cm.Parameters.AddWithValue("@ObjectID", criteria.ObjectID);
|
|
||||||
// cm.Parameters.AddWithValue("@ObjectType", criteria.ObjectType);
|
|
||||||
// using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
|
||||||
// {
|
|
||||||
// while(dr.Read())
|
|
||||||
|
|
||||||
// if (!dr.Read())
|
|
||||||
// {
|
|
||||||
// _ErrorMessage = "No Record Found";
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// ReadData(dr);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // removing of item only needed for local data portal
|
|
||||||
// if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
|
|
||||||
// ApplicationContext.LocalContext.Remove("cn");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.DataPortal_Fetch", ex);
|
|
||||||
// _ErrorMessage = ex.Message;
|
|
||||||
// throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class BeginSessionCriteria
|
protected class BeginSessionCriteria
|
||||||
{
|
{
|
||||||
private string _UserID;
|
private readonly string _UserID;
|
||||||
public string UserID
|
public string UserID => _UserID;
|
||||||
{ get { return _UserID; } }
|
private readonly string _MachineName;
|
||||||
private string _MachineName;
|
public string MachineName => _MachineName;
|
||||||
public string MachineName
|
private readonly int _ProcessID;
|
||||||
{ get { return _MachineName; } }
|
public int ProcessID => _ProcessID;
|
||||||
private int _ProcessID;
|
|
||||||
public int ProcessID
|
|
||||||
{ get { return _ProcessID; } }
|
|
||||||
public BeginSessionCriteria(string userID, string machineName, int processID)
|
public BeginSessionCriteria(string userID, string machineName, int processID)
|
||||||
{
|
{
|
||||||
_UserID = userID;
|
_UserID = userID;
|
||||||
@@ -355,21 +294,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_ProcessID = processID;
|
_ProcessID = processID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//[Serializable()]
|
|
||||||
//protected class CanCheckOutItemCriteria
|
|
||||||
//{
|
|
||||||
// private int _ObjectID;
|
|
||||||
// public int ObjectID
|
|
||||||
// { get { return _ObjectID; } }
|
|
||||||
// private CheckOutType _ObjectType;
|
|
||||||
// public CheckOutType ObjectType
|
|
||||||
// { get { return _ObjectType; } }
|
|
||||||
// public CanCheckOutItemCriteria(int objectID, CheckOutType objectType)
|
|
||||||
// {
|
|
||||||
// _ObjectID = objectID;
|
|
||||||
// _ObjectType = objectType;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
public class TurnChangeManagerOff : CommandBase
|
public class TurnChangeManagerOff : CommandBase
|
||||||
{
|
{
|
||||||
@@ -473,19 +397,17 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class SessionPing : CommandBase
|
public class SessionPing : CommandBase
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private int _SessionID;
|
|
||||||
public int SessionID
|
public int SessionID { get; set; }
|
||||||
{
|
|
||||||
get { return _SessionID; }
|
|
||||||
set { _SessionID = value; }
|
|
||||||
}
|
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
public static void Execute(int sessionID)
|
public static void Execute(int sessionID)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SessionPing cmd = new SessionPing();
|
SessionPing cmd = new SessionPing
|
||||||
cmd.SessionID = sessionID;
|
{
|
||||||
|
SessionID = sessionID
|
||||||
|
};
|
||||||
DataPortal.Execute<SessionPing>(cmd);
|
DataPortal.Execute<SessionPing>(cmd);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -521,17 +443,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class SessionEnd : CommandBase
|
public class SessionEnd : CommandBase
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private int _SessionID;
|
|
||||||
public int SessionID
|
public int SessionID { get; set; }
|
||||||
{
|
|
||||||
get { return _SessionID; }
|
|
||||||
set { _SessionID = value; }
|
|
||||||
}
|
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
public static void Execute(int sessionID)
|
public static void Execute(int sessionID)
|
||||||
{
|
{
|
||||||
SessionEnd cmd = new SessionEnd();
|
SessionEnd cmd = new SessionEnd
|
||||||
cmd.SessionID = sessionID;
|
{
|
||||||
|
SessionID = sessionID
|
||||||
|
};
|
||||||
DataPortal.Execute<SessionEnd>(cmd);
|
DataPortal.Execute<SessionEnd>(cmd);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -562,37 +482,20 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class SessionCheckOutItem : CommandBase
|
public class SessionCheckOutItem : CommandBase
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private int _SessionID;
|
|
||||||
public int SessionID
|
public int SessionID { get; set; }
|
||||||
{
|
public int ItemID { get; set; }
|
||||||
get { return _SessionID; }
|
public int ItemType { get; set; }
|
||||||
set { _SessionID = value; }
|
public int OwnerID { get; set; }
|
||||||
}
|
|
||||||
private int _ItemID;
|
|
||||||
public int ItemID
|
|
||||||
{
|
|
||||||
get { return _ItemID; }
|
|
||||||
set { _ItemID = value; }
|
|
||||||
}
|
|
||||||
private int _ItemType;
|
|
||||||
public int ItemType
|
|
||||||
{
|
|
||||||
get { return _ItemType; }
|
|
||||||
set { _ItemType = value; }
|
|
||||||
}
|
|
||||||
private int _OwnerID;
|
|
||||||
public int OwnerID
|
|
||||||
{
|
|
||||||
get { return _OwnerID; }
|
|
||||||
set { _OwnerID = value; }
|
|
||||||
}
|
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
public static int Execute(int sessionID, int itemID, CheckOutType itemType)
|
public static int Execute(int sessionID, int itemID, CheckOutType itemType)
|
||||||
{
|
{
|
||||||
SessionCheckOutItem cmd = new SessionCheckOutItem();
|
SessionCheckOutItem cmd = new SessionCheckOutItem
|
||||||
cmd.SessionID = sessionID;
|
{
|
||||||
cmd.ItemID = itemID;
|
SessionID = sessionID,
|
||||||
cmd.ItemType = (int)itemType;
|
ItemID = itemID,
|
||||||
|
ItemType = (int)itemType
|
||||||
|
};
|
||||||
cmd = DataPortal.Execute<SessionCheckOutItem>(cmd);
|
cmd = DataPortal.Execute<SessionCheckOutItem>(cmd);
|
||||||
return cmd.OwnerID;
|
return cmd.OwnerID;
|
||||||
}
|
}
|
||||||
@@ -629,18 +532,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class SessionCheckInItem : CommandBase
|
public class SessionCheckInItem : CommandBase
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private int _OwnerID;
|
|
||||||
public int OwnerID
|
public int OwnerID { get; set; }
|
||||||
{
|
|
||||||
get { return _OwnerID; }
|
|
||||||
set { _OwnerID = value; }
|
|
||||||
}
|
|
||||||
private int _ItemID;
|
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
public static void Execute(int ownerID)
|
public static void Execute(int ownerID)
|
||||||
{
|
{
|
||||||
SessionCheckInItem cmd = new SessionCheckInItem();
|
SessionCheckInItem cmd = new SessionCheckInItem
|
||||||
cmd.OwnerID = ownerID;
|
{
|
||||||
|
OwnerID = ownerID
|
||||||
|
};
|
||||||
DataPortal.Execute<SessionCheckInItem>(cmd);
|
DataPortal.Execute<SessionCheckInItem>(cmd);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -671,23 +571,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class SessionChangedContents : CommandBase
|
public class SessionChangedContents : CommandBase
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private Int64 _LastContentChange;
|
|
||||||
public Int64 LastContentChange
|
public long LastContentChange { get; set; }
|
||||||
{
|
public Dictionary<int, long> ChangedContents { get; set; }
|
||||||
get { return _LastContentChange; }
|
|
||||||
set { _LastContentChange = value; }
|
|
||||||
}
|
|
||||||
private Dictionary<int,Int64> _ChangedContents;
|
|
||||||
public Dictionary<int, Int64> ChangedContents
|
|
||||||
{
|
|
||||||
get { return _ChangedContents; }
|
|
||||||
set { _ChangedContents = value; }
|
|
||||||
}
|
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
public static Dictionary<int, Int64> Execute(Int64 lastContentChanged)
|
public static Dictionary<int, long> Execute(long lastContentChanged)
|
||||||
{
|
{
|
||||||
SessionChangedContents cmd = new SessionChangedContents();
|
SessionChangedContents cmd = new SessionChangedContents
|
||||||
cmd.LastContentChange = lastContentChanged;
|
{
|
||||||
|
LastContentChange = lastContentChanged
|
||||||
|
};
|
||||||
cmd = DataPortal.Execute<SessionChangedContents>(cmd);
|
cmd = DataPortal.Execute<SessionChangedContents>(cmd);
|
||||||
return cmd.ChangedContents;
|
return cmd.ChangedContents;
|
||||||
}
|
}
|
||||||
@@ -706,9 +599,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cmd.Parameters.AddWithValue("@LastChanged", LastContentChange);
|
cmd.Parameters.AddWithValue("@LastChanged", LastContentChange);
|
||||||
cmd.Parameters.AddWithValue("@UserID", Volian.Base.Library.VlnSettings.UserID);
|
cmd.Parameters.AddWithValue("@UserID", Volian.Base.Library.VlnSettings.UserID);
|
||||||
SqlDataReader dr = cmd.ExecuteReader();
|
SqlDataReader dr = cmd.ExecuteReader();
|
||||||
ChangedContents = new Dictionary<int, Int64>();
|
ChangedContents = new Dictionary<int, long>();
|
||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
ChangedContents.Add(dr.GetInt32(0), (Int64)dr.GetSqlInt64(1));
|
ChangedContents.Add(dr.GetInt32(0), (long)dr.GetSqlInt64(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -723,23 +616,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class SessionChangedItems : CommandBase
|
public class SessionChangedItems : CommandBase
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private Int64 _LastContentChange;
|
|
||||||
public Int64 LastContentChange
|
public long LastContentChange { get; set; }
|
||||||
{
|
public Dictionary<int, long> ChangedItems { get; set; }
|
||||||
get { return _LastContentChange; }
|
|
||||||
set { _LastContentChange = value; }
|
|
||||||
}
|
|
||||||
private Dictionary<int, Int64> _ChangedItems;
|
|
||||||
public Dictionary<int, Int64> ChangedItems
|
|
||||||
{
|
|
||||||
get { return _ChangedItems; }
|
|
||||||
set { _ChangedItems = value; }
|
|
||||||
}
|
|
||||||
#region Factory Methods
|
#region Factory Methods
|
||||||
public static Dictionary<int, Int64> Execute(Int64 lastContentChanged)
|
public static Dictionary<int, long> Execute(long lastContentChanged)
|
||||||
{
|
{
|
||||||
SessionChangedItems cmd = new SessionChangedItems();
|
SessionChangedItems cmd = new SessionChangedItems
|
||||||
cmd.LastContentChange = lastContentChanged;
|
{
|
||||||
|
LastContentChange = lastContentChanged
|
||||||
|
};
|
||||||
cmd = DataPortal.Execute<SessionChangedItems>(cmd);
|
cmd = DataPortal.Execute<SessionChangedItems>(cmd);
|
||||||
return cmd.ChangedItems;
|
return cmd.ChangedItems;
|
||||||
}
|
}
|
||||||
@@ -758,9 +644,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cmd.Parameters.AddWithValue("@LastChanged", LastContentChange);
|
cmd.Parameters.AddWithValue("@LastChanged", LastContentChange);
|
||||||
cmd.Parameters.AddWithValue("@UserID", Volian.Base.Library.VlnSettings.UserID);
|
cmd.Parameters.AddWithValue("@UserID", Volian.Base.Library.VlnSettings.UserID);
|
||||||
SqlDataReader dr = cmd.ExecuteReader();
|
SqlDataReader dr = cmd.ExecuteReader();
|
||||||
ChangedItems = new Dictionary<int, Int64>();
|
ChangedItems = new Dictionary<int, long>();
|
||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
ChangedItems.Add(dr.GetInt32(0), (Int64)dr.GetSqlInt64(1));
|
ChangedItems.Add(dr.GetInt32(0), (long)dr.GetSqlInt64(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -777,24 +663,17 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region OwnerInfo stuff
|
#region OwnerInfo stuff
|
||||||
public partial class OwnerInfoList
|
public partial class OwnerInfoList
|
||||||
{
|
{
|
||||||
public static OwnerInfoList GetBySessionID(int sessionID)
|
public static OwnerInfoList GetBySessionID(int sessionID) => DataPortal.Fetch<OwnerInfoList>(new GetBySessionIDCriteria(sessionID));
|
||||||
{
|
|
||||||
OwnerInfoList tmp = DataPortal.Fetch<OwnerInfoList>(new GetBySessionIDCriteria(sessionID));
|
|
||||||
return tmp;
|
|
||||||
}
|
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class GetBySessionIDCriteria
|
protected class GetBySessionIDCriteria
|
||||||
{
|
{
|
||||||
private int _SessionID;
|
private readonly int _SessionID;
|
||||||
public int SessionID { get { return _SessionID; } }
|
public int SessionID => _SessionID;
|
||||||
public GetBySessionIDCriteria(int sessionID)
|
public GetBySessionIDCriteria(int sessionID) => _SessionID = sessionID;
|
||||||
{
|
|
||||||
_SessionID = sessionID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(GetBySessionIDCriteria criteria)
|
private void DataPortal_Fetch(GetBySessionIDCriteria criteria)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
RaiseListChangedEvents = false;
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode());
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -809,7 +688,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||||
{
|
{
|
||||||
IsReadOnly = false;
|
IsReadOnly = false;
|
||||||
while (dr.Read()) this.Add(new OwnerInfo(dr));
|
while (dr.Read()) Add(new OwnerInfo(dr));
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -820,7 +699,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex);
|
if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex);
|
||||||
throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex);
|
throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
this.RaiseListChangedEvents = true;
|
RaiseListChangedEvents = true;
|
||||||
}
|
}
|
||||||
public static OwnerInfoList GetByVersionID(int versionID)
|
public static OwnerInfoList GetByVersionID(int versionID)
|
||||||
{
|
{
|
||||||
@@ -839,16 +718,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class GetByVersionIDCriteria
|
protected class GetByVersionIDCriteria
|
||||||
{
|
{
|
||||||
private int _VersionID;
|
private readonly int _VersionID;
|
||||||
public int VersionID { get { return _VersionID; } }
|
public int VersionID => _VersionID;
|
||||||
public GetByVersionIDCriteria(int versionID)
|
public GetByVersionIDCriteria(int versionID) => _VersionID = versionID;
|
||||||
{
|
|
||||||
_VersionID = versionID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(GetByVersionIDCriteria criteria)
|
private void DataPortal_Fetch(GetByVersionIDCriteria criteria)
|
||||||
{
|
{
|
||||||
this.RaiseListChangedEvents = false;
|
RaiseListChangedEvents = false;
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode());
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -863,7 +739,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||||
{
|
{
|
||||||
IsReadOnly = false;
|
IsReadOnly = false;
|
||||||
while (dr.Read()) this.Add(new OwnerInfo(dr));
|
while (dr.Read()) Add(new OwnerInfo(dr));
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -874,7 +750,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex);
|
if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex);
|
||||||
throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex);
|
throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
this.RaiseListChangedEvents = true;
|
RaiseListChangedEvents = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public partial class OwnerInfo
|
public partial class OwnerInfo
|
||||||
@@ -899,12 +775,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class GetBySessionIDandFolderIDCriteria
|
protected class GetBySessionIDandFolderIDCriteria
|
||||||
{
|
{
|
||||||
private int _SessionID;
|
private readonly int _SessionID;
|
||||||
public int SessionID
|
public int SessionID => _SessionID;
|
||||||
{ get { return _SessionID; } }
|
private readonly int _FolderID;
|
||||||
private int _FolderID;
|
public int FolderID => _FolderID;
|
||||||
public int FolderID
|
|
||||||
{ get { return _FolderID; } }
|
|
||||||
public GetBySessionIDandFolderIDCriteria(int sessionID, int folderID)
|
public GetBySessionIDandFolderIDCriteria(int sessionID, int folderID)
|
||||||
{
|
{
|
||||||
_SessionID = sessionID;
|
_SessionID = sessionID;
|
||||||
@@ -968,12 +842,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class GetBySessionIDandVersionIDCriteria
|
protected class GetBySessionIDandVersionIDCriteria
|
||||||
{
|
{
|
||||||
private int _SessionID;
|
private readonly int _SessionID;
|
||||||
public int SessionID
|
public int SessionID => _SessionID;
|
||||||
{ get { return _SessionID; } }
|
private readonly int _VersionID;
|
||||||
private int _VersionID;
|
public int VersionID => _VersionID;
|
||||||
public int VersionID
|
|
||||||
{ get { return _VersionID; } }
|
|
||||||
public GetBySessionIDandVersionIDCriteria(int sessionID, int versionID)
|
public GetBySessionIDandVersionIDCriteria(int sessionID, int versionID)
|
||||||
{
|
{
|
||||||
_SessionID = sessionID;
|
_SessionID = sessionID;
|
||||||
@@ -1037,12 +909,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class GetByItemIDCriteria
|
protected class GetByItemIDCriteria
|
||||||
{
|
{
|
||||||
private int _ItemID;
|
private readonly int _ItemID;
|
||||||
public int ItemID
|
public int ItemID => _ItemID;
|
||||||
{ get { return _ItemID; } }
|
private readonly CheckOutType _ItemType;
|
||||||
private CheckOutType _ItemType;
|
public CheckOutType ItemType => _ItemType;
|
||||||
public CheckOutType ItemType
|
|
||||||
{ get { return _ItemType; } }
|
|
||||||
public GetByItemIDCriteria(int itemID, CheckOutType itemType)
|
public GetByItemIDCriteria(int itemID, CheckOutType itemType)
|
||||||
{
|
{
|
||||||
_ItemID = itemID;
|
_ItemID = itemID;
|
||||||
@@ -1090,7 +960,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
SessionInfo si = SessionInfo.Get(this.SessionID);
|
SessionInfo si = SessionInfo.Get(SessionID);
|
||||||
return si.UserID;
|
return si.UserID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1101,32 +971,20 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public partial class UserInfo
|
public partial class UserInfo
|
||||||
{
|
{
|
||||||
public static bool CanEdit(UserInfo myUserInfo, DocVersionInfo myDVI)
|
public static bool CanEdit(UserInfo myUserInfo, DocVersionInfo myDVI) => myUserInfo != null && myDVI != null && (myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsWriter(myDVI));
|
||||||
{
|
|
||||||
return myUserInfo!=null && myDVI!=null && (myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsWriter(myDVI));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool CanEditROs(UserInfo myUserInfo, DocVersionInfo myDVI)
|
public static bool CanEditROs(UserInfo myUserInfo, DocVersionInfo myDVI) => myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsROEditor(myDVI);
|
||||||
{
|
|
||||||
return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsROEditor(myDVI);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool CanCreateFolders(UserInfo myUserInfo, DocVersionInfo myDVI)
|
public static bool CanCreateFolders(UserInfo myUserInfo, DocVersionInfo myDVI) => myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI);
|
||||||
{
|
|
||||||
return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool CanCreateFolders(UserInfo myUserInfo, FolderInfo fi)
|
public static bool CanCreateFolders(UserInfo myUserInfo, FolderInfo fi) => myUserInfo != null && fi != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(fi.MyParent); //B2020-111 allow if set amin controls parent
|
||||||
{
|
|
||||||
return myUserInfo != null && fi != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(fi.MyParent); //B2020-111 allow if set amin controls parent
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsAdministrator()
|
public bool IsAdministrator()
|
||||||
{
|
{
|
||||||
if (this.UserMembershipCount == 0)
|
if (UserMembershipCount == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
@@ -1145,10 +1003,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// would then be skipped (from where is called)
|
// would then be skipped (from where is called)
|
||||||
public bool IsSetAdministrator(FolderInfo fldinf)
|
public bool IsSetAdministrator(FolderInfo fldinf)
|
||||||
{
|
{
|
||||||
if (this.UserMembershipCount == 0 || fldinf == null)
|
if (UserMembershipCount == 0 || fldinf == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
@@ -1173,10 +1031,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public bool IsSetAdministrator(DocVersionInfo dv)
|
public bool IsSetAdministrator(DocVersionInfo dv)
|
||||||
{
|
{
|
||||||
if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
if (UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
@@ -1200,10 +1058,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public bool IsWriter(DocVersionInfo dv)
|
public bool IsWriter(DocVersionInfo dv)
|
||||||
{
|
{
|
||||||
if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
if (UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
@@ -1227,10 +1085,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public bool IsReviewer(DocVersionInfo dv)
|
public bool IsReviewer(DocVersionInfo dv)
|
||||||
{
|
{
|
||||||
if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
if (UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
@@ -1254,10 +1112,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public bool IsROEditor(DocVersionInfo dv)
|
public bool IsROEditor(DocVersionInfo dv)
|
||||||
{
|
{
|
||||||
if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
if (UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
@@ -1280,10 +1138,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
// B2018-112 added for easy check if user's PROMS Security allows making edits - used in StepTabRibbon - SetButtonAndMenuEnabling()
|
// B2018-112 added for easy check if user's PROMS Security allows making edits - used in StepTabRibbon - SetButtonAndMenuEnabling()
|
||||||
public bool IsAllowedToEdit(DocVersionInfo dvi)
|
public bool IsAllowedToEdit(DocVersionInfo dvi) => IsAdministrator() || IsSetAdministrator(dvi) || IsWriter(dvi);
|
||||||
{
|
|
||||||
return IsAdministrator() || IsSetAdministrator(dvi) || IsWriter(dvi);
|
|
||||||
}
|
|
||||||
public static UserInfo GetByUserID(string userID)
|
public static UserInfo GetByUserID(string userID)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -1305,13 +1160,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class GetByUserIDCriteria
|
protected class GetByUserIDCriteria
|
||||||
{
|
{
|
||||||
private string _UserID;
|
private readonly string _UserID;
|
||||||
public string UserID
|
public string UserID => _UserID;
|
||||||
{ get { return _UserID; } }
|
public GetByUserIDCriteria(string userID) => _UserID = userID;
|
||||||
public GetByUserIDCriteria(string userID)
|
|
||||||
{
|
|
||||||
_UserID = userID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataPortal_Fetch(GetByUserIDCriteria criteria)
|
private void DataPortal_Fetch(GetByUserIDCriteria criteria)
|
||||||
|
|||||||
@@ -12,18 +12,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
Rtf = rtf;
|
Rtf = rtf;
|
||||||
WithBorder = withBorder;
|
WithBorder = withBorder;
|
||||||
}
|
}
|
||||||
private string _Rtf;
|
|
||||||
public string Rtf
|
public string Rtf { get; set; }
|
||||||
{
|
public bool WithBorder { get; set; }
|
||||||
get { return _Rtf; }
|
|
||||||
set { _Rtf = value; }
|
|
||||||
}
|
|
||||||
private bool _WithBorder;
|
|
||||||
public bool WithBorder
|
|
||||||
{
|
|
||||||
get { return _WithBorder; }
|
|
||||||
set { _WithBorder = value; }
|
|
||||||
}
|
|
||||||
private RtfLines _Lines;
|
private RtfLines _Lines;
|
||||||
public RtfLines Lines
|
public RtfLines Lines
|
||||||
{
|
{
|
||||||
@@ -43,10 +34,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
Lines.Add(new RtfLine(maxWidth, WithBorder ? @"\u9492?" : " ", WithBorder ? @"\u9472?" : " ", WithBorder ? @"\u9496?" : " ")); // Insert bottom line
|
Lines.Add(new RtfLine(maxWidth, WithBorder ? @"\u9492?" : " ", WithBorder ? @"\u9472?" : " ", WithBorder ? @"\u9496?" : " ")); // Insert bottom line
|
||||||
Lines.ReplaceLines(WithBorder);
|
Lines.ReplaceLines(WithBorder);
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => Lines.ToString();
|
||||||
{
|
|
||||||
return Lines.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public class RtfLines : List<RtfLine>
|
public class RtfLines : List<RtfLine>
|
||||||
{
|
{
|
||||||
@@ -58,7 +46,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// split text into lines
|
// split text into lines
|
||||||
string[] breaks = { "\r\n" };
|
string[] breaks = { "\r\n" };
|
||||||
string[] lines = txt.Split(breaks, StringSplitOptions.None);
|
string[] lines = txt.Split(breaks, StringSplitOptions.None);
|
||||||
//string lastLine = lines[lines.Length - 1];
|
|
||||||
foreach (string line in lines)
|
foreach (string line in lines)
|
||||||
Add(new RtfLine(line.Replace("\\bullet","*")));
|
Add(new RtfLine(line.Replace("\\bullet","*")));
|
||||||
}
|
}
|
||||||
@@ -89,19 +76,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
private static Regex _RegRightCheck = new Regex(@"-|\\u9472?|\\u8209\?");
|
private static readonly Regex _RegRightCheck = new Regex(@"-|\\u9472?|\\u8209\?");
|
||||||
private static Regex _RegAboveCheck = new Regex(@"\||\\u9474\?|\\u9492\?|\\u9516\?|\\u9532\?|\\u9500\?|\\u9484\?|\\u9524\?|\\u9488\?|\\u9508\?");
|
private static readonly Regex _RegAboveCheck = new Regex(@"\||\\u9474\?|\\u9492\?|\\u9516\?|\\u9532\?|\\u9500\?|\\u9484\?|\\u9524\?|\\u9488\?|\\u9508\?");
|
||||||
private static Regex _RegLeftCheck = new Regex(@"-|\\u9472\?|\\u9508\?|\\u9516\?|\\u9500\?|\\u9532\?|\\u9484\?|\\u9488\?|\\u9492\?|\\u8209\?");
|
private static readonly Regex _RegLeftCheck = new Regex(@"-|\\u9472\?|\\u9508\?|\\u9516\?|\\u9500\?|\\u9532\?|\\u9484\?|\\u9488\?|\\u9492\?|\\u8209\?");
|
||||||
private static Regex _RegBelowCheck = new Regex(@"\||\\u9474\?");
|
private static readonly Regex _RegBelowCheck = new Regex(@"\||\\u9474\?");
|
||||||
|
|
||||||
private static Regex _RegRightCheck1 = new Regex(@"\\u9474\?");
|
private static readonly Regex _RegRightCheck1 = new Regex(@"\\u9474\?");
|
||||||
private static Regex _RegAboveCheck1 = new Regex(@"\\u9472\?|\\u8209\?");
|
private static readonly Regex _RegAboveCheck1 = new Regex(@"\\u9472\?|\\u8209\?");
|
||||||
private static Regex _RegLeftCheck1 = new Regex(@"\\u9474\?");
|
private static readonly Regex _RegLeftCheck1 = new Regex(@"\\u9474\?");
|
||||||
private static Regex _RegBelowCheck1 = new Regex(@"\\u9472\?|\\u8209\?");
|
private static readonly Regex _RegBelowCheck1 = new Regex(@"\\u9472\?|\\u8209\?");
|
||||||
|
|
||||||
private static Regex _RegHorizontalCheck = new Regex(@"-|\\u9472\?|\\u8209\?");
|
private static readonly Regex _RegHorizontalCheck = new Regex(@"-|\\u9472\?|\\u8209\?");
|
||||||
private static Regex _RegVerticalCheck = new Regex(@"\||\\u9474\?");
|
private static readonly Regex _RegVerticalCheck = new Regex(@"\||\\u9474\?");
|
||||||
static private string[] TableCharsU = {
|
private static readonly string[] TableCharsU = {
|
||||||
"\x0", // HEX"\x0", // No character
|
"\x0", // HEX"\x0", // No character
|
||||||
@"\u9472?", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4'
|
@"\u9472?", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4'
|
||||||
@"\u9474?", // HEX@"\u2502",// | Vertical line - 16-bit char: '\xB3'
|
@"\u9474?", // HEX@"\u2502",// | Vertical line - 16-bit char: '\xB3'
|
||||||
@@ -159,24 +146,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void ListItems(string loc, string str)
|
|
||||||
{
|
|
||||||
StringBuilder sb = new StringBuilder(string.Format("{0} = @\"", loc));
|
|
||||||
string sep = "";
|
|
||||||
foreach (char c in str)
|
|
||||||
{
|
|
||||||
if (c < 127)
|
|
||||||
sb.Append(sep + c.ToString());
|
|
||||||
else
|
|
||||||
sb.Append(sep + string.Format("\\u{0}?", (int)c));
|
|
||||||
sep = "|";
|
|
||||||
}
|
|
||||||
Console.WriteLine(sb.ToString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public class RtfLine : List<RtfPiece>
|
public class RtfLine : List<RtfPiece>
|
||||||
{
|
{
|
||||||
private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*|\\up[0-9]|\\ul|\\ulnone)+( |$|(?=\\['u])))?(<START\]|#Link.*?\[END>|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)");
|
private static readonly Regex _RegRtfText = new Regex(@"((\\[^'u ]*|\\up[0-9]|\\ul|\\ulnone)+( |$|(?=\\['u])))?(<START\]|#Link.*?\[END>|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)");
|
||||||
public RtfLine(string text)
|
public RtfLine(string text)
|
||||||
{
|
{
|
||||||
MatchCollection matches = _RegRtfText.Matches(text);
|
MatchCollection matches = _RegRtfText.Matches(text);
|
||||||
@@ -192,15 +165,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
nextIndex = match.Index + match.Length;
|
nextIndex = match.Index + match.Length;
|
||||||
string rtfPart = match.Groups[1].ToString();
|
string rtfPart = match.Groups[1].ToString();
|
||||||
if (match.Groups[1].ToString().TrimEnd(" ".ToCharArray()).Length + match.Groups[4].ToString().Length > 0)
|
if (match.Groups[1].ToString().TrimEnd(" ".ToCharArray()).Length + match.Groups[4].ToString().Length > 0)
|
||||||
this.Add(new RtfPiece(match.Groups[1].ToString().TrimEnd(" ".ToCharArray()), match.Groups[4].ToString()));
|
Add(new RtfPiece(match.Groups[1].ToString().TrimEnd(" ".ToCharArray()), match.Groups[4].ToString()));
|
||||||
//if (match.Groups[1].ToString().Length + match.Groups[4].ToString().Length > 0)
|
|
||||||
// this.Add(new RtfPiece(match.Groups[1].ToString(), match.Groups[4].ToString()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public RtfLine(int width, string left, string fill, string right)
|
public RtfLine(int width, string left, string fill, string right)
|
||||||
{
|
{
|
||||||
Add(new RtfPiece("", left));
|
Add(new RtfPiece("", left));
|
||||||
for (int i = 0; i < width; i++) this.Add(new RtfPiece("", fill)); // Pad
|
for (int i = 0; i < width; i++) Add(new RtfPiece("", fill)); // Pad
|
||||||
Add(new RtfPiece("", right));
|
Add(new RtfPiece("", right));
|
||||||
}
|
}
|
||||||
public int MaximumWidth
|
public int MaximumWidth
|
||||||
@@ -223,9 +194,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
internal void Pad(int maxWidth, string edge)
|
internal void Pad(int maxWidth, string edge)
|
||||||
{
|
{
|
||||||
int pad = maxWidth - MaximumWidth;
|
int pad = maxWidth - MaximumWidth;
|
||||||
this.Insert(0, new RtfPiece("", edge)); // Left Edge
|
Insert(0, new RtfPiece("", edge)); // Left Edge
|
||||||
for (int i = 0; i < pad; i++) this.Add(new RtfPiece("", " ")); // Pad
|
for (int i = 0; i < pad; i++) Add(new RtfPiece("", " ")); // Pad
|
||||||
this.Add(new RtfPiece("", edge)); // Right Edge
|
Add(new RtfPiece("", edge)); // Right Edge
|
||||||
}
|
}
|
||||||
public new RtfPiece this[int index]
|
public new RtfPiece this[int index]
|
||||||
{
|
{
|
||||||
@@ -246,61 +217,23 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public class RtfPiece
|
public class RtfPiece
|
||||||
{
|
{
|
||||||
private string _Rtf;
|
public string Rtf { get; set; }
|
||||||
public string Rtf
|
public string Text { get; set; } = "";
|
||||||
{
|
public int TextLength => Text.Length;
|
||||||
get { return _Rtf; }
|
public int MaximumWidth => Text == "" ? 0 : 1;
|
||||||
set { _Rtf = value; }
|
private static readonly Regex _RegStartLink = new Regex(@"<START\]");
|
||||||
}
|
private static readonly Regex _RegEndLink = new Regex(@"#Link.*?\[END>");
|
||||||
private string _Text = "";
|
|
||||||
public string Text
|
|
||||||
{
|
|
||||||
get { return _Text; }
|
|
||||||
set { _Text = value; }
|
|
||||||
}
|
|
||||||
public int TextLength
|
|
||||||
{
|
|
||||||
get { return Text.Length; }
|
|
||||||
}
|
|
||||||
public int MaximumWidth
|
|
||||||
{
|
|
||||||
get { return Text == "" ? 0 : 1; }
|
|
||||||
}
|
|
||||||
private static Regex _RegStartLink = new Regex(@"<START\]");
|
|
||||||
private static Regex _RegEndLink = new Regex(@"#Link.*?\[END>");
|
|
||||||
public RtfPiece(string rtf, string text)
|
public RtfPiece(string rtf, string text)
|
||||||
{
|
{
|
||||||
_Rtf = rtf;
|
Rtf = rtf;
|
||||||
if (_RegStartLink.IsMatch(text) || _RegEndLink.IsMatch(text))
|
if (_RegStartLink.IsMatch(text) || _RegEndLink.IsMatch(text))
|
||||||
_Rtf += (rtf == "" ? "" : " ") + text;
|
Rtf += (rtf == "" ? "" : " ") + text;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_Rtf += rtf == "" ? "" : " ";
|
Rtf += rtf == "" ? "" : " ";
|
||||||
_Text = text;
|
Text = text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => Rtf + Text;
|
||||||
{
|
|
||||||
return _Rtf + _Text;
|
|
||||||
//string retval = _RegUnicode.Replace(_Text, new MatchEvaluator(RtfUnicodeCharacter));
|
|
||||||
//retval = _RegHex.Replace(retval, new MatchEvaluator(RtfHexCharacter));
|
|
||||||
//return retval;
|
|
||||||
}
|
|
||||||
//private static Regex _RegUnicode = new Regex(@"\\u([0-9ABCDEF]*)\?");
|
|
||||||
//internal static string RtfUnicodeCharacter(Match myMatch)
|
|
||||||
//{
|
|
||||||
// string hexStr = myMatch.Groups[1].ToString();
|
|
||||||
// int i = int.Parse(hexStr);
|
|
||||||
// Char schar = Convert.ToChar(i);
|
|
||||||
// return schar.ToString();
|
|
||||||
//}
|
|
||||||
//private static Regex _RegHex = new Regex(@"\\'([0-9A-Fa-f]{2})");
|
|
||||||
//internal static string RtfHexCharacter(Match myMatch)
|
|
||||||
//{
|
|
||||||
// string hexStr = myMatch.Groups[1].ToString();
|
|
||||||
// int i = int.Parse(hexStr, System.Globalization.NumberStyles.HexNumber);
|
|
||||||
// Char schar = Convert.ToChar(i);
|
|
||||||
// return schar.ToString();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,27 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using Csla;
|
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
public partial class ContentPart
|
public partial class ContentPart
|
||||||
{
|
{
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
|
||||||
{
|
|
||||||
return string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class ItemPart
|
public partial class ItemPart
|
||||||
{
|
{
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} {1}", _MyContent.Number, MyContent.Text);
|
||||||
{
|
|
||||||
return string.Format("{0} {1}", _MyContent.Number, MyContent.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class Part
|
public partial class Part
|
||||||
{
|
{
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
|
||||||
{
|
|
||||||
return string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class PartInfoList
|
public partial class PartInfoList
|
||||||
{
|
{
|
||||||
internal PartInfoList(SafeDataReader dr, ItemInfo itemInfo)
|
internal PartInfoList(SafeDataReader dr, ItemInfo itemInfo) => AddPartInfo(dr, itemInfo);
|
||||||
{
|
|
||||||
AddPartInfo(dr,itemInfo);
|
|
||||||
}
|
|
||||||
internal void AddPartInfo(SafeDataReader dr, ItemInfo itemInfo)
|
internal void AddPartInfo(SafeDataReader dr, ItemInfo itemInfo)
|
||||||
{
|
{
|
||||||
IsReadOnly = false;
|
IsReadOnly = false;
|
||||||
this.Add(new PartInfo(dr, itemInfo));
|
Add(new PartInfo(dr, itemInfo));
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
}
|
}
|
||||||
public PartInfo Find(E_FromType fromType)
|
public PartInfo Find(E_FromType fromType)
|
||||||
@@ -124,8 +109,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (_SearchDefaultSort == null)
|
if (_SearchDefaultSort == null)
|
||||||
{
|
{
|
||||||
string partText = String.Empty;
|
string partText;
|
||||||
|
|
||||||
switch ((E_FromType)FromType)
|
switch ((E_FromType)FromType)
|
||||||
{
|
{
|
||||||
case E_FromType.Caution:
|
case E_FromType.Caution:
|
||||||
@@ -189,10 +173,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("PartInfo.ReadData", ex);
|
throw new DbCslaException("PartInfo.ReadData", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public E_FromType PartType
|
public E_FromType PartType => (E_FromType)_FromType;
|
||||||
{ get { return (E_FromType)_FromType; } }
|
public E_FromTypes PartTypes => (E_FromTypes)_FromType;
|
||||||
public E_FromTypes PartTypes
|
|
||||||
{ get { return (E_FromTypes)_FromType; } }
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
// if the parttype is table or figure, add the correct label:
|
// if the parttype is table or figure, add the correct label:
|
||||||
@@ -204,27 +186,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return string.Format("{0}", PartTypes);
|
return string.Format("{0}", PartTypes);
|
||||||
}
|
}
|
||||||
//public string ToString(string str, System.IFormatProvider ifp)
|
|
||||||
//{
|
|
||||||
// return ToString();
|
|
||||||
//}
|
|
||||||
#region IVEDrillDownReadOnly
|
#region IVEDrillDownReadOnly
|
||||||
public ItemInfoList _MyItems;
|
public ItemInfoList _MyItems;
|
||||||
public ItemInfoList MyItems
|
public ItemInfoList MyItems => _MyItems ?? (_MyItems = ItemInfoList.GetList(_ItemID, _FromType));
|
||||||
{ get { return (_MyItems != null ? _MyItems : _MyItems = ItemInfoList.GetList(_ItemID, _FromType)); } }
|
public System.Collections.IList GetChildren() => MyItems;
|
||||||
public System.Collections.IList GetChildren()
|
public bool HasChildren => MyContent.ContentPartCount > 0;
|
||||||
{
|
|
||||||
//return (_MyItems != null ? _MyItems : _MyItems = ItemInfoList.GetList(_ItemID, _FromType));
|
|
||||||
return MyItems;
|
|
||||||
}
|
|
||||||
//public bool ChildrenAreLoaded
|
|
||||||
//{
|
|
||||||
// get { return _MyItems == null; }
|
|
||||||
//}
|
|
||||||
public bool HasChildren
|
|
||||||
{
|
|
||||||
get { return this.MyContent.ContentPartCount > 0; }
|
|
||||||
}
|
|
||||||
public IVEDrillDownReadOnly ActiveParent
|
public IVEDrillDownReadOnly ActiveParent
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -234,55 +200,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return parentContent.ContentItems[0];
|
return parentContent.ContentItems[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public FormatInfo ActiveFormat
|
public FormatInfo ActiveFormat => ActiveParent.ActiveFormat;
|
||||||
{
|
public FormatInfo LocalFormat => null;
|
||||||
get { return ActiveParent.ActiveFormat; }
|
public ConfigDynamicTypeDescriptor MyConfig => null;
|
||||||
}
|
public bool IsFolder => false;
|
||||||
public FormatInfo LocalFormat
|
public bool IsDocVersion => false;
|
||||||
{
|
public bool IsProcedure => false;
|
||||||
get { return null; }
|
public bool IsSection => false;
|
||||||
}
|
public bool IsStep => false;
|
||||||
public ConfigDynamicTypeDescriptor MyConfig
|
|
||||||
{
|
|
||||||
get { return null; }
|
|
||||||
}
|
|
||||||
public bool IsFolder
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsDocVersion
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsProcedure
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsSection
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool IsStep
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//public bool HasStandardSteps()
|
|
||||||
//{ return false; }
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
|
||||||
using Csla.Validation;
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@@ -14,8 +9,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public static void DeleteAll(int docID)
|
public static void DeleteAll(int docID)
|
||||||
{
|
{
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DataPortal.Delete(new DocIDCriteria(docID));
|
DataPortal.Delete(new DocIDCriteria(docID));
|
||||||
@@ -28,13 +21,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class DocIDCriteria
|
protected class DocIDCriteria
|
||||||
{
|
{
|
||||||
private int _DocID;
|
private readonly int _DocID;
|
||||||
public int DocID
|
public int DocID => _DocID;
|
||||||
{ get { return _DocID; } }
|
public DocIDCriteria(int docID) => _DocID = docID;
|
||||||
public DocIDCriteria(int docID)
|
|
||||||
{
|
|
||||||
_DocID = docID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Transactional(TransactionalTypes.TransactionScope)]
|
[Transactional(TransactionalTypes.TransactionScope)]
|
||||||
private void DataPortal_Delete(DocIDCriteria criteria)
|
private void DataPortal_Delete(DocIDCriteria criteria)
|
||||||
@@ -66,8 +55,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// used to remove word section PDFs to force ROs to be updated when printed or saved
|
// used to remove word section PDFs to force ROs to be updated when printed or saved
|
||||||
public static void DeleteDocVersionPDFsWithNewROs(int versionID, int origfstid, int newfstid)
|
public static void DeleteDocVersionPDFsWithNewROs(int versionID, int origfstid, int newfstid)
|
||||||
{
|
{
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DeleteWithNewROs(versionID, origfstid, newfstid);
|
DeleteWithNewROs(versionID, origfstid, newfstid);
|
||||||
@@ -111,11 +98,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (sect.MyContent.MyEntry == null) return; // B2023-030 not a word section so just jump out
|
if (sect.MyContent.MyEntry == null) return; // B2023-030 not a word section so just jump out
|
||||||
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
|
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
|
||||||
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
|
|
||||||
|
|
||||||
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
|
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||||
|
|
||||||
if (sc != null && sc.Section_WordMargin == "Y")
|
if (sect.ActiveSection.MyConfig is SectionConfig sc && sc.Section_WordMargin == "Y")
|
||||||
{
|
{
|
||||||
RemoveFromCachedByPrimaryKey(sect.MyContent.MyEntry.DocID, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0);
|
RemoveFromCachedByPrimaryKey(sect.MyContent.MyEntry.DocID, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
@@ -132,18 +118,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (count < 2)
|
while (count < 2)
|
||||||
{
|
{
|
||||||
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
|
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
|
||||||
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
|
|
||||||
PdfInfo myPdf = null;
|
|
||||||
|
|
||||||
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
|
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||||
|
|
||||||
if (sc != null && sc.Section_WordMargin == "Y")
|
PdfInfo myPdf;
|
||||||
|
if (sect.ActiveSection.MyConfig is SectionConfig sc && sc.Section_WordMargin == "Y")
|
||||||
{
|
{
|
||||||
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0);
|
myPdf = Get(sect.MyContent.MyEntry.DocID, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
|
myPdf = Get(sect.MyContent.MyEntry.DocID, ss * 10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
|
||||||
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth);
|
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,6 @@
|
|||||||
// $History: $
|
// $History: $
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Data;
|
|
||||||
using System.Data.SqlClient;
|
|
||||||
using Csla;
|
|
||||||
using Csla.Data;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.IO;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
@@ -23,21 +16,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public partial class ChildFoldersPropertyDescriptor
|
public partial class ChildFoldersPropertyDescriptor
|
||||||
{
|
{
|
||||||
public override string DisplayName
|
public override string DisplayName => Item.Name;
|
||||||
{ get { return Item.Name; } }
|
public override string Description => Item.Title;
|
||||||
public override string Description
|
public override string Name => Item.Name;
|
||||||
{ get { return Item.Title; } }
|
|
||||||
public override string Name
|
|
||||||
{ get { return Item.Name; } }
|
|
||||||
}
|
}
|
||||||
public partial class FolderDocVersionsPropertyDescriptor
|
public partial class FolderDocVersionsPropertyDescriptor
|
||||||
{
|
{
|
||||||
public override string DisplayName
|
public override string DisplayName => Item.Name;
|
||||||
{ get { return Item.Name; } }
|
public override string Description => Item.Name;
|
||||||
public override string Description
|
public override string Name => Item.Name;
|
||||||
{ get { return Item.Name; } }
|
|
||||||
public override string Name
|
|
||||||
{ get { return Item.Name; } }
|
|
||||||
}
|
}
|
||||||
public class FormatList : System.ComponentModel.StringConverter
|
public class FormatList : System.ComponentModel.StringConverter
|
||||||
{
|
{
|
||||||
@@ -64,18 +51,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_MyFormatInfoList.Add("", null);
|
_MyFormatInfoList.Add("", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) => new StandardValuesCollection((ICollection)MyFormatInfoList.Values);
|
||||||
{
|
public override bool GetStandardValuesSupported(ITypeDescriptorContext context) => true;
|
||||||
return new StandardValuesCollection((ICollection)MyFormatInfoList.Values);
|
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) => true;
|
||||||
}
|
|
||||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public static int? ToInt(string formatName)
|
public static int? ToInt(string formatName)
|
||||||
{
|
{
|
||||||
if (formatName == null || formatName == string.Empty) return null;
|
if (formatName == null || formatName == string.Empty) return null;
|
||||||
@@ -136,31 +114,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!ds.Inactive)_MyDocStyleList.Add(ds.Name,10000 + (int) ds.Index);
|
if (!ds.Inactive)_MyDocStyleList.Add(ds.Name,10000 + (int) ds.Index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) => new StandardValuesCollection((ICollection)MyDocStyleList.Keys);
|
||||||
{
|
public override bool GetStandardValuesSupported(ITypeDescriptorContext context) => true;
|
||||||
return new StandardValuesCollection((ICollection)MyDocStyleList.Keys);
|
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) => true;
|
||||||
}
|
public static int? ToInt(string docStyleName) => MyDocStyleList[docStyleName];
|
||||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
public static string ToString(int? sectionType) => sectionType == null ? null : MyDocStyleList.Keys[MyDocStyleList.IndexOfValue((int)sectionType)];
|
||||||
{
|
public static int ToSectionType(string docStyleName) => MyDocStyleList[docStyleName];
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public static int? ToInt(string docStyleName)
|
|
||||||
{
|
|
||||||
return MyDocStyleList[docStyleName];
|
|
||||||
}
|
|
||||||
public static string ToString(int? sectionType)
|
|
||||||
{
|
|
||||||
if (sectionType == null) return null;
|
|
||||||
return MyDocStyleList.Keys[MyDocStyleList.IndexOfValue((int)sectionType)];
|
|
||||||
}
|
|
||||||
public static int ToSectionType(string docStyleName)
|
|
||||||
{
|
|
||||||
return MyDocStyleList[docStyleName];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,6 @@
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.Specialized;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using System.Xml;
|
|
||||||
using System.Xml.XPath;
|
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
@@ -28,17 +21,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region RODb Config
|
#region RODb Config
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private RODbConfig _RODbConfig;
|
private RODbConfig _RODbConfig;
|
||||||
public RODbConfig RODbConfig
|
public RODbConfig RODbConfig => _RODbConfig ?? (_RODbConfig = new RODbConfig(this));
|
||||||
{ get { return (_RODbConfig != null ? _RODbConfig : _RODbConfig = new RODbConfig(this)); } }
|
|
||||||
private void RODbConfigRefresh()
|
|
||||||
{
|
|
||||||
_RODbConfig = null;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
public static RODbInfo GetJustRODB(int rODbID)
|
public static RODbInfo GetJustRODB(int rODbID)
|
||||||
{
|
{
|
||||||
//if (!CanGetObject())
|
|
||||||
// throw new System.Security.SecurityException("User not authorized to view a RODb");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RODbInfo tmp = GetCachedByPrimaryKey(rODbID);
|
RODbInfo tmp = GetCachedByPrimaryKey(rODbID);
|
||||||
@@ -62,13 +48,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PKCriteriaJustRODB
|
protected class PKCriteriaJustRODB
|
||||||
{
|
{
|
||||||
private int _RODbID;
|
private readonly int _RODbID;
|
||||||
public int RODbID
|
public int RODbID => _RODbID;
|
||||||
{ get { return _RODbID; } }
|
public PKCriteriaJustRODB(int rODbID) => _RODbID = rODbID;
|
||||||
public PKCriteriaJustRODB(int rODbID)
|
|
||||||
{
|
|
||||||
_RODbID = rODbID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(PKCriteriaJustRODB criteria)
|
private void DataPortal_Fetch(PKCriteriaJustRODB criteria)
|
||||||
{
|
{
|
||||||
@@ -112,8 +94,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public static RODb GetJustRoDb(int rODbID)
|
public static RODb GetJustRoDb(int rODbID)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to view a RODb");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RODb tmp = DataPortal.Fetch<RODb>(new PKCriteriaJustRoDb(rODbID));
|
RODb tmp = DataPortal.Fetch<RODb>(new PKCriteriaJustRoDb(rODbID));
|
||||||
@@ -151,15 +131,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ReadData(dr);
|
ReadData(dr);
|
||||||
// Don't load child objects
|
|
||||||
//dr.NextResult();
|
|
||||||
//_RODbROFsts = RODbROFsts.Get(dr);
|
|
||||||
// load child objects
|
|
||||||
//dr.NextResult();
|
|
||||||
//_RODbROImages = RODbROImages.Get(dr);
|
|
||||||
// load child objects
|
|
||||||
//dr.NextResult();
|
|
||||||
//_RODbRoUsages = RODbRoUsages.Get(dr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// removing of item only needed for local data portal
|
// removing of item only needed for local data portal
|
||||||
@@ -177,18 +148,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PKCriteriaJustRoDb
|
protected class PKCriteriaJustRoDb
|
||||||
{
|
{
|
||||||
private int _RODbID;
|
private readonly int _RODbID;
|
||||||
public int RODbID
|
public int RODbID => _RODbID;
|
||||||
{ get { return _RODbID; } }
|
public PKCriteriaJustRoDb(int rODbID) => _RODbID = rODbID;
|
||||||
public PKCriteriaJustRoDb(int rODbID)
|
|
||||||
{
|
|
||||||
_RODbID = rODbID;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#region Log4Net
|
|
||||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region RODb Config
|
#region RODb Config
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
@@ -205,10 +168,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _RODbConfig;
|
return _RODbConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void _RODbConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
private void _RODbConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) => Config = _RODbConfig.ToString();
|
||||||
{
|
|
||||||
Config = _RODbConfig.ToString();
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Xml.Serialization;
|
|
||||||
using System.Xml;
|
|
||||||
using System.Xml.XPath;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
@@ -30,9 +26,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public static ROFst GetJustROFst(int rOFstID)
|
public static ROFst GetJustROFst(int rOFstID)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to view a ROFst");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ROFst tmp = GetCachedByPrimaryKey(rOFstID);
|
ROFst tmp = GetCachedByPrimaryKey(rOFstID);
|
||||||
@@ -59,13 +52,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PKCriteriaJustROFst
|
protected class PKCriteriaJustROFst
|
||||||
{
|
{
|
||||||
private int _ROFstID;
|
private readonly int _ROFstID;
|
||||||
public int ROFstID
|
public int ROFstID => _ROFstID;
|
||||||
{ get { return _ROFstID; } }
|
public PKCriteriaJustROFst(int rOFstID) => _ROFstID = rOFstID;
|
||||||
public PKCriteriaJustROFst(int rOFstID)
|
|
||||||
{
|
|
||||||
_ROFstID = rOFstID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataPortal_Fetch(PKCriteriaJustROFst criteria)
|
private void DataPortal_Fetch(PKCriteriaJustROFst criteria)
|
||||||
@@ -111,22 +100,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public partial class ROFstInfo
|
public partial class ROFstInfo
|
||||||
{
|
{
|
||||||
#region Log4Net
|
|
||||||
|
|
||||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PKCriteriaJustROFst
|
protected class PKCriteriaJustROFst
|
||||||
{
|
{
|
||||||
private int _ROFstID;
|
private readonly int _ROFstID;
|
||||||
public int ROFstID
|
public int ROFstID => _ROFstID;
|
||||||
{ get { return _ROFstID; } }
|
public PKCriteriaJustROFst(int rOFstID) => _ROFstID = rOFstID;
|
||||||
public PKCriteriaJustROFst(int rOFstID)
|
|
||||||
{
|
|
||||||
_ROFstID = rOFstID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Fields
|
#region Fields
|
||||||
@@ -134,6 +114,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// this is used by the frmBatchRefresh which is the Adim Tools so that one message is display for a group of procedure sets processed
|
// this is used by the frmBatchRefresh which is the Adim Tools so that one message is display for a group of procedure sets processed
|
||||||
public static StringBuilder MessageList = null;
|
public static StringBuilder MessageList = null;
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static List<int> DocVersionsNeedingROUpdate = new List<int>();
|
private static List<int> DocVersionsNeedingROUpdate = new List<int>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -145,12 +126,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
public ROFSTLookup GetROFSTLookup(DocVersionInfo dvi, string ovrrideChild = null, bool showLoadingStatus = true)
|
|
||||||
{
|
|
||||||
// B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database
|
// B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database
|
||||||
return new ROFSTLookup(this.ROFstID, dvi, ovrrideChild, showLoadingStatus);
|
public ROFSTLookup GetROFSTLookup(DocVersionInfo dvi, string ovrrideChild = null, bool showLoadingStatus = true) => new ROFSTLookup(this.ROFstID, dvi, ovrrideChild, showLoadingStatus);
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds an ro.fst into a sql database.
|
/// Adds an ro.fst into a sql database.
|
||||||
@@ -218,7 +195,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (myUnChangedROImages.Count > 0)
|
if (myUnChangedROImages.Count > 0)
|
||||||
|
#pragma warning disable CS0642 // Possible mistaken empty statement - valid - keeps scope of add
|
||||||
using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ;
|
using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ;
|
||||||
|
#pragma warning restore CS0642 // Possible mistaken empty statement
|
||||||
|
|
||||||
return rofst;
|
return rofst;
|
||||||
}
|
}
|
||||||
@@ -252,8 +231,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
TimeSpan ts = DateTime.Now - start;
|
TimeSpan ts = DateTime.Now - start;
|
||||||
|
|
||||||
if (tbStatus != null)
|
tbStatus?.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, itm.MyProcedure.DisplayNumber, ItemInfo.ROCheckCount, ItemInfo.ROFixCount, ts.TotalSeconds));
|
||||||
tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, itm.MyProcedure.DisplayNumber, ItemInfo.ROCheckCount, ItemInfo.ROFixCount, ts.TotalSeconds));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update the DocVersion Associations to link to the new RO FST id and current date/time
|
//Update the DocVersion Associations to link to the new RO FST id and current date/time
|
||||||
@@ -288,7 +266,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
DocVersionInfo dvi = DocVersionInfo.Get(proc.MyDocVersion.VersionID);
|
DocVersionInfo dvi = DocVersionInfo.Get(proc.MyDocVersion.VersionID);
|
||||||
if (dvi.DocVersionConfig.SelectedSlave <= 0)
|
if (dvi.DocVersionConfig.SelectedSlave <= 0)
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
DateTime start = DateTime.Now;
|
DateTime start = DateTime.Now;
|
||||||
|
|
||||||
ProcedureInfo.ResetCheckROLinkCounters();
|
ProcedureInfo.ResetCheckROLinkCounters();
|
||||||
@@ -297,8 +274,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
TimeSpan ts = DateTime.Now - start;
|
TimeSpan ts = DateTime.Now - start;
|
||||||
|
|
||||||
if (tbStatus != null)
|
tbStatus?.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects Links{0}, Found {3} Bad RO Links{0} Elapsed Seconds:{5}{0}{0}", Environment.NewLine, proc.DisplayNumber, ProcedureInfo.CheckROLinksCount, ProcedureInfo.BadROLinksCount, ProcedureInfo.FixedROLinksCount, ts.TotalSeconds));
|
||||||
tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects Links{0}, Found {3} Bad RO Links{0} Elapsed Seconds:{5}{0}{0}", Environment.NewLine, proc.DisplayNumber, ProcedureInfo.CheckROLinksCount, ProcedureInfo.BadROLinksCount, ProcedureInfo.FixedROLinksCount, ts.TotalSeconds));
|
|
||||||
/*** keep for now - incase we decide to fix RO links later on, this will show the number of RO Links that we fixed
|
/*** keep for now - incase we decide to fix RO links later on, this will show the number of RO Links that we fixed
|
||||||
//tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects Links{0}, Found {3} Bad RO Links{0}, Fixed {4} Bad RO Links{0} Elapsed Seconds:{5}{0}{0}", Environment.NewLine, proc.DisplayNumber, ProcedureInfo.CheckROLinksCount, ProcedureInfo.BadROLinksCount, ProcedureInfo.FixedROLinksCount, ts.TotalSeconds));
|
//tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects Links{0}, Found {3} Bad RO Links{0}, Fixed {4} Bad RO Links{0} Elapsed Seconds:{5}{0}{0}", Environment.NewLine, proc.DisplayNumber, ProcedureInfo.CheckROLinksCount, ProcedureInfo.BadROLinksCount, ProcedureInfo.FixedROLinksCount, ts.TotalSeconds));
|
||||||
***/
|
***/
|
||||||
@@ -330,7 +306,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
ROWorkingDraftAsk.ClearWorkingDrafts();
|
ROWorkingDraftAsk.ClearWorkingDrafts();
|
||||||
|
|
||||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Starting Update");
|
myProgressBarRefresh?.Invoke(0, 100, "Starting Update");
|
||||||
|
|
||||||
int origFSTid = origROFst.ROFstID;
|
int origFSTid = origROFst.ROFstID;
|
||||||
|
|
||||||
@@ -346,16 +322,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (rofst != null)
|
if (rofst != null)
|
||||||
{
|
{
|
||||||
// Get a list of figures which have changed content (DTS)
|
// Get a list of figures which have changed content (DTS)
|
||||||
List<string> MyChangedFigureROIDs = null;
|
|
||||||
|
|
||||||
if (docver.ROfstLoadingFigures) // B2017-125 see if loading figures was completed
|
if (docver.ROfstLoadingFigures) // B2017-125 see if loading figures was completed
|
||||||
{
|
{
|
||||||
ROFSTLookup myLookup = new ROFSTLookup(rofst.ROFstID, DocVersionInfo.Get(docver.VersionID));
|
ROFSTLookup myLookup = new ROFSTLookup(rofst.ROFstID, DocVersionInfo.Get(docver.VersionID));
|
||||||
MyChangedFigureROIDs = UpdateROFigures(rdi, myProgressBarRefresh, rofst, RODb.GetJustRoDb(rdi.RODbID), myLookup, docver);
|
_ = UpdateROFigures(rdi, myProgressBarRefresh, rofst, RODb.GetJustRoDb(rdi.RODbID), myLookup, docver);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MyChangedFigureROIDs = GetChangedFigureROIDs(origROFst, ROFstInfo.GetJustROFst(rofst.ROFstID), DocVersionInfo.Get(docver.VersionID), myProgressBarRefresh);
|
_ = GetChangedFigureROIDs(origROFst, ROFstInfo.GetJustROFst(rofst.ROFstID), DocVersionInfo.Get(docver.VersionID), myProgressBarRefresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
docver.DocVersionAssociations[0].MyROFst = rofst;
|
docver.DocVersionAssociations[0].MyROFst = rofst;
|
||||||
@@ -404,16 +379,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ROFst GetJustROFst()
|
public ROFst GetJustROFst() => ROFst.GetJustROFst(ROFstID);
|
||||||
{
|
|
||||||
return ROFst.GetJustROFst(ROFstID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<string> OnROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
public List<string> OnROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) => ROTableUpdate != null ? ROTableUpdate(sender, args) : null;
|
||||||
{
|
|
||||||
if (ROTableUpdate != null) return ROTableUpdate(sender, args);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ROFstInfo GetJustROFst(int rOFstID)
|
public static ROFstInfo GetJustROFst(int rOFstID)
|
||||||
{
|
{
|
||||||
@@ -433,11 +401,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tmp = null;
|
tmp = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp != null)
|
|
||||||
{
|
|
||||||
tmp.ClearROLookupBytes();
|
|
||||||
}
|
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -481,8 +444,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
string cfg = docver.DocVersionAssociations[0].Config;
|
string cfg = docver.DocVersionAssociations[0].Config;
|
||||||
|
|
||||||
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg)
|
||||||
ac.ROUpdate_LastCompleted = value;
|
{
|
||||||
|
ROUpdate_LastCompleted = value
|
||||||
|
};
|
||||||
docver.DocVersionAssociations[0].Config = ac.ToString();
|
docver.DocVersionAssociations[0].Config = ac.ToString();
|
||||||
docver.Save();
|
docver.Save();
|
||||||
}
|
}
|
||||||
@@ -494,8 +459,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (docver.DocVersionAssociations[0]?.MyROFst != null && value != -1)
|
if (docver.DocVersionAssociations[0]?.MyROFst != null && value != -1)
|
||||||
{
|
{
|
||||||
string cfg = docver.DocVersionAssociations[0].Config;
|
string cfg = docver.DocVersionAssociations[0].Config;
|
||||||
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg)
|
||||||
ac.ROUpdate_PrevROFSTID = value.ToString();
|
{
|
||||||
|
ROUpdate_PrevROFSTID = value.ToString()
|
||||||
|
};
|
||||||
docver.DocVersionAssociations[0].Config = ac.ToString();
|
docver.DocVersionAssociations[0].Config = ac.ToString();
|
||||||
docver.Save();
|
docver.Save();
|
||||||
}
|
}
|
||||||
@@ -506,8 +473,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
string cfg = docver.DocVersionAssociations[0].Config;
|
string cfg = docver.DocVersionAssociations[0].Config;
|
||||||
|
|
||||||
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg)
|
||||||
ac.ROUpdate_LoadingFigures = value;
|
{
|
||||||
|
ROUpdate_LoadingFigures = value
|
||||||
|
};
|
||||||
docver.DocVersionAssociations[0].Config = ac.ToString();
|
docver.DocVersionAssociations[0].Config = ac.ToString();
|
||||||
docver.Save();
|
docver.Save();
|
||||||
}
|
}
|
||||||
@@ -539,7 +508,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
// Add references for existing RO Images to the Figure table (Figure table relates ro.fst with its images)
|
// Add references for existing RO Images to the Figure table (Figure table relates ro.fst with its images)
|
||||||
if (myUnChangedROImages.Count > 0)
|
if (myUnChangedROImages.Count > 0)
|
||||||
|
#pragma warning disable CS0642 // Possible mistaken empty statement - valid keeps scope of add
|
||||||
using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ;
|
using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ;
|
||||||
|
#pragma warning restore CS0642 // Possible mistaken empty statement
|
||||||
}
|
}
|
||||||
|
|
||||||
SetAssociationROFiguresLoading(docVer, string.Empty); // B2017-125 loading RO Figures is completed
|
SetAssociationROFiguresLoading(docVer, string.Empty); // B2017-125 loading RO Figures is completed
|
||||||
@@ -662,10 +633,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return myRoImagesList;
|
return myRoImagesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ROImageKey(string fileName, DateTime dts)
|
private static string ROImageKey(string fileName, DateTime dts) => string.Format("{0}:{1}", fileName, dts);
|
||||||
{
|
|
||||||
return string.Format("{0}:{1}", fileName, dts);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string buildImageIDString(List<int> myROImageIDs)
|
private static string buildImageIDString(List<int> myROImageIDs)
|
||||||
{
|
{
|
||||||
@@ -687,61 +655,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DateTime ShowDuration(DateTime dtLast, string message)
|
|
||||||
{
|
|
||||||
DateTime dtNext = DateTime.Now;
|
|
||||||
Console.WriteLine("{0,10:#####0.00},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - dtLast.Ticks).TotalSeconds, message);
|
|
||||||
return dtNext;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<string> BuildActiveROIDsForRoUsages12(string RoidList, string versions)
|
|
||||||
{
|
|
||||||
List<string> activeRoids = new List<string>();
|
|
||||||
|
|
||||||
using (RoUsageInfoList activeList = RoUsageInfoList.GetROUSagesByROIDsAndVersions(RoidList, versions))
|
|
||||||
{
|
|
||||||
foreach (RoUsageInfo roui in activeList)
|
|
||||||
{
|
|
||||||
string roid = roui.ROID.ToUpper().Substring(0, 12);
|
|
||||||
if (!activeRoids.Contains(roid))
|
|
||||||
activeRoids.Add(roid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return activeRoids;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<string> BuildActiveROIDsForDRoUsages12(string RoidList, string versions)
|
|
||||||
{
|
|
||||||
List<string> activeRoids = new List<string>();
|
|
||||||
|
|
||||||
using (DROUsageInfoList activeList = DROUsageInfoList.GetDROUsagesByROIDsAndVersions(RoidList, versions))
|
|
||||||
{
|
|
||||||
foreach (DROUsageInfo roui in activeList)
|
|
||||||
{
|
|
||||||
string roid = roui.ROID.Substring(0, 12);
|
|
||||||
if (!activeRoids.Contains(roid))
|
|
||||||
activeRoids.Add(roid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return activeRoids;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetRoidList(int dbid, List<string> chgList)
|
|
||||||
{
|
|
||||||
StringBuilder sb = new StringBuilder(string.Format("{0}", dbid));
|
|
||||||
string sep = ":";
|
|
||||||
|
|
||||||
foreach (string roid in chgList)
|
|
||||||
{
|
|
||||||
sb.Append(sep + roid);
|
|
||||||
sep = ",";
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
// B2022-026 RO Memory Reduction code - all rochild types passed in are of type image (graphics)
|
// B2022-026 RO Memory Reduction code - all rochild types passed in are of type image (graphics)
|
||||||
private void MigrateRoFstGraphics(RODbInfo rdi, ROFSTLookup.rochild[] rochild, RODb rodb, ROFst rofst, Dictionary<string, int> myExistingROImages, List<int> myUnChangedROImages, List<string> myAddedROImages, List<string> MyChangedFigureROIDs, ROFstInfoProgressBarRefresh myProgressBarRefresh, int cnt, ref int curCnt)
|
private void MigrateRoFstGraphics(RODbInfo rdi, ROFSTLookup.rochild[] rochild, RODb rodb, ROFst rofst, Dictionary<string, int> myExistingROImages, List<int> myUnChangedROImages, List<string> myAddedROImages, List<string> MyChangedFigureROIDs, ROFstInfoProgressBarRefresh myProgressBarRefresh, int cnt, ref int curCnt)
|
||||||
{
|
{
|
||||||
@@ -771,9 +684,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
string imgfile = rdi.FolderPath + @"\" + fname;
|
string imgfile = rdi.FolderPath + @"\" + fname;
|
||||||
|
|
||||||
ROImage roImg = null;
|
|
||||||
|
|
||||||
if (File.Exists(imgfile))
|
if (File.Exists(imgfile))
|
||||||
{
|
{
|
||||||
FileInfo fi = new FileInfo(imgfile);
|
FileInfo fi = new FileInfo(imgfile);
|
||||||
@@ -812,9 +722,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROImageConfig rc = new ROImageConfig();
|
ROImageConfig rc = new ROImageConfig
|
||||||
rc.Image_Size = ab.Length.ToString();
|
{
|
||||||
|
Image_Size = ab.Length.ToString()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ROImage roImg;
|
||||||
using (roImg = ROImage.MakeROImage(rodb, imgname, ROImageInfo.Compress(ab), rc.ToString(), fi.LastWriteTimeUtc, "Migration"))
|
using (roImg = ROImage.MakeROImage(rodb, imgname, ROImageInfo.Compress(ab), rc.ToString(), fi.LastWriteTimeUtc, "Migration"))
|
||||||
{
|
{
|
||||||
using (Figure figure = Figure.GetByROFstID_ImageID(this.ROFstID, roImg.ImageID))
|
using (Figure figure = Figure.GetByROFstID_ImageID(this.ROFstID, roImg.ImageID))
|
||||||
@@ -940,22 +854,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public class ROFstInfoROTableUpdateEventArgs
|
public class ROFstInfoROTableUpdateEventArgs
|
||||||
{
|
{
|
||||||
private string _ROText;
|
public string ROText { get; set; }
|
||||||
public string ROText
|
public string OldGridXml { get; set; }
|
||||||
{
|
|
||||||
get { return _ROText; }
|
|
||||||
set { _ROText = value; }
|
|
||||||
}
|
|
||||||
private string _OldGridXml;
|
|
||||||
public string OldGridXml
|
|
||||||
{
|
|
||||||
get { return _OldGridXml; }
|
|
||||||
set { _OldGridXml = value; }
|
|
||||||
}
|
|
||||||
public ROFstInfoROTableUpdateEventArgs(string rotext, string oldgridxml)
|
public ROFstInfoROTableUpdateEventArgs(string rotext, string oldgridxml)
|
||||||
{
|
{
|
||||||
_ROText = rotext;
|
ROText = rotext;
|
||||||
_OldGridXml = oldgridxml;
|
OldGridXml = oldgridxml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1045,7 +949,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//GC.Collect();
|
|
||||||
return isDifferent;
|
return isDifferent;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
@@ -14,63 +13,30 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public delegate void ROImageInfoCompressionEvent(object sender, ROImageInfoCompressionEventArgs args);
|
public delegate void ROImageInfoCompressionEvent(object sender, ROImageInfoCompressionEventArgs args);
|
||||||
public class ROImageInfoCompressionEventArgs
|
public class ROImageInfoCompressionEventArgs
|
||||||
{
|
{
|
||||||
private int _Total;
|
public int Total { get; set; }
|
||||||
public int Total
|
public int Current { get; set; }
|
||||||
{
|
public string FileName { get; set; }
|
||||||
get { return _Total; }
|
public ROImageCompressionEventType Type { get; set; }
|
||||||
set { _Total = value; }
|
public ROImageInfoCompressionEventArgs(ROImageCompressionEventType type) => Type = type;
|
||||||
}
|
|
||||||
private int _Current;
|
|
||||||
public int Current
|
|
||||||
{
|
|
||||||
get { return _Current; }
|
|
||||||
set { _Current = value; }
|
|
||||||
}
|
|
||||||
private string _FileName;
|
|
||||||
public string FileName
|
|
||||||
{
|
|
||||||
get { return _FileName; }
|
|
||||||
set { _FileName = value; }
|
|
||||||
}
|
|
||||||
private ROImageCompressionEventType _Type;
|
|
||||||
public ROImageCompressionEventType Type
|
|
||||||
{
|
|
||||||
get { return _Type; }
|
|
||||||
set { _Type = value; }
|
|
||||||
}
|
|
||||||
public ROImageInfoCompressionEventArgs(ROImageCompressionEventType type)
|
|
||||||
{
|
|
||||||
_Type = type;
|
|
||||||
}
|
|
||||||
public ROImageInfoCompressionEventArgs(int current, string fileName)
|
public ROImageInfoCompressionEventArgs(int current, string fileName)
|
||||||
{
|
{
|
||||||
_Current = current;
|
Current = current;
|
||||||
_FileName = fileName;
|
FileName = fileName;
|
||||||
_Type = ROImageCompressionEventType.Update;
|
Type = ROImageCompressionEventType.Update;
|
||||||
}
|
}
|
||||||
public ROImageInfoCompressionEventArgs(int total)
|
public ROImageInfoCompressionEventArgs(int total)
|
||||||
{
|
{
|
||||||
_Type = ROImageCompressionEventType.Initialize;
|
Type = ROImageCompressionEventType.Initialize;
|
||||||
_Total = total;
|
Total = total;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public enum ROImageCompressionEventType:int {Initialize, Update, Complete};
|
public enum ROImageCompressionEventType:int {Initialize, Update, Complete};
|
||||||
public partial class ROImageInfo
|
public partial class ROImageInfo
|
||||||
{
|
{
|
||||||
public static event ROImageInfoCompressionEvent CompressAllExistingImages;
|
public static event ROImageInfoCompressionEvent CompressAllExistingImages;
|
||||||
public static void OnCompressAllExistingImages(object sender, ROImageInfoCompressionEventArgs args)
|
public static void OnCompressAllExistingImages(object sender, ROImageInfoCompressionEventArgs args) => CompressAllExistingImages?.Invoke(sender, args);
|
||||||
{
|
|
||||||
if (CompressAllExistingImages != null) CompressAllExistingImages(sender, args);
|
|
||||||
}
|
|
||||||
// put in for debug
|
|
||||||
//public static int CacheCountPrimaryKey
|
|
||||||
//{ get { return _CacheByPrimaryKey.Count; } }
|
|
||||||
//public static int CacheCountList
|
|
||||||
//{ get { return _CacheList.Count; } }
|
|
||||||
public static ROImageInfo GetByROFstID_FileName(int rOFstID, string fileName)
|
public static ROImageInfo GetByROFstID_FileName(int rOFstID, string fileName)
|
||||||
{
|
{
|
||||||
//if (!CanGetObject())
|
|
||||||
// throw new System.Security.SecurityException("User not authorized to view a ROImage");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (fileName.EndsWith("PCX")) fileName = fileName.Replace(".PCX", ".TIF");
|
if (fileName.EndsWith("PCX")) fileName = fileName.Replace(".PCX", ".TIF");
|
||||||
@@ -95,7 +61,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public static byte[] Compress(byte[] blob)
|
public static byte[] Compress(byte[] blob)
|
||||||
{
|
{
|
||||||
int size = blob.Length;
|
|
||||||
using (MemoryStream Source = new MemoryStream(blob))
|
using (MemoryStream Source = new MemoryStream(blob))
|
||||||
{
|
{
|
||||||
using (MemoryStream Destination = new MemoryStream())
|
using (MemoryStream Destination = new MemoryStream())
|
||||||
@@ -171,8 +136,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
string nm = ro.FileName;
|
string nm = ro.FileName;
|
||||||
OnCompressAllExistingImages(null, new ROImageInfoCompressionEventArgs(pcount++, nm));
|
OnCompressAllExistingImages(null, new ROImageInfoCompressionEventArgs(pcount++, nm));
|
||||||
ROImageConfig rc = new ROImageConfig();
|
ROImageConfig rc = new ROImageConfig
|
||||||
rc.Image_Size = ro.Content.Length.ToString();
|
{
|
||||||
|
Image_Size = ro.Content.Length.ToString()
|
||||||
|
};
|
||||||
ro.Content = ROImageInfo.Compress(ro.Content);
|
ro.Content = ROImageInfo.Compress(ro.Content);
|
||||||
ro.Config = rc.ToString();
|
ro.Config = rc.ToString();
|
||||||
ro.Save();
|
ro.Save();
|
||||||
@@ -226,13 +193,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
private class ROFstID_FileNameCriteria
|
private class ROFstID_FileNameCriteria
|
||||||
{
|
{
|
||||||
private int _ROFstID;
|
private readonly int _ROFstID;
|
||||||
|
public int ROFstID => _ROFstID;
|
||||||
public int ROFstID
|
private readonly string _FileName;
|
||||||
{ get { return _ROFstID; } }
|
public string FileName => _FileName;
|
||||||
private string _FileName;
|
|
||||||
public string FileName
|
|
||||||
{ get { return _FileName; } }
|
|
||||||
public ROFstID_FileNameCriteria(int rOFstID, string fileName)
|
public ROFstID_FileNameCriteria(int rOFstID, string fileName)
|
||||||
{
|
{
|
||||||
_ROFstID = rOFstID;
|
_ROFstID = rOFstID;
|
||||||
@@ -245,7 +209,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Fields
|
#region Fields
|
||||||
private bool _IsDisposed;
|
private bool _IsDisposed;
|
||||||
//private static string _TemporaryFolder = null;
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Properties
|
#region Properties
|
||||||
private ROImageInfo _MyROImage = null;
|
private ROImageInfo _MyROImage = null;
|
||||||
@@ -260,16 +223,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private FileInfo _MyFile = null;
|
private FileInfo _MyFile = null;
|
||||||
public FileInfo MyFile
|
public FileInfo MyFile => _MyFile;
|
||||||
{
|
|
||||||
get { return _MyFile; }
|
public string Extension { get; set; } = "TIF";
|
||||||
}
|
|
||||||
private string _Extension = "TIF";
|
|
||||||
public string Extension
|
|
||||||
{
|
|
||||||
get { return _Extension; }
|
|
||||||
set { _Extension = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
private void TryDelete()
|
private void TryDelete()
|
||||||
@@ -358,10 +314,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructors
|
#region Constructors
|
||||||
public ROImageFile(ROImageInfo myROImage)
|
public ROImageFile(ROImageInfo myROImage) => MyROImage = myROImage;
|
||||||
{
|
|
||||||
MyROImage = myROImage;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Destructor
|
#region Destructor
|
||||||
~ROImageFile()
|
~ROImageFile()
|
||||||
@@ -374,6 +327,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping disposing to match different signature")]
|
||||||
protected void Dispose(bool disposing)
|
protected void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (!_IsDisposed)
|
if (!_IsDisposed)
|
||||||
@@ -402,16 +356,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
private class RODbIDNoDataCriteria
|
private class RODbIDNoDataCriteria
|
||||||
{
|
{
|
||||||
public RODbIDNoDataCriteria(int rODbID)
|
public RODbIDNoDataCriteria(int rODbID) => RODbID = rODbID;
|
||||||
{
|
|
||||||
_RODbID = rODbID;
|
public int RODbID { get; set; }
|
||||||
}
|
|
||||||
private int _RODbID;
|
|
||||||
public int RODbID
|
|
||||||
{
|
|
||||||
get { return _RODbID; }
|
|
||||||
set { _RODbID = value; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(RODbIDNoDataCriteria criteria)
|
private void DataPortal_Fetch(RODbIDNoDataCriteria criteria)
|
||||||
{
|
{
|
||||||
@@ -448,7 +395,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
ROImageInfoList tmp = DataPortal.Fetch<ROImageInfoList>(new RODbIDFilenameCriteria(rODbID,filename));
|
ROImageInfoList tmp = DataPortal.Fetch<ROImageInfoList>(new RODbIDFilenameCriteria(rODbID,filename));
|
||||||
//ROImageInfo.AddList(tmp);
|
|
||||||
tmp.AddEvents();
|
tmp.AddEvents();
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
@@ -461,21 +407,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public RODbIDFilenameCriteria(int rODbID,string filename)
|
public RODbIDFilenameCriteria(int rODbID,string filename)
|
||||||
{
|
{
|
||||||
_RODbID = rODbID;
|
RODbID = rODbID;
|
||||||
_Filename = filename;
|
Filename = filename;
|
||||||
}
|
|
||||||
private int _RODbID;
|
|
||||||
public int RODbID
|
|
||||||
{
|
|
||||||
get { return _RODbID; }
|
|
||||||
set { _RODbID = value; }
|
|
||||||
}
|
|
||||||
private string _Filename;
|
|
||||||
public string Filename
|
|
||||||
{
|
|
||||||
get { return _Filename; }
|
|
||||||
set { _Filename = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int RODbID { get; set; }
|
||||||
|
public string Filename { get; set; }
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(RODbIDFilenameCriteria criteria)
|
private void DataPortal_Fetch(RODbIDFilenameCriteria criteria)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Csla;
|
using Csla;
|
||||||
@@ -118,10 +116,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
private class GetROUsagesByROIDsCriteria
|
private class GetROUsagesByROIDsCriteria
|
||||||
{
|
{
|
||||||
public GetROUsagesByROIDsCriteria(string roids)
|
public GetROUsagesByROIDsCriteria(string roids) => _ROIDS = roids;
|
||||||
{
|
|
||||||
_ROIDS = roids;
|
|
||||||
}
|
|
||||||
private string _ROIDS;
|
private string _ROIDS;
|
||||||
public string ROIDS
|
public string ROIDS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using Csla.Validation;
|
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
@@ -143,34 +142,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public delegate void ItemInfoListCCEvent(object sender, ItemInfoListCCEventArgs args);
|
public delegate void ItemInfoListCCEvent(object sender, ItemInfoListCCEventArgs args);
|
||||||
public class ItemInfoListCCEventArgs : EventArgs
|
public class ItemInfoListCCEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
private ProcedureInfo _MyProcedure;
|
public ProcedureInfo MyProcedure { get; set; }
|
||||||
|
|
||||||
public ProcedureInfo MyProcedure
|
public int MyCount { get; set; }
|
||||||
{
|
|
||||||
get { return _MyProcedure; }
|
|
||||||
set { _MyProcedure = value; }
|
|
||||||
}
|
|
||||||
private int _MyCount;
|
|
||||||
|
|
||||||
public int MyCount
|
|
||||||
{
|
|
||||||
get { return _MyCount; }
|
|
||||||
set { _MyCount = value; }
|
|
||||||
}
|
|
||||||
public ItemInfoListCCEventArgs(ProcedureInfo myProcedure, int myCount)
|
public ItemInfoListCCEventArgs(ProcedureInfo myProcedure, int myCount)
|
||||||
{
|
{
|
||||||
_MyProcedure = myProcedure;
|
MyProcedure = myProcedure;
|
||||||
_MyCount = myCount;
|
MyCount = myCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public partial class ItemInfoList
|
public partial class ItemInfoList
|
||||||
{
|
{
|
||||||
public static event ItemInfoListCCEvent ConsistencyCheckUpdated;
|
public static event ItemInfoListCCEvent ConsistencyCheckUpdated;
|
||||||
private static void OnConsistencyCheckUpdated(object sender, ItemInfoListCCEventArgs args)
|
private static void OnConsistencyCheckUpdated(object sender, ItemInfoListCCEventArgs args) => ConsistencyCheckUpdated?.Invoke(sender, args);
|
||||||
{
|
|
||||||
if (ConsistencyCheckUpdated != null)
|
|
||||||
ConsistencyCheckUpdated(sender, args);
|
|
||||||
}
|
|
||||||
public static ItemInfoList GetMoreProcedures(List<ProcedureInfo> procs)
|
public static ItemInfoList GetMoreProcedures(List<ProcedureInfo> procs)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder("<Items>");
|
StringBuilder sb = new StringBuilder("<Items>");
|
||||||
@@ -290,10 +274,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _DocVersionID; }
|
get { return _DocVersionID; }
|
||||||
set { _DocVersionID = value; }
|
set { _DocVersionID = value; }
|
||||||
}
|
}
|
||||||
public ItemListAllInConsistenciesCriteria(int docVersionID)
|
public ItemListAllInConsistenciesCriteria(int docVersionID) => _DocVersionID = docVersionID;
|
||||||
{
|
|
||||||
_DocVersionID = docVersionID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(ItemListAllInConsistenciesCriteria criteria)
|
private void DataPortal_Fetch(ItemListAllInConsistenciesCriteria criteria)
|
||||||
{
|
{
|
||||||
@@ -359,16 +340,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public static Revision GetByItemIDAndRevisionNumber(int itemID, string revisionNumber)
|
public static Revision GetByItemIDAndRevisionNumber(int itemID, string revisionNumber)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to view a Revision");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Revision tmp = GetCachedByPrimaryKey(revisionID);
|
|
||||||
//if (tmp == null)
|
|
||||||
//{
|
|
||||||
Revision tmp = DataPortal.Fetch<Revision>(new ItemRevisionNumberCriteria(itemID, revisionNumber));
|
Revision tmp = DataPortal.Fetch<Revision>(new ItemRevisionNumberCriteria(itemID, revisionNumber));
|
||||||
// AddToCache(tmp);
|
|
||||||
//}
|
|
||||||
if (tmp.ErrorMessage == "No Record Found")
|
if (tmp.ErrorMessage == "No Record Found")
|
||||||
{
|
{
|
||||||
tmp.Dispose(); // Clean-up Revision
|
tmp.Dispose(); // Clean-up Revision
|
||||||
@@ -384,12 +358,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class ItemRevisionNumberCriteria
|
protected class ItemRevisionNumberCriteria
|
||||||
{
|
{
|
||||||
private int _ItemID;
|
private readonly int _ItemID;
|
||||||
public int ItemID
|
public int ItemID => _ItemID;
|
||||||
{ get { return _ItemID; } }
|
private readonly string _RevisionNumber;
|
||||||
private string _RevisionNumber;
|
public string RevisionNumber => _RevisionNumber;
|
||||||
public string RevisionNumber
|
|
||||||
{ get { return _RevisionNumber; } }
|
|
||||||
public ItemRevisionNumberCriteria(int itemID, string revisionNumber)
|
public ItemRevisionNumberCriteria(int itemID, string revisionNumber)
|
||||||
{
|
{
|
||||||
_ItemID = itemID;
|
_ItemID = itemID;
|
||||||
@@ -442,16 +414,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//jcb 20120625
|
//jcb 20120625
|
||||||
public static Revision GetByItemIDAndRevisionNumberAndUnitID(int itemID, string revisionNumber, int unitID)
|
public static Revision GetByItemIDAndRevisionNumberAndUnitID(int itemID, string revisionNumber, int unitID)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to view a Revision");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Revision tmp = GetCachedByPrimaryKey(revisionID);
|
|
||||||
//if (tmp == null)
|
|
||||||
//{
|
|
||||||
Revision tmp = DataPortal.Fetch<Revision>(new UnitItemRevisionNumberCriteria(itemID, revisionNumber, unitID));
|
Revision tmp = DataPortal.Fetch<Revision>(new UnitItemRevisionNumberCriteria(itemID, revisionNumber, unitID));
|
||||||
// AddToCache(tmp);
|
|
||||||
//}
|
|
||||||
if (tmp.ErrorMessage == "No Record Found")
|
if (tmp.ErrorMessage == "No Record Found")
|
||||||
{
|
{
|
||||||
tmp.Dispose(); // Clean-up Revision
|
tmp.Dispose(); // Clean-up Revision
|
||||||
@@ -467,15 +432,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class UnitItemRevisionNumberCriteria
|
protected class UnitItemRevisionNumberCriteria
|
||||||
{
|
{
|
||||||
private int _ItemID;
|
private readonly int _ItemID;
|
||||||
public int ItemID
|
public int ItemID => _ItemID;
|
||||||
{ get { return _ItemID; } }
|
private readonly string _RevisionNumber;
|
||||||
private string _RevisionNumber;
|
public string RevisionNumber => _RevisionNumber;
|
||||||
public string RevisionNumber
|
private readonly int _UnitID;
|
||||||
{ get { return _RevisionNumber; } }
|
public int UnitID => _UnitID;
|
||||||
private int _UnitID;
|
|
||||||
public int UnitID
|
|
||||||
{ get { return _UnitID; } }
|
|
||||||
public UnitItemRevisionNumberCriteria(int itemID, string revisionNumber, int unitID)
|
public UnitItemRevisionNumberCriteria(int itemID, string revisionNumber, int unitID)
|
||||||
{
|
{
|
||||||
_ItemID = itemID;
|
_ItemID = itemID;
|
||||||
@@ -535,12 +497,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//if (_RevisionInfoList != null)
|
|
||||||
// return _RevisionInfoList;
|
|
||||||
RevisionInfoList tmp = DataPortal.Fetch<RevisionInfoList>(new ItemCriteria(itemID));
|
RevisionInfoList tmp = DataPortal.Fetch<RevisionInfoList>(new ItemCriteria(itemID));
|
||||||
RevisionInfo.AddList(tmp);
|
RevisionInfo.AddList(tmp);
|
||||||
tmp.AddEvents();
|
tmp.AddEvents();
|
||||||
//_RevisionInfoList = tmp;
|
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -551,13 +510,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class ItemCriteria
|
protected class ItemCriteria
|
||||||
{
|
{
|
||||||
private int _ItemID;
|
private readonly int _ItemID;
|
||||||
public int ItemID
|
public int ItemID => _ItemID;
|
||||||
{ get { return _ItemID; } }
|
public ItemCriteria(int itemID) => _ItemID = itemID;
|
||||||
public ItemCriteria(int itemID)
|
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(ItemCriteria criteria)
|
private void DataPortal_Fetch(ItemCriteria criteria)
|
||||||
{
|
{
|
||||||
@@ -594,12 +549,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//if (_RevisionInfoList != null)
|
|
||||||
// return _RevisionInfoList;
|
|
||||||
RevisionInfoList tmp = DataPortal.Fetch<RevisionInfoList>(new ItemUnitCriteria(itemID, unitID));
|
RevisionInfoList tmp = DataPortal.Fetch<RevisionInfoList>(new ItemUnitCriteria(itemID, unitID));
|
||||||
RevisionInfo.AddList(tmp);
|
RevisionInfo.AddList(tmp);
|
||||||
tmp.AddEvents();
|
tmp.AddEvents();
|
||||||
//_RevisionInfoList = tmp;
|
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -610,12 +562,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class ItemUnitCriteria
|
protected class ItemUnitCriteria
|
||||||
{
|
{
|
||||||
private int _ItemID;
|
private readonly int _ItemID;
|
||||||
public int ItemID
|
public int ItemID => _ItemID;
|
||||||
{ get { return _ItemID; } }
|
private readonly int _UnitID;
|
||||||
private int _UnitID;
|
public int UnitID => _UnitID;
|
||||||
public int UnitID
|
|
||||||
{ get { return _UnitID; } }
|
|
||||||
public ItemUnitCriteria(int itemID, int unitID)
|
public ItemUnitCriteria(int itemID, int unitID)
|
||||||
{
|
{
|
||||||
_ItemID = itemID;
|
_ItemID = itemID;
|
||||||
@@ -671,13 +621,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class ItemCriteria
|
protected class ItemCriteria
|
||||||
{
|
{
|
||||||
private int _ItemID;
|
private readonly int _ItemID;
|
||||||
public int ItemID
|
public int ItemID => _ItemID;
|
||||||
{ get { return _ItemID; } }
|
public ItemCriteria(int itemID) => _ItemID = itemID;
|
||||||
public ItemCriteria(int itemID)
|
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
|
||||||
}
|
|
||||||
private int _UnitID = 0;
|
private int _UnitID = 0;
|
||||||
public int UnitID
|
public int UnitID
|
||||||
{
|
{
|
||||||
@@ -697,10 +643,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
protected class CurrentItemUnitCriteria : ItemCriteria
|
protected class CurrentItemUnitCriteria : ItemCriteria
|
||||||
{
|
{
|
||||||
public CurrentItemUnitCriteria(int itemID, int unitID)
|
public CurrentItemUnitCriteria(int itemID, int unitID)
|
||||||
: base(itemID)
|
: base(itemID) => UnitID = unitID;
|
||||||
{
|
|
||||||
UnitID = unitID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PreviousItemCriteria : ItemCriteria
|
protected class PreviousItemCriteria : ItemCriteria
|
||||||
@@ -714,12 +657,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//RevisionInfo tmp = GetCachedByPrimaryKey(revisionID);
|
|
||||||
//if (tmp == null)
|
|
||||||
//{
|
|
||||||
// tmp = DataPortal.Fetch<RevisionInfo>(new PKCriteria(revisionID));
|
|
||||||
// AddToCache(tmp);
|
|
||||||
//}
|
|
||||||
RevisionInfo tmp = DataPortal.Fetch<RevisionInfo>(new CurrentItemCriteria(itemID));
|
RevisionInfo tmp = DataPortal.Fetch<RevisionInfo>(new CurrentItemCriteria(itemID));
|
||||||
if (tmp.ErrorMessage == "No Record Found")
|
if (tmp.ErrorMessage == "No Record Found")
|
||||||
{
|
{
|
||||||
@@ -754,12 +691,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//RevisionInfo tmp = GetCachedByPrimaryKey(revisionID);
|
|
||||||
//if (tmp == null)
|
|
||||||
//{
|
|
||||||
// tmp = DataPortal.Fetch<RevisionInfo>(new PKCriteria(revisionID));
|
|
||||||
// AddToCache(tmp);
|
|
||||||
//}
|
|
||||||
RevisionInfo tmp = DataPortal.Fetch<RevisionInfo>(new PreviousItemCriteria(itemID));
|
RevisionInfo tmp = DataPortal.Fetch<RevisionInfo>(new PreviousItemCriteria(itemID));
|
||||||
if (tmp.ErrorMessage == "No Record Found")
|
if (tmp.ErrorMessage == "No Record Found")
|
||||||
{
|
{
|
||||||
@@ -906,8 +837,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public static string BuildRevisionChecks(ProcedureInfo proc)
|
public static string BuildRevisionChecks(ProcedureInfo proc)
|
||||||
{
|
{
|
||||||
ConsistencyChecks cc = new ConsistencyChecks();
|
ConsistencyChecks cc = new ConsistencyChecks
|
||||||
cc.ItemID = proc.ItemID;
|
{
|
||||||
|
ItemID = proc.ItemID
|
||||||
|
};
|
||||||
BuildROChecks(cc, proc);
|
BuildROChecks(cc, proc);
|
||||||
BuildTransitionFromChecks(cc, proc);
|
BuildTransitionFromChecks(cc, proc);
|
||||||
BuildTransitionToChecks(cc, proc);
|
BuildTransitionToChecks(cc, proc);
|
||||||
@@ -933,13 +866,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
//create checkro record for each roid
|
//create checkro record for each roid
|
||||||
//_MyTimer.ActiveProcess = "Get DocVersionInfo";
|
//_MyTimer.ActiveProcess = "Get DocVersionInfo";
|
||||||
// DocVersionInfo dbi = proc.ActiveParent as DocVersionInfo;
|
|
||||||
DocVersionInfo dvi = proc.MyDocVersion;
|
DocVersionInfo dvi = proc.MyDocVersion;
|
||||||
//_MyTimer.ActiveProcess = "Get MyROFst";
|
//_MyTimer.ActiveProcess = "Get MyROFst";
|
||||||
if (dvi.DocVersionAssociations == null || dvi.DocVersionAssociations.Count == 0) return; // B2020-124: don't crash if docversion doesn't have rofst
|
if (dvi.DocVersionAssociations == null || dvi.DocVersionAssociations.Count == 0) return; // B2020-124: don't crash if docversion doesn't have rofst
|
||||||
ROFstInfo rofst = ROFstInfo.GetJustROFst(dvi.DocVersionAssociations[0].ROFstID);
|
ROFstInfo rofst = ROFstInfo.GetJustROFst(dvi.DocVersionAssociations[0].ROFstID);
|
||||||
//_MyTimer.ActiveProcess = "Get ROFst Lookup";
|
//_MyTimer.ActiveProcess = "Get ROFst Lookup";
|
||||||
//rofst.docVer = dvi;
|
|
||||||
ROFSTLookup lookup = rofst.GetROFSTLookup(dvi);
|
ROFSTLookup lookup = rofst.GetROFSTLookup(dvi);
|
||||||
//_MyTimer.ActiveProcess = "Populating RevisionChecksXML table";
|
//_MyTimer.ActiveProcess = "Populating RevisionChecksXML table";
|
||||||
cc.ROConsistency.ROFstDate = rofst.DTS;
|
cc.ROConsistency.ROFstDate = rofst.DTS;
|
||||||
@@ -957,10 +888,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (TransitionInfoList myList = TransitionInfoList.GetAllForProcedure(proc, true))
|
using (TransitionInfoList myList = TransitionInfoList.GetAllForProcedure(proc, true))
|
||||||
foreach (TransitionInfo myTI in myList)
|
foreach (TransitionInfo myTI in myList)
|
||||||
{
|
{
|
||||||
//\v <START]\v0 EMG\u160?ES\u8209?02, REACTOR TRIP RESPONSE, Step 14\v #Link:Transition:0 1 102[END>\v0
|
|
||||||
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", myTI.TranType, myTI.TransitionID);
|
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", myTI.TranType, myTI.TransitionID);
|
||||||
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", myTI.TranType, myTI.TransitionID);
|
|
||||||
//string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1} [0-9]*\[END>", tran.TranType, tran.TransitionID);
|
|
||||||
Match m = Regex.Match(myTI.ContentText, lookFor);
|
Match m = Regex.Match(myTI.ContentText, lookFor);
|
||||||
if (m != null && m.Groups.Count > 1)
|
if (m != null && m.Groups.Count > 1)
|
||||||
{
|
{
|
||||||
@@ -973,11 +901,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
string gg = myTI.ContentText.Substring(myIndex, myLength);
|
string gg = myTI.ContentText.Substring(myIndex, myLength);
|
||||||
cc.AddTransitionFromCheck(myTI.TransitionID, gg);
|
cc.AddTransitionFromCheck(myTI.TransitionID, gg);
|
||||||
// System.Text.RegularExpressions.Group g = m.Groups[3];
|
|
||||||
// cc.AddTransitionFromCheck(myTI.TransitionID, g.ToString());
|
|
||||||
}
|
}
|
||||||
//_MyTimer.ActiveProcess = "get from path";
|
//_MyTimer.ActiveProcess = "get from path";
|
||||||
//string myPath = myTI.MyItemToID.ShortPath;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static void BuildTransitionToChecks(ConsistencyChecks cc, ProcedureInfo proc)
|
private static void BuildTransitionToChecks(ConsistencyChecks cc, ProcedureInfo proc)
|
||||||
@@ -986,8 +911,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
foreach (TransitionInfo myTI in myList)
|
foreach (TransitionInfo myTI in myList)
|
||||||
{
|
{
|
||||||
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", myTI.TranType, myTI.TransitionID);
|
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", myTI.TranType, myTI.TransitionID);
|
||||||
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", myTI.TranType, myTI.TransitionID);
|
|
||||||
//string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1} [0-9]*\[END>", tran.TranType, tran.TransitionID);
|
|
||||||
Match m = Regex.Match(myTI.ContentText, lookFor);
|
Match m = Regex.Match(myTI.ContentText, lookFor);
|
||||||
if (m != null && m.Groups.Count > 1)
|
if (m != null && m.Groups.Count > 1)
|
||||||
{
|
{
|
||||||
@@ -1001,8 +924,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string gg = myTI.ContentText.Substring(myIndex, myLength);
|
string gg = myTI.ContentText.Substring(myIndex, myLength);
|
||||||
gg = gg.Replace("{", @"\{").Replace("}", @"\}");
|
gg = gg.Replace("{", @"\{").Replace("}", @"\}");
|
||||||
cc.AddTransitionToCheck(myTI.TransitionID, gg);
|
cc.AddTransitionToCheck(myTI.TransitionID, gg);
|
||||||
// System.Text.RegularExpressions.Group g = m.Groups[3];
|
|
||||||
// cc.AddTransitionToCheck(myTI.TransitionID, g.ToString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1013,24 +934,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cc.AddLibDocCheck(myDI.DocID, myDI.DTS);
|
cc.AddLibDocCheck(myDI.DocID, myDI.DTS);
|
||||||
}
|
}
|
||||||
private static Volian.Base.Library.VlnTimer _MyTimer;
|
private static Volian.Base.Library.VlnTimer _MyTimer;
|
||||||
public static void SetupTimer()
|
public static void SetupTimer() => _MyTimer = new Volian.Base.Library.VlnTimer();
|
||||||
{
|
public static void ShowTimer() => _MyTimer.ShowElapsedTimes("BuildROChecks");
|
||||||
_MyTimer = new Volian.Base.Library.VlnTimer();
|
|
||||||
}
|
|
||||||
public static void ShowTimer()
|
|
||||||
{
|
|
||||||
_MyTimer.ShowElapsedTimes("BuildROChecks");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class RoUsageInfoList
|
public partial class RoUsageInfoList
|
||||||
{
|
{
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
private class AllForProcedureCriteria
|
private class AllForProcedureCriteria
|
||||||
{
|
{
|
||||||
public AllForProcedureCriteria(int itemID)
|
public AllForProcedureCriteria(int itemID) => _ItemID = itemID;
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
|
||||||
}
|
|
||||||
private int _ItemID;
|
private int _ItemID;
|
||||||
public int ItemID
|
public int ItemID
|
||||||
{
|
{
|
||||||
@@ -1090,10 +1002,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
private class AllForProcedureCriteria
|
private class AllForProcedureCriteria
|
||||||
{
|
{
|
||||||
public AllForProcedureCriteria(int itemID)
|
public AllForProcedureCriteria(int itemID) => _ItemID = itemID;
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
|
||||||
}
|
|
||||||
private int _ItemID;
|
private int _ItemID;
|
||||||
public int ItemID
|
public int ItemID
|
||||||
{
|
{
|
||||||
@@ -1217,8 +1126,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
IsReadOnly = false;
|
IsReadOnly = false;
|
||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
TransitionInfo ti = new TransitionInfo(dr);
|
TransitionInfo ti = new TransitionInfo(dr)
|
||||||
ti.ContentText = dr.GetString("ContentText");
|
{
|
||||||
|
ContentText = dr.GetString("ContentText")
|
||||||
|
};
|
||||||
this.Add(ti);
|
this.Add(ti);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
@@ -1239,10 +1150,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
private class AllForProcedureCriteria
|
private class AllForProcedureCriteria
|
||||||
{
|
{
|
||||||
public AllForProcedureCriteria(int itemID)
|
public AllForProcedureCriteria(int itemID) => _ItemID = itemID;
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
|
||||||
}
|
|
||||||
private int _ItemID;
|
private int _ItemID;
|
||||||
public int ItemID
|
public int ItemID
|
||||||
{
|
{
|
||||||
@@ -1301,14 +1209,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[XmlRoot("ConsistencyChecks")]
|
[XmlRoot("ConsistencyChecks")]
|
||||||
public class ConsistencyChecks
|
public class ConsistencyChecks
|
||||||
{
|
{
|
||||||
public static ConsistencyChecks Get(string xml)
|
public static ConsistencyChecks Get(string xml) => GenericSerializer<ConsistencyChecks>.StringDeserialize(xml);
|
||||||
{
|
public override string ToString() => GenericSerializer<ConsistencyChecks>.StringSerialize(this);
|
||||||
return GenericSerializer<ConsistencyChecks>.StringDeserialize(xml);
|
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return GenericSerializer<ConsistencyChecks>.StringSerialize(this);
|
|
||||||
}
|
|
||||||
private int _ItemID;
|
private int _ItemID;
|
||||||
[XmlAttribute("ItemID")]
|
[XmlAttribute("ItemID")]
|
||||||
public int ItemID
|
public int ItemID
|
||||||
@@ -1326,10 +1228,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _ROConsistency; }
|
get { return _ROConsistency; }
|
||||||
set { _ROConsistency = value; }
|
set { _ROConsistency = value; }
|
||||||
}
|
}
|
||||||
public void AddROCheck(string roid, string roValue)
|
public void AddROCheck(string roid, string roValue) => ROConsistency.AddROCheck(roid, roValue);
|
||||||
{
|
|
||||||
ROConsistency.AddROCheck(roid, roValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
private TransitionConsistency _TransitionFromConsistency = new TransitionConsistency();
|
private TransitionConsistency _TransitionFromConsistency = new TransitionConsistency();
|
||||||
[XmlElement("TransitionFromChecks")]
|
[XmlElement("TransitionFromChecks")]
|
||||||
@@ -1341,10 +1240,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _TransitionFromConsistency; }
|
get { return _TransitionFromConsistency; }
|
||||||
set { _TransitionFromConsistency = value; }
|
set { _TransitionFromConsistency = value; }
|
||||||
}
|
}
|
||||||
public void AddTransitionFromCheck(int transitionid, string transitionValue)
|
public void AddTransitionFromCheck(int transitionid, string transitionValue) => TransitionFromConsistency.AddTransitionCheck(transitionid, transitionValue);
|
||||||
{
|
|
||||||
TransitionFromConsistency.AddTransitionCheck(transitionid, transitionValue);
|
|
||||||
}
|
|
||||||
private TransitionConsistency _TransitionToConsistency = new TransitionConsistency();
|
private TransitionConsistency _TransitionToConsistency = new TransitionConsistency();
|
||||||
[XmlElement("TransitionToChecks")]
|
[XmlElement("TransitionToChecks")]
|
||||||
[Category("Transitions")]
|
[Category("Transitions")]
|
||||||
@@ -1355,10 +1251,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _TransitionToConsistency; }
|
get { return _TransitionToConsistency; }
|
||||||
set { _TransitionToConsistency = value; }
|
set { _TransitionToConsistency = value; }
|
||||||
}
|
}
|
||||||
public void AddTransitionToCheck(int transitionid, string transitionValue)
|
public void AddTransitionToCheck(int transitionid, string transitionValue) => TransitionToConsistency.AddTransitionCheck(transitionid, transitionValue);
|
||||||
{
|
|
||||||
TransitionToConsistency.AddTransitionCheck(transitionid, transitionValue);
|
|
||||||
}
|
|
||||||
private TransitionConsistency _TransitionConsistency = new TransitionConsistency();
|
private TransitionConsistency _TransitionConsistency = new TransitionConsistency();
|
||||||
[XmlElement("TransitionChecks")]
|
[XmlElement("TransitionChecks")]
|
||||||
[Category("Transitions")]
|
[Category("Transitions")]
|
||||||
@@ -1380,10 +1273,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _LibDocConsistency; }
|
get { return _LibDocConsistency; }
|
||||||
set { _LibDocConsistency = value; }
|
set { _LibDocConsistency = value; }
|
||||||
}
|
}
|
||||||
public void AddLibDocCheck(int docid, DateTime docdate)
|
public void AddLibDocCheck(int docid, DateTime docdate) => LibDocConsistency.AddLibDocCheck(docid, docdate);
|
||||||
{
|
|
||||||
LibDocConsistency.AddLibDocCheck(docid, docdate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
@@ -1422,10 +1312,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!_ROCheckList.ContainsKey(roid))
|
if (!_ROCheckList.ContainsKey(roid))
|
||||||
_ROCheckList.Add(roid, new ROCheck(roid, roValue));
|
_ROCheckList.Add(roid, new ROCheck(roid, roValue));
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} ROs", _ROCheckList.Count);
|
||||||
{
|
|
||||||
return string.Format("{0} ROs", _ROCheckList.Count);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
@@ -1463,10 +1350,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public ROCheck()
|
public ROCheck()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} - '{1}'", ROID, ROValue);
|
||||||
{
|
|
||||||
return string.Format("{0} - '{1}'", ROID, ROValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -1497,10 +1381,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!_TransitionCheckList.ContainsKey(transitionid))
|
if (!_TransitionCheckList.ContainsKey(transitionid))
|
||||||
_TransitionCheckList.Add(transitionid, new TransitionCheck(transitionid, transitionValue));
|
_TransitionCheckList.Add(transitionid, new TransitionCheck(transitionid, transitionValue));
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} Transitions", _TransitionCheckList.Count);
|
||||||
{
|
|
||||||
return string.Format("{0} Transitions", _TransitionCheckList.Count);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
@@ -1538,10 +1419,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public TransitionCheck()
|
public TransitionCheck()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} - '{1}'", TransitionID, TransitionValue);
|
||||||
{
|
|
||||||
return string.Format("{0} - '{1}'", TransitionID, TransitionValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -1572,10 +1450,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!_LibDocCheckList.ContainsKey(docid))
|
if (!_LibDocCheckList.ContainsKey(docid))
|
||||||
_LibDocCheckList.Add(docid, new LibDocCheck(docid, docDate));
|
_LibDocCheckList.Add(docid, new LibDocCheck(docid, docDate));
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} LibDocs", _LibDocCheckList.Count);
|
||||||
{
|
|
||||||
return string.Format("{0} LibDocs", _LibDocCheckList.Count);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
@@ -1604,16 +1479,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
//if (_OldDocDate == DateTime.MinValue)
|
|
||||||
// return null;
|
|
||||||
return _OldDocDate;
|
return _OldDocDate;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
//if (value == null)
|
|
||||||
// _OldDocDate = DateTime.MinValue;
|
|
||||||
//else
|
|
||||||
// _OldDocDate = value.Value;
|
|
||||||
_OldDocDate = value;
|
_OldDocDate = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1625,10 +1494,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public LibDocCheck()
|
public LibDocCheck()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => string.Format("{0} - '{1}'", DocID, DocDate);
|
||||||
{
|
|
||||||
return string.Format("{0} - '{1}'", DocID, DocDate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public enum Rev_Types : int
|
public enum Rev_Types : int
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,13 +9,6 @@
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
//using System.Collections.Generic;
|
|
||||||
//using System.Collections.Specialized;
|
|
||||||
//using System.Text;
|
|
||||||
//using System.IO;
|
|
||||||
//using System.Xml.Serialization;
|
|
||||||
//using System.Xml;
|
|
||||||
//using System.Xml.XPath;
|
|
||||||
using Csla;
|
using Csla;
|
||||||
using Csla.Data;
|
using Csla.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
@@ -50,13 +43,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PKCriteriaJustStage
|
protected class PKCriteriaJustStage
|
||||||
{
|
{
|
||||||
private int _StageID;
|
private readonly int _StageID;
|
||||||
public int StageID
|
public int StageID => _StageID;
|
||||||
{ get { return _StageID; } }
|
public PKCriteriaJustStage(int stageID) => _StageID = stageID;
|
||||||
public PKCriteriaJustStage(int stageID)
|
|
||||||
{
|
|
||||||
_StageID = stageID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void DataPortal_Fetch(PKCriteriaJustStage criteria)
|
private void DataPortal_Fetch(PKCriteriaJustStage criteria)
|
||||||
{
|
{
|
||||||
@@ -99,8 +88,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
public static Stage GetJustStage(int stageID)
|
public static Stage GetJustStage(int stageID)
|
||||||
{
|
{
|
||||||
if (!CanGetObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to view a Stage");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Stage tmp = DataPortal.Fetch<Stage>(new PKCriteriaJustStage(stageID));
|
Stage tmp = DataPortal.Fetch<Stage>(new PKCriteriaJustStage(stageID));
|
||||||
@@ -138,12 +125,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ReadData(dr);
|
ReadData(dr);
|
||||||
// Don't load child objects
|
|
||||||
//dr.NextResult();
|
|
||||||
//_StageChecks = StageChecks.Get(dr);
|
|
||||||
// load child objects
|
|
||||||
//dr.NextResult();
|
|
||||||
//_StageVersions = StageVersions.Get(dr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// removing of item only needed for local data portal
|
// removing of item only needed for local data portal
|
||||||
@@ -161,17 +142,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class PKCriteriaJustStage
|
protected class PKCriteriaJustStage
|
||||||
{
|
{
|
||||||
private int _StageID;
|
private readonly int _StageID;
|
||||||
public int StageID
|
public int StageID => _StageID;
|
||||||
{ get { return _StageID; } }
|
public PKCriteriaJustStage(int stageID) => _StageID = stageID;
|
||||||
public PKCriteriaJustStage(int stageID)
|
|
||||||
{
|
|
||||||
_StageID = stageID;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Log4Net
|
|
||||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,24 +25,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _NewTransToUnNumberedItem; }
|
get { return _NewTransToUnNumberedItem; }
|
||||||
set { _NewTransToUnNumberedItem = value; }
|
set { _NewTransToUnNumberedItem = value; }
|
||||||
}
|
}
|
||||||
public string PathTo
|
public string PathTo => MyItemToID.Path;
|
||||||
{
|
public string PathFrom => MyContent.ContentItems[0].Path;
|
||||||
get
|
public override string ToString() => $"ID: {TransitionID} From: {FromID} To: {ToID}";
|
||||||
{
|
|
||||||
return MyItemToID.Path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string PathFrom
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return MyContent.ContentItems[0].Path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return string.Format("ID: {0} From: {1} To: {2}", TransitionID, FromID, ToID);
|
|
||||||
}
|
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private TransitionConfig _TransitionConfig;
|
private TransitionConfig _TransitionConfig;
|
||||||
public TransitionConfig TransitionConfig
|
public TransitionConfig TransitionConfig
|
||||||
@@ -56,27 +41,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _TransitionConfig;
|
return _TransitionConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool HasPageNum
|
public bool HasPageNum => TransitionConfig.Transition_Formatted.ToUpper() == "TRUE";
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return TransitionConfig.Transition_Formatted.ToUpper() == "TRUE";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string ResolvePathTo(FormatInfo fi, ItemInfo itminfo, int tranType, ItemInfo toitem, ItemInfo rangeitem, bool hasPageNum)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return TransitionText.GetResolvedText(fi, itminfo, tranType, toitem, rangeitem, HasPageNum);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (tranType == 2 && ex.Message == "Cannot find Next Item")
|
|
||||||
return TransitionText.GetResolvedText(fi, itminfo, tranType, toitem, toitem, HasPageNum);
|
|
||||||
_MyLog.Error("Error Processing Transition Text", ex);
|
|
||||||
return "(Resolved Transition Text)";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string ResolvePathTo(FormatInfo fi, ItemInfo itminfo, int tranType, ItemInfo toitem, ItemInfo rangeitem)
|
public string ResolvePathTo(FormatInfo fi, ItemInfo itminfo, int tranType, ItemInfo toitem, ItemInfo rangeitem)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -108,13 +73,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ItemInfo item = MyContent.ContentItems[0];
|
ItemInfo item = MyContent.ContentItems[0];
|
||||||
ItemInfo myItemToID = MyItemToID;
|
ItemInfo myItemToID = MyItemToID;
|
||||||
if (tranLookup.ContainsKey(item.ItemID)) item = tranLookup[item.ItemID];
|
if (tranLookup.ContainsKey(item.ItemID)) item = tranLookup[item.ItemID];
|
||||||
bool hasPageNum = false;
|
|
||||||
if (item.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier ||
|
|
||||||
item.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier)
|
|
||||||
{
|
|
||||||
TransitionConfig tc = new TransitionConfig(Config);
|
|
||||||
if (tc != null && tc.Transition_Formatted.ToUpper() == "TRUE") hasPageNum = true;
|
|
||||||
}
|
|
||||||
if (tranLookup.ContainsKey(ToID))
|
if (tranLookup.ContainsKey(ToID))
|
||||||
{
|
{
|
||||||
myItemToID = tranLookup[ToID];
|
myItemToID = tranLookup[ToID];
|
||||||
@@ -150,7 +108,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//Console.WriteLine("MyItemToID = {0}", MyItemToID);
|
//Console.WriteLine("MyItemToID = {0}", MyItemToID);
|
||||||
//Console.WriteLine("MyItemRangeID = {0}", MyItemRangeID);
|
//Console.WriteLine("MyItemRangeID = {0}", MyItemRangeID);
|
||||||
}
|
}
|
||||||
return ResolvePathTo(item.ActiveFormat, item, TranType, myItemToID, myItemRangeID, hasPageNum);
|
return ResolvePathTo(item.ActiveFormat, item, TranType, myItemToID, myItemRangeID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#region AffectedTransitons
|
#region AffectedTransitons
|
||||||
@@ -172,16 +130,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
protected class TransitionReportDataCriteria
|
protected class TransitionReportDataCriteria
|
||||||
{
|
{
|
||||||
private int _VersionID;
|
private readonly int _VersionID;
|
||||||
public int VersionID
|
public int VersionID => _VersionID;
|
||||||
{
|
private readonly int _ProcedureID;
|
||||||
get { return _VersionID; }
|
public int ProcedureID => _ProcedureID;
|
||||||
}
|
|
||||||
private int _ProcedureID;
|
|
||||||
public int ProcedureID
|
|
||||||
{
|
|
||||||
get { return _ProcedureID; }
|
|
||||||
}
|
|
||||||
public TransitionReportDataCriteria(int versionID, int procedureID)
|
public TransitionReportDataCriteria(int versionID, int procedureID)
|
||||||
{
|
{
|
||||||
_VersionID = versionID;
|
_VersionID = versionID;
|
||||||
@@ -208,8 +160,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
IsReadOnly = false;
|
IsReadOnly = false;
|
||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
TransitionInfo ti = new TransitionInfo(dr);
|
TransitionInfo ti = new TransitionInfo(dr)
|
||||||
ti.Level = dr.GetInt32("level");
|
{
|
||||||
|
Level = dr.GetInt32("level")
|
||||||
|
};
|
||||||
this.Add(ti);
|
this.Add(ti);
|
||||||
}
|
}
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
@@ -228,10 +182,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
private class AffectedTransitonsCriteria
|
private class AffectedTransitonsCriteria
|
||||||
{
|
{
|
||||||
public AffectedTransitonsCriteria(int itemID)
|
public AffectedTransitonsCriteria(int itemID) => _ItemID = itemID;
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
|
||||||
}
|
|
||||||
private int _ItemID;
|
private int _ItemID;
|
||||||
public int ItemID
|
public int ItemID
|
||||||
{
|
{
|
||||||
@@ -287,23 +238,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder("");
|
StringBuilder sb = new StringBuilder("");
|
||||||
foreach (TransitionInfo trans in this)
|
foreach (TransitionInfo trans in this)
|
||||||
sb.Append("\r\n" + trans.PathFrom);
|
sb.Append($"\r\n{trans.PathFrom}");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region ExternalTransitionsToChildren
|
#region ExternalTransitionsToChildren
|
||||||
private class ExternalTransitionsToChildrenCriteria
|
private class ExternalTransitionsToChildrenCriteria
|
||||||
{
|
{
|
||||||
public ExternalTransitionsToChildrenCriteria(int itemID)
|
public ExternalTransitionsToChildrenCriteria(int itemID) => ItemID = itemID;
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
public int ItemID { get; set; }
|
||||||
}
|
|
||||||
private int _ItemID;
|
|
||||||
public int ItemID
|
|
||||||
{
|
|
||||||
get { return _ItemID; }
|
|
||||||
set { _ItemID = value; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static TransitionInfoList GetExternalTransitionsToChildren(int itemID)
|
public static TransitionInfoList GetExternalTransitionsToChildren(int itemID)
|
||||||
{
|
{
|
||||||
@@ -354,16 +298,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region ExternalTransitions
|
#region ExternalTransitions
|
||||||
private class ExternalTransitionsCriteria
|
private class ExternalTransitionsCriteria
|
||||||
{
|
{
|
||||||
public ExternalTransitionsCriteria(int itemID)
|
public ExternalTransitionsCriteria(int itemID) => ItemID = itemID;
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
public int ItemID { get; set; }
|
||||||
}
|
|
||||||
private int _ItemID;
|
|
||||||
public int ItemID
|
|
||||||
{
|
|
||||||
get { return _ItemID; }
|
|
||||||
set { _ItemID = value; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static TransitionInfoList GetExternalTransitions(int itemID)
|
public static TransitionInfoList GetExternalTransitions(int itemID)
|
||||||
{
|
{
|
||||||
@@ -413,16 +350,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region PastedAffectedTransitions
|
#region PastedAffectedTransitions
|
||||||
private class PastedAffectedTransitonsCriteria
|
private class PastedAffectedTransitonsCriteria
|
||||||
{
|
{
|
||||||
public PastedAffectedTransitonsCriteria(int itemID)
|
public PastedAffectedTransitonsCriteria(int itemID) => ItemID = itemID;
|
||||||
{
|
|
||||||
_ItemID = itemID;
|
public int ItemID { get; set; }
|
||||||
}
|
|
||||||
private int _ItemID;
|
|
||||||
public int ItemID
|
|
||||||
{
|
|
||||||
get { return _ItemID; }
|
|
||||||
set { _ItemID = value; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
internal static TransitionInfoList GetPastedAffected(int itemID)
|
internal static TransitionInfoList GetPastedAffected(int itemID)
|
||||||
{
|
{
|
||||||
@@ -472,16 +402,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region TransitionsToDisconnected
|
#region TransitionsToDisconnected
|
||||||
private class TransitionsToDisconnectedCriteria
|
private class TransitionsToDisconnectedCriteria
|
||||||
{
|
{
|
||||||
public TransitionsToDisconnectedCriteria(string docVersionList)
|
public TransitionsToDisconnectedCriteria(string docVersionList) => DocVersionList = docVersionList;
|
||||||
{
|
|
||||||
_DocVersionList = docVersionList;
|
public string DocVersionList { get; set; }
|
||||||
}
|
|
||||||
private string _DocVersionList;
|
|
||||||
public string DocVersionList
|
|
||||||
{
|
|
||||||
get { return _DocVersionList; }
|
|
||||||
set { _DocVersionList = value; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static TransitionInfoList GetTransitionsToDisconnected(string docVersionList)
|
public static TransitionInfoList GetTransitionsToDisconnected(string docVersionList)
|
||||||
{
|
{
|
||||||
@@ -531,16 +454,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region TransitionsToNonEditable
|
#region TransitionsToNonEditable
|
||||||
private class TransitionsToNonEditableCriteria
|
private class TransitionsToNonEditableCriteria
|
||||||
{
|
{
|
||||||
public TransitionsToNonEditableCriteria(string docVersionList)
|
public TransitionsToNonEditableCriteria(string docVersionList) => DocVersionList = docVersionList;
|
||||||
{
|
|
||||||
_DocVersionList = docVersionList;
|
public string DocVersionList { get; set; }
|
||||||
}
|
|
||||||
private string _DocVersionList;
|
|
||||||
public string DocVersionList
|
|
||||||
{
|
|
||||||
get { return _DocVersionList; }
|
|
||||||
set { _DocVersionList = value; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static TransitionInfoList GetTransitionsToNonEditable(string docVersionList)
|
public static TransitionInfoList GetTransitionsToNonEditable(string docVersionList)
|
||||||
{
|
{
|
||||||
@@ -590,7 +506,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public class TransitionBuilder
|
public class TransitionBuilder
|
||||||
{
|
{
|
||||||
private StringBuilder _Results = new StringBuilder();
|
private readonly StringBuilder _Results = new StringBuilder();
|
||||||
public FormatData _FormatData;
|
public FormatData _FormatData;
|
||||||
public string _TransFormat;
|
public string _TransFormat;
|
||||||
public E_TransUI _TransUI;
|
public E_TransUI _TransUI;
|
||||||
@@ -599,52 +515,24 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public ItemInfo _ToItem;
|
public ItemInfo _ToItem;
|
||||||
public ItemInfo _RangeItem;
|
public ItemInfo _RangeItem;
|
||||||
public bool _UsedRangeAncestor;
|
public bool _UsedRangeAncestor;
|
||||||
private string _Token;
|
|
||||||
public string _UnitProcSetString;
|
public string _UnitProcSetString;
|
||||||
public bool SectNumWithStepNum;
|
public bool SectNumWithStepNum;
|
||||||
private int _SectionNumberLength = 0;
|
|
||||||
public int SectionNumberLength
|
public int SectionNumberLength { get; set; } = 0;
|
||||||
{
|
public string StepPrefix { get; set; } = "";
|
||||||
get { return _SectionNumberLength; }
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
set { _SectionNumberLength = value; }
|
|
||||||
}
|
|
||||||
private string _StepPrefix = "";
|
|
||||||
public string StepPrefix
|
|
||||||
{
|
|
||||||
get { return _StepPrefix; }
|
|
||||||
set { _StepPrefix = value; }
|
|
||||||
}
|
|
||||||
private List<int> _SectionsUsed = new List<int>();
|
private List<int> _SectionsUsed = new List<int>();
|
||||||
public List<int> SectionsUsed
|
public List<int> SectionsUsed => _SectionsUsed;
|
||||||
{
|
public string Token { get; set; }
|
||||||
get { return _SectionsUsed; }
|
|
||||||
}
|
|
||||||
public string Token
|
|
||||||
{
|
|
||||||
get { return _Token; }
|
|
||||||
set { _Token = value; }
|
|
||||||
}
|
|
||||||
private string _Prefix;
|
private string _Prefix;
|
||||||
public string Prefix
|
public string Prefix
|
||||||
{
|
{
|
||||||
get { return _Prefix; }
|
get { return _Prefix; }
|
||||||
set { if(_Prefix==null)_Prefix = value; }
|
set { if(_Prefix==null)_Prefix = value; }
|
||||||
}
|
}
|
||||||
public void ResetPrefix(string str)
|
public void ResetPrefix(string str) => _Prefix = str;
|
||||||
{
|
public bool HasText => _Results.Length > 0;
|
||||||
_Prefix = str;
|
public StringBuilder Append(string str) => _Results.Append(str);
|
||||||
}
|
|
||||||
public bool HasText
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _Results.Length > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public StringBuilder Append(string str)
|
|
||||||
{
|
|
||||||
return _Results.Append(str);
|
|
||||||
}
|
|
||||||
public StringBuilder ReplaceToken(string str)
|
public StringBuilder ReplaceToken(string str)
|
||||||
{
|
{
|
||||||
if (str == null || str == "") return _Results;
|
if (str == null || str == "") return _Results;
|
||||||
@@ -662,18 +550,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else
|
else
|
||||||
return _Results.Append(str.TrimEnd(" :".ToCharArray()));
|
return _Results.Append(str.TrimEnd(" :".ToCharArray()));
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString() => _Results.ToString();
|
||||||
{
|
public StringBuilder Remove(int startIndex, int length) => _Results.Remove(startIndex, length);
|
||||||
return _Results.ToString();
|
public int Length => _Results.Length;
|
||||||
}
|
|
||||||
public StringBuilder Remove(int startIndex, int length)
|
|
||||||
{
|
|
||||||
return _Results.Remove(startIndex, length);
|
|
||||||
}
|
|
||||||
public int Length
|
|
||||||
{
|
|
||||||
get { return _Results.Length; }
|
|
||||||
}
|
|
||||||
public void AppendPrefix()
|
public void AppendPrefix()
|
||||||
{
|
{
|
||||||
if (Prefix == null) return; // no Prefix text to add
|
if (Prefix == null) return; // no Prefix text to add
|
||||||
@@ -741,47 +620,43 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private static Dictionary<string, TransitionAppendFunction> _AppendMethods;
|
private static Dictionary<string, TransitionAppendFunction> _AppendMethods;
|
||||||
private static void SetupMethods()
|
private static void SetupMethods()
|
||||||
{
|
{
|
||||||
_AppendMethods = new Dictionary<string, TransitionAppendFunction>();
|
_AppendMethods = new Dictionary<string, TransitionAppendFunction>
|
||||||
_AppendMethods.Add("{Proc Num}", AddTransitionProcNum);
|
|
||||||
_AppendMethods.Add("{?.Proc Num}", AddOptionalTransitionProcNum);
|
|
||||||
_AppendMethods.Add("{Proc Title}", AddTransitionProcTitle);
|
|
||||||
_AppendMethods.Add("{?.Proc Title}", AddOptionalTransitionProcTitle);
|
|
||||||
_AppendMethods.Add("{First Step}", AddStepNumber);
|
|
||||||
_AppendMethods.Add("{Step Number}", AddStepNumber); // WCN2, tran type 6
|
|
||||||
_AppendMethods.Add("{Last Step}", AddRangeStepNumber);
|
|
||||||
_AppendMethods.Add("{.}", AddIncludedStepNumber);
|
|
||||||
_AppendMethods.Add("{Sect Hdr}", AddTranGetSectionHdr);
|
|
||||||
_AppendMethods.Add("{?.Sect Hdr}", AddOptionalTranGetSectionHdr);
|
|
||||||
_AppendMethods.Add("{Sect Title}", AddTranGetSectionTitle);
|
|
||||||
_AppendMethods.Add("{?.Sect Title}", AddOptionalTranGetSectionTitle);
|
|
||||||
_AppendMethods.Add("{?.Sect Num}", AddOptionalTranGetSectionNum);
|
|
||||||
_AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber);
|
|
||||||
_AppendMethods.Add("{Sect Num All}", AddTranGetAllSectionNumber);
|
|
||||||
_AppendMethods.Add("{Sect Number}", AddTranGetSectionNumber); // WCN2, tran type 6
|
|
||||||
_AppendMethods.Add("{Page Num}", AddPageNumber);
|
|
||||||
_AppendMethods.Add("{Step Text}", AddStepText);
|
|
||||||
}
|
|
||||||
public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool hasPageNum)
|
|
||||||
{
|
{
|
||||||
return GetResolvedText(fromInfo.ActiveFormat, fromInfo, tranType, toItem, rangeItem, hasPageNum);
|
{ "{Proc Num}", AddTransitionProcNum },
|
||||||
|
{ "{?.Proc Num}", AddOptionalTransitionProcNum },
|
||||||
|
{ "{Proc Title}", AddTransitionProcTitle },
|
||||||
|
{ "{?.Proc Title}", AddOptionalTransitionProcTitle },
|
||||||
|
{ "{First Step}", AddStepNumber },
|
||||||
|
{ "{Step Number}", AddStepNumber }, // WCN2, tran type 6
|
||||||
|
{ "{Last Step}", AddRangeStepNumber },
|
||||||
|
{ "{.}", AddIncludedStepNumber },
|
||||||
|
{ "{Sect Hdr}", AddTranGetSectionHdr },
|
||||||
|
{ "{?.Sect Hdr}", AddOptionalTranGetSectionHdr },
|
||||||
|
{ "{Sect Title}", AddTranGetSectionTitle },
|
||||||
|
{ "{?.Sect Title}", AddOptionalTranGetSectionTitle },
|
||||||
|
{ "{?.Sect Num}", AddOptionalTranGetSectionNum },
|
||||||
|
{ "{Sect Num}", AddTranGetSectionNumber },
|
||||||
|
{ "{Sect Num All}", AddTranGetAllSectionNumber },
|
||||||
|
{ "{Sect Number}", AddTranGetSectionNumber }, // WCN2, tran type 6
|
||||||
|
{ "{Page Num}", AddPageNumber },
|
||||||
|
{ "{Step Text}", AddStepText }
|
||||||
|
};
|
||||||
}
|
}
|
||||||
private static Regex RegFixVCS = new Regex(@"Section ([0-9.]+)(.0)? Step \1"); // Find Section xxx followed by Step xxx
|
public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool hasPageNum) => GetResolvedText(fromInfo.ActiveFormat, fromInfo, tranType, toItem, rangeItem, hasPageNum);
|
||||||
|
private static readonly Regex RegFixVCS = new Regex(@"Section ([0-9.]+)(.0)? Step \1"); // Find Section xxx followed by Step xxx
|
||||||
public static string GetResolvedText(FormatInfo formatInfo, ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool pagenum)
|
public static string GetResolvedText(FormatInfo formatInfo, ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool pagenum)
|
||||||
{
|
{
|
||||||
if (!pagenum)
|
if (!pagenum)
|
||||||
{
|
{
|
||||||
TransitionInfo ct = fromInfo.MyContent.ContentTransitionCount > 0 ? fromInfo.MyContent.ContentTransitions[0] : null;
|
TransitionInfo ct = fromInfo.MyContent.ContentTransitionCount > 0 ? fromInfo.MyContent.ContentTransitions[0] : null;
|
||||||
int trIU = -1;
|
|
||||||
string cfg = string.Empty;
|
|
||||||
if (ct != null)
|
if (ct != null)
|
||||||
{
|
{
|
||||||
trIU = fromInfo.MyContent.ContentTransitions[0].MyTransitionInfoUnique;
|
_ = fromInfo.MyContent.ContentTransitions[0].MyTransitionInfoUnique;
|
||||||
cfg = fromInfo.MyContent.ContentTransitions[0].Config;
|
_ = fromInfo.MyContent.ContentTransitions[0].Config;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string pattern = string.Format(@"<START\]\\v0([^#]*)\\v #Link:Transition(|Range):[0-9]* <CTID=-[0-9]+>( [0-9]*){{1,2}}\[END>");
|
string pattern = string.Format(@"<START\]\\v0([^#]*)\\v #Link:Transition(|Range):[0-9]* <CTID=-[0-9]+>( [0-9]*){{1,2}}\[END>");
|
||||||
//string pattern = string.Format(@".*\\v <START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:[0-9]+ <CTID=-[0-9]+>( [0-9]*){{1,2}}\[END>");
|
|
||||||
Match m = Regex.Match(fromInfo.MyContent.Text, pattern);
|
Match m = Regex.Match(fromInfo.MyContent.Text, pattern);
|
||||||
if (m.Groups.Count > 1 && m.Groups[1].Value.ToUpper().Contains("(PAGE ~)")) // B2020-089, check for upper case Page ~ in case step was upper cased
|
if (m.Groups.Count > 1 && m.Groups[1].Value.ToUpper().Contains("(PAGE ~)")) // B2020-089, check for upper case Page ~ in case step was upper cased
|
||||||
pagenum = true;
|
pagenum = true;
|
||||||
@@ -805,7 +680,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tb._TransFormat = tb._TransFormat.Insert(tb._TransFormat.IndexOf("{First Step}")+12, " {Page Num}");
|
tb._TransFormat = tb._TransFormat.Insert(tb._TransFormat.IndexOf("{First Step}")+12, " {Page Num}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tb._TransFormat = tb._TransFormat + " {Page Num}";
|
tb._TransFormat += " {Page Num}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(_AppendMethods==null)
|
if(_AppendMethods==null)
|
||||||
@@ -820,18 +695,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
retval = toItem.Ordinal.ToString();
|
retval = toItem.Ordinal.ToString();
|
||||||
fromInfo.NewTransToUnNumberedItem = true;
|
fromInfo.NewTransToUnNumberedItem = true;
|
||||||
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("Setting Flag", 3, 10);
|
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("Setting Flag", 3, 10);
|
||||||
//using (Item itm = fromInfo.Get())
|
|
||||||
//{
|
|
||||||
// ItemAnnotation ia = itm.ItemAnnotations.Add(AnnotationType.GetByName("Verifcation Required"));
|
|
||||||
// ia.SearchText = "Transition to Un-Numbered Step";
|
|
||||||
//itm.Save();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
//if (Regex.IsMatch(retval, @".*\[[BP][0-9]{4,4}\].*")
|
|
||||||
// && tb._ToItem.ActiveFormat != null
|
|
||||||
// && tb._ToItem.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert )
|
|
||||||
// retval = Regex.Replace(retval, @" *(\[[BP][0-9]{4,4}\])+","");
|
|
||||||
//return retval;
|
|
||||||
if (Regex.IsMatch(retval, @".* *\[([A-Z0-9 ]|\\u160\?)+\] *.*")
|
if (Regex.IsMatch(retval, @".* *\[([A-Z0-9 ]|\\u160\?)+\] *.*")
|
||||||
&& tb._ToItem.ActiveFormat != null
|
&& tb._ToItem.ActiveFormat != null
|
||||||
&& tb._ToItem.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert)
|
&& tb._ToItem.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert)
|
||||||
@@ -844,8 +708,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
private static TransitionBuilder SetupTransitionBuilder(FormatInfo formatInfo, ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem)
|
private static TransitionBuilder SetupTransitionBuilder(FormatInfo formatInfo, ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem)
|
||||||
{
|
{
|
||||||
TransitionBuilder tb = new TransitionBuilder();
|
TransitionBuilder tb = new TransitionBuilder
|
||||||
tb._FormatData = formatInfo.PlantFormat.FormatData;
|
{
|
||||||
|
_FormatData = formatInfo.PlantFormat.FormatData
|
||||||
|
};
|
||||||
// get the format of the transition string based on this transition's index into the TransData part of
|
// get the format of the transition string based on this transition's index into the TransData part of
|
||||||
// format....
|
// format....
|
||||||
if (tranType >= tb._FormatData.TransData.TransTypeList.MaxIndex) // found during fixing of B2016-176 B2016-197 fixes invalid index error during import of procedure
|
if (tranType >= tb._FormatData.TransData.TransTypeList.MaxIndex) // found during fixing of B2016-176 B2016-197 fixes invalid index error during import of procedure
|
||||||
@@ -873,8 +739,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tb._TranType = 4;
|
tb._TranType = 4;
|
||||||
}
|
}
|
||||||
int startIndex = 0;
|
int startIndex = 0;
|
||||||
int index = -1;
|
|
||||||
int rexIndex = -1;
|
|
||||||
string prefix = null;
|
string prefix = null;
|
||||||
string prevToken = null;
|
string prevToken = null;
|
||||||
bool lastAdded = false;
|
bool lastAdded = false;
|
||||||
@@ -885,7 +749,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
string tmppref = prefix;
|
string tmppref = prefix;
|
||||||
prefix = null;
|
prefix = null;
|
||||||
rexIndex = m.Index;
|
int rexIndex = m.Index;
|
||||||
int rexEndToken = m.Index + m.Length - 1;
|
int rexEndToken = m.Index + m.Length - 1;
|
||||||
if (rexIndex > startIndex) prefix = tb._TransFormat.Substring(startIndex, rexIndex - startIndex);
|
if (rexIndex > startIndex) prefix = tb._TransFormat.Substring(startIndex, rexIndex - startIndex);
|
||||||
if (prefix == null) prevToken = null;
|
if (prefix == null) prevToken = null;
|
||||||
@@ -1007,8 +871,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// as used by AEP is: UnitProcSetString ="{PSI:UNITCOM}-{SI:SETNAME}-{PSI:SETID}-"
|
// as used by AEP is: UnitProcSetString ="{PSI:UNITCOM}-{SI:SETNAME}-{PSI:SETID}-"
|
||||||
string findMatch = "{.*?}";
|
string findMatch = "{.*?}";
|
||||||
MatchCollection ms = Regex.Matches(tb._UnitProcSetString,findMatch);
|
MatchCollection ms = Regex.Matches(tb._UnitProcSetString,findMatch);
|
||||||
string txt = tb._UnitProcSetString;
|
_ = tb._ToItem.MyDocVersion.MyFolder.FolderConfig as FolderConfig;
|
||||||
FolderConfig fc = tb._ToItem.MyDocVersion.MyFolder.FolderConfig as FolderConfig;
|
|
||||||
ProcedureConfig pc = new ProcedureConfig(tb._ToItem.MyProcedure.MyContent.Config);
|
ProcedureConfig pc = new ProcedureConfig(tb._ToItem.MyProcedure.MyContent.Config);
|
||||||
// Use a dictionary to get all of the tokens from the format string, then
|
// Use a dictionary to get all of the tokens from the format string, then
|
||||||
// go through all dictionary entries to make the replacements.
|
// go through all dictionary entries to make the replacements.
|
||||||
@@ -1094,7 +957,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
||||||
lretstr.Append(tb._FormatData.TransData.CapsTransitions ? parenstr.ToUpper().Replace(@"\U", @"\u") :
|
lretstr.Append(tb._FormatData.TransData.CapsTransitions ? parenstr.ToUpper().Replace(@"\U", @"\u") :
|
||||||
tb._FormatData.TransData.Cap1stCharTrans ? CapFirstLetterOnly(parenstr, 0) :
|
tb._FormatData.TransData.Cap1stCharTrans ? CapFirstLetterOnly(parenstr) :
|
||||||
parenstr);
|
parenstr);
|
||||||
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
||||||
}
|
}
|
||||||
@@ -1170,7 +1033,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (thisTab != null && thisTab != "")
|
if (thisTab != null && thisTab != "")
|
||||||
{
|
{
|
||||||
thisTab = thisTab.Trim(" ".ToCharArray());
|
thisTab = thisTab.Trim(" ".ToCharArray());
|
||||||
if (hasDelim && !thisTab.EndsWith(".") && !thisTab.EndsWith(")")) thisTab = thisTab + ".";
|
if (hasDelim && !thisTab.EndsWith(".") && !thisTab.EndsWith(")")) thisTab += ".";
|
||||||
if (hasDotZero && thisTab.EndsWith(".0.")) thisTab = thisTab.Substring(0, thisTab.Length - 2);
|
if (hasDotZero && thisTab.EndsWith(".0.")) thisTab = thisTab.Substring(0, thisTab.Length - 2);
|
||||||
}
|
}
|
||||||
// RHM 20130326 2039 - I added the logic to limit the addition of the section tab to
|
// RHM 20130326 2039 - I added the logic to limit the addition of the section tab to
|
||||||
@@ -1197,7 +1060,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!hasDelim)
|
if (!hasDelim)
|
||||||
foreach (string rmvDelim in DelimList) hlsTab = hlsTab.Replace(rmvDelim, "");
|
foreach (string rmvDelim in DelimList) hlsTab = hlsTab.Replace(rmvDelim, "");
|
||||||
hlsTab = hlsTab.Trim(" ".ToCharArray());
|
hlsTab = hlsTab.Trim(" ".ToCharArray());
|
||||||
if (hasDelim && !hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab = hlsTab + ".";
|
if (hasDelim && !hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab += ".";
|
||||||
if (hasDotZero)
|
if (hasDotZero)
|
||||||
{
|
{
|
||||||
if (item.IsHigh)
|
if (item.IsHigh)
|
||||||
@@ -1218,9 +1081,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
private static bool AddPageNumber(TransitionBuilder tb)
|
private static bool AddPageNumber(TransitionBuilder tb)
|
||||||
{
|
{
|
||||||
//At some point, add a property off a section 'IsFoldout' and use the next two lines:
|
|
||||||
//if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && mySection.MyContent.Number.ToUpper() == "FOLDOUT")
|
|
||||||
//|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
|
|
||||||
if (tb._ToItem.PageNumber != -1 && (tb._FromItem.PageNumber != -1 || (tb._FromItem.ActiveSection.MyConfig as SectionConfig).Section_IsFoldout == "Y")) //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
|
if (tb._ToItem.PageNumber != -1 && (tb._FromItem.PageNumber != -1 || (tb._FromItem.ActiveSection.MyConfig as SectionConfig).Section_IsFoldout == "Y")) //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
|
||||||
{
|
{
|
||||||
int pgoffset = tb._ToItem.PageNumber - tb._FromItem.PageNumber;
|
int pgoffset = tb._ToItem.PageNumber - tb._FromItem.PageNumber;
|
||||||
@@ -1256,7 +1116,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private static bool AddStepNumber(TransitionBuilder tb)
|
private static bool AddStepNumber(TransitionBuilder tb)
|
||||||
{
|
{
|
||||||
// If we're on a step put out the step number.
|
// If we're on a step put out the step number.
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - Kept for Debugging
|
||||||
ItemInfo secitm = TranGetSectionItem(tb._ToItem);
|
ItemInfo secitm = TranGetSectionItem(tb._ToItem);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
if ((!((tb._TransUI & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)) || tb._ToItem.MyContent.Type > 20000)
|
if ((!((tb._TransUI & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)) || tb._ToItem.MyContent.Type > 20000)
|
||||||
{
|
{
|
||||||
if (tb._FormatData.PrintData.SpecialCaseCalvertAlarm && tb._ToItem.IsHigh && tb._ToItem.FormatStepData.StepEditData.TypeMenu.MenuItem.ToUpper().Contains("WINDOW"))
|
if (tb._FormatData.PrintData.SpecialCaseCalvertAlarm && tb._ToItem.IsHigh && tb._ToItem.FormatStepData.StepEditData.TypeMenu.MenuItem.ToUpper().Contains("WINDOW"))
|
||||||
@@ -1281,7 +1143,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tb.Remove(tb.Length - 7, 7); // 7 is length of ", Step "
|
tb.Remove(tb.Length - 7, 7); // 7 is length of ", Step "
|
||||||
tb.AppendPrefix();
|
tb.AppendPrefix();
|
||||||
}
|
}
|
||||||
//else if (tb._TranType == 4 && tb._ToItem.MoreThanOneStepSection())
|
|
||||||
else if (tb._TranType == 4 && tb._ToItem.MoreThanOneStepSection() || tb._TranType == 5)
|
else if (tb._TranType == 4 && tb._ToItem.MoreThanOneStepSection() || tb._TranType == 5)
|
||||||
{
|
{
|
||||||
tb.AppendPrefix();
|
tb.AppendPrefix();
|
||||||
@@ -1333,14 +1194,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
bool usedRangeAncestor = false;
|
bool usedRangeAncestor = false;
|
||||||
// Refresh Next Items
|
// Refresh Next Items
|
||||||
tb._ToItem.RefreshNextItems();
|
tb._ToItem.RefreshNextItems();
|
||||||
ItemInfo next = GetNextItem(tb._ToItem, rangeAncestors, ref usedRangeAncestor);
|
ItemInfo next = GetNextItem(tb._ToItem, rangeAncestors);
|
||||||
string lastTab = Tab(tb._RangeItem, tb._RangeItem.ActiveFormat.PlantFormat.FormatData.TransData.TStepNoFlag);
|
string lastTab = Tab(tb._RangeItem, tb._RangeItem.ActiveFormat.PlantFormat.FormatData.TransData.TStepNoFlag);
|
||||||
while (next.ItemID != tb._RangeItem.ItemID)
|
while (next.ItemID != tb._RangeItem.ItemID)
|
||||||
{
|
{
|
||||||
string thisTab = Tab(next, tb._RangeItem.ActiveFormat.PlantFormat.FormatData.TransData.TStepNoFlag);
|
string thisTab = Tab(next, tb._RangeItem.ActiveFormat.PlantFormat.FormatData.TransData.TStepNoFlag);
|
||||||
if (lastTab == thisTab) break;
|
if (lastTab == thisTab) break;
|
||||||
tb.ReplaceToken(", " + thisTab);
|
tb.ReplaceToken(", " + thisTab);
|
||||||
next = GetNextItem(next, rangeAncestors, ref usedRangeAncestor);
|
next = GetNextItem(next, rangeAncestors);
|
||||||
}
|
}
|
||||||
tb._UsedRangeAncestor = usedRangeAncestor;
|
tb._UsedRangeAncestor = usedRangeAncestor;
|
||||||
return true;
|
return true;
|
||||||
@@ -1363,7 +1224,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
private static ItemInfo GetNextItem(ItemInfo next, Dictionary<int, ItemInfo> rangeAncestors, ref bool usedRangeAncestor)
|
private static ItemInfo GetNextItem(ItemInfo next, Dictionary<int, ItemInfo> rangeAncestors)
|
||||||
{
|
{
|
||||||
if (rangeAncestors.ContainsKey(next.ItemID))
|
if (rangeAncestors.ContainsKey(next.ItemID))
|
||||||
return rangeAncestors[next.ItemID];
|
return rangeAncestors[next.ItemID];
|
||||||
@@ -1473,14 +1334,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
private static bool AddTranGetSectionNumber(TransitionBuilder tb)
|
private static bool AddTranGetSectionNumber(TransitionBuilder tb) => AddTranGetSectionNumber(tb, false);
|
||||||
{
|
private static bool AddTranGetAllSectionNumber(TransitionBuilder tb) => AddTranGetSectionNumber(tb, true);
|
||||||
return AddTranGetSectionNumber(tb, false);
|
|
||||||
}
|
|
||||||
private static bool AddTranGetAllSectionNumber(TransitionBuilder tb)
|
|
||||||
{
|
|
||||||
return AddTranGetSectionNumber(tb, true);
|
|
||||||
}
|
|
||||||
private static bool AddTranGetSectionNumber(TransitionBuilder tb, bool allLevels)
|
private static bool AddTranGetSectionNumber(TransitionBuilder tb, bool allLevels)
|
||||||
{
|
{
|
||||||
if (tb._TranType == 1 && tb._ToItem.ActiveSection.ItemID == tb._FromItem.ActiveSection.ItemID) return false;
|
if (tb._TranType == 1 && tb._ToItem.ActiveSection.ItemID == tb._FromItem.ActiveSection.ItemID) return false;
|
||||||
@@ -1515,11 +1370,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return (retstr != null && retstr != "");
|
return (retstr != null && retstr != "");
|
||||||
}
|
}
|
||||||
//B2016-003 Transitions to sections whose number has a leading space was causing errors in transition text
|
//B2016-003 Transitions to sections whose number has a leading space was causing errors in transition text
|
||||||
private static string TrimSectNumber(string str)
|
private static string TrimSectNumber(string str) => str == null ? str : str.TrimStart();
|
||||||
{
|
|
||||||
if (str == null) return str;
|
|
||||||
return str.TrimStart();
|
|
||||||
}
|
|
||||||
private static string FixTitleCase(Match m)
|
private static string FixTitleCase(Match m)
|
||||||
{
|
{
|
||||||
if (Regex.IsMatch(m.Value, @"^[A-Za-z]+\.?$"))
|
if (Regex.IsMatch(m.Value, @"^[A-Za-z]+\.?$"))
|
||||||
@@ -1533,12 +1384,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return m.Value;
|
return m.Value;
|
||||||
}
|
}
|
||||||
private static string CapFirstLetterOnly(string retstr, int p)
|
private static string CapFirstLetterOnly(string retstr)
|
||||||
{
|
{
|
||||||
// LATER: write code to capitalize first letter (active plants)
|
// LATER: write code to capitalize first letter (active plants)
|
||||||
// F2021-037: Support title case include '/' as separator (added '/' to regex replace)
|
// F2021-037: Support title case include '/' as separator (added '/' to regex replace)
|
||||||
string lretstr = Regex.Replace(retstr, @"([^ ,/]+)", new MatchEvaluator(FixTitleCase));
|
return Regex.Replace(retstr, @"([^ ,/]+)", new MatchEvaluator(FixTitleCase));
|
||||||
return lretstr;
|
|
||||||
}
|
}
|
||||||
// TODO: Section methods are not complete....
|
// TODO: Section methods are not complete....
|
||||||
private static ItemInfo TranGetSectionItem(ItemInfo itminfo)
|
private static ItemInfo TranGetSectionItem(ItemInfo itminfo)
|
||||||
@@ -1564,7 +1414,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string str1 = TranGetSectionNumber(tb._ToItem);
|
string str1 = TranGetSectionNumber(tb._ToItem);
|
||||||
// F2024-008 added flag to title case the section number in transitions
|
// F2024-008 added flag to title case the section number in transitions
|
||||||
if (tb._FormatData.TransData.Cap1stCharTransSectionNumber)
|
if (tb._FormatData.TransData.Cap1stCharTransSectionNumber)
|
||||||
str1 = CapFirstLetterOnly(str1, 0);
|
str1 = CapFirstLetterOnly(str1);
|
||||||
if(!tb._ToItem.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) return str1;
|
if(!tb._ToItem.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) return str1;
|
||||||
List<ItemInfo> FromSections = GetSections(tb._FromItem.ActiveSection);
|
List<ItemInfo> FromSections = GetSections(tb._FromItem.ActiveSection);
|
||||||
List<ItemInfo> ToSections = GetSections(tb._ToItem.ActiveSection);
|
List<ItemInfo> ToSections = GetSections(tb._ToItem.ActiveSection);
|
||||||
@@ -1578,11 +1428,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//string str = tmpitm.MyContent.Number;
|
|
||||||
string str = BuildSectionPath(ToSections);
|
string str = BuildSectionPath(ToSections);
|
||||||
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>)
|
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>)
|
||||||
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(tb._ToItem.MyDocVersion, str);
|
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(tb._ToItem.MyDocVersion, str);
|
||||||
//if (!str.EndsWith(".") && tb._ToItem.ItemID != tb._ToItem.ActiveSection.ItemID)
|
|
||||||
tb.StepPrefix = ".";
|
tb.StepPrefix = ".";
|
||||||
tb.SectionNumberLength = str.Length;
|
tb.SectionNumberLength = str.Length;
|
||||||
return (str);
|
return (str);
|
||||||
@@ -1611,10 +1459,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
sb.Append(sep + lastPart.TrimEnd(" ".ToCharArray()));
|
sb.Append(sep + lastPart.TrimEnd(" ".ToCharArray()));
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
private static bool IsRoman(string number)
|
private static bool IsRoman(string number) => Regex.IsMatch(number, @"[IVXLCDM]+\.?");
|
||||||
{
|
|
||||||
return Regex.IsMatch(number,@"[IVXLCDM]+\.?");
|
|
||||||
}
|
|
||||||
private static List<ItemInfo> GetSections(ItemInfo myItemInfo)
|
private static List<ItemInfo> GetSections(ItemInfo myItemInfo)
|
||||||
{
|
{
|
||||||
List<ItemInfo> retval = new List<ItemInfo>();
|
List<ItemInfo> retval = new List<ItemInfo>();
|
||||||
@@ -1633,7 +1478,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ItemInfo tmpitm = TranGetSectionItem(itminfo);
|
ItemInfo tmpitm = TranGetSectionItem(itminfo);
|
||||||
string sectionTitle = tmpitm.MyContent.Text;
|
string sectionTitle = tmpitm.MyContent.Text;
|
||||||
sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") :
|
sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") :
|
||||||
tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle, 0) :
|
tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle) :
|
||||||
sectionTitle);
|
sectionTitle);
|
||||||
// F2024-008 Added flag to surround the section title with parenthesis in transitions
|
// F2024-008 Added flag to surround the section title with parenthesis in transitions
|
||||||
if (tb._FormatData.TransData.ParensAroundSectionTitle)
|
if (tb._FormatData.TransData.ParensAroundSectionTitle)
|
||||||
@@ -1658,7 +1503,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ItemInfo tmpitm = TranGetSectionItem(itminfo);
|
ItemInfo tmpitm = TranGetSectionItem(itminfo);
|
||||||
string sectionTitle = tmpitm.MyContent.Text;
|
string sectionTitle = tmpitm.MyContent.Text;
|
||||||
sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") :
|
sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") :
|
||||||
tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle, 0) :
|
tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle) :
|
||||||
sectionTitle);
|
sectionTitle);
|
||||||
// B2017-236 Replace embedded returns with spaces and trim the spaces from the end of the section title.
|
// B2017-236 Replace embedded returns with spaces and trim the spaces from the end of the section title.
|
||||||
return TrimSectionTitle(sectionTitle);
|
return TrimSectionTitle(sectionTitle);
|
||||||
|
|||||||
Reference in New Issue
Block a user