C2026-008 - Re-Architect RO.FST to include RO Modification date/time and use those when updating ROs from the RO.FST

This commit is contained in:
2026-04-28 09:13:17 -04:00
parent a544a5cd4f
commit 7f0d39b684
14 changed files with 712 additions and 495 deletions
+40 -50
View File
@@ -61,57 +61,47 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
}
}
// used to remove word section PDFs to force ROs to be updated when printed or saved
public static void DeleteAllDocVersion(int versionID)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
try
{
DataPortal.Delete(new VersionIDCriteria(versionID));
}
catch (Exception ex)
{
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
}
}
[Serializable()]
protected class VersionIDCriteria
{
private int _VersionID;
public int VersionID
{ get { return _VersionID; } }
public VersionIDCriteria(int versionID)
{
_VersionID = versionID;
}
}
[Transactional(TransactionalTypes.TransactionScope)]
private void DataPortal_Delete(VersionIDCriteria criteria)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Pdf.DataPortal_Delete", GetHashCode());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteAllDocVersionPdfs";
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DataPortal_Delete", ex);
_ErrorMessage = ex.Message;
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
}
}
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// 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)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
try
{
DeleteWithNewROs(versionID, origfstid, newfstid);
}
catch (Exception ex)
{
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
}
}
static private void DeleteWithNewROs(int docversionID, int origfstid, int newfstid)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteDocVersionPdfsWithNewROs";
cm.Parameters.AddWithValue("@VersionID", docversionID);
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DeleteWithNewROs", ex);
throw new DbCslaException("Pdf.DeleteWithNewROs", ex);
}
}
}
public partial class PdfInfo
{