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:
@@ -1093,8 +1093,17 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
// B2022-026 RO Memory Reduction code - pass in ROFstInfo
|
||||
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
//Refresh at item level
|
||||
public static void RefreshReferenceObjects(ItemInfo tmp, ROFstInfo origROFst)
|
||||
{
|
||||
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
|
||||
MyRefreshReferenceObjects(tmp, null, tmp.GetSectionInfo(), tmp.MyDocVersion, origROFst);
|
||||
}
|
||||
|
||||
// B2022-026 RO Memory Reduction code - pass in ROFstInfo
|
||||
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
|
||||
{
|
||||
if (itemInfo.MyContent.ContentPartCount > 0)
|
||||
{
|
||||
@@ -1219,31 +1228,47 @@ namespace VEPROMS.CSLA.Library
|
||||
return true;
|
||||
}
|
||||
|
||||
#region Debug Code
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
public static List<ItemInfo> GetItemInfoWithChangedROs(int docversionid, int origfstid, int newfstid)
|
||||
{
|
||||
List<ItemInfo> lst = new List<ItemInfo>();
|
||||
|
||||
//private static void ShowDifference(string oldText, string newText)
|
||||
//{
|
||||
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||
// ShowText("OldText", ot);
|
||||
// ShowText("NewText", nt);
|
||||
//}
|
||||
//private static void ShowText(string title, string newText)
|
||||
//{
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// foreach (char c in newText)
|
||||
// {
|
||||
// if(c<' ' || c> '\x7F')
|
||||
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
|
||||
// else
|
||||
// sb.Append(c);
|
||||
// }
|
||||
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
|
||||
//}
|
||||
foreach (DataRow r in Data_GetItemsWithChangedROs(docversionid, origfstid, newfstid).Rows)
|
||||
{
|
||||
using (ItemInfo itm = Get((int)r["ItemID"]))
|
||||
{
|
||||
lst.Add(itm);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // debug
|
||||
return lst;
|
||||
}
|
||||
|
||||
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
||||
#region Debug Code
|
||||
|
||||
//private static void ShowDifference(string oldText, string newText)
|
||||
//{
|
||||
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||
// ShowText("OldText", ot);
|
||||
// ShowText("NewText", nt);
|
||||
//}
|
||||
//private static void ShowText(string title, string newText)
|
||||
//{
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// foreach (char c in newText)
|
||||
// {
|
||||
// if(c<' ' || c> '\x7F')
|
||||
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
|
||||
// else
|
||||
// sb.Append(c);
|
||||
// }
|
||||
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
|
||||
//}
|
||||
|
||||
#endregion // debug
|
||||
|
||||
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
||||
{
|
||||
if (itemInfo.MyContent.ContentPartCount > 0)
|
||||
{
|
||||
@@ -1890,10 +1915,44 @@ namespace VEPROMS.CSLA.Library
|
||||
foreach (ItemInfo itemInfo in partInfo.MyItems)
|
||||
itemInfo.SpinThroughChildren();
|
||||
}
|
||||
#endregion
|
||||
#region LoadAtOnce
|
||||
// Method to Get Item and children
|
||||
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
private static DataTable Data_GetItemsWithChangedROs(int docversionid, int origfstid, int newfstid)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getItemsWithNewROs";
|
||||
cm.Parameters.AddWithValue("@VersionID", docversionid);
|
||||
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
|
||||
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
|
||||
using (SqlDataAdapter da = new SqlDataAdapter(cm))
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
da.Fill(dt);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
|
||||
throw new DbCslaException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region LoadAtOnce
|
||||
// Method to Get Item and children
|
||||
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user