Compare commits
25 Commits
C2020-049-
...
F2024-074-
Author | SHA1 | Date | |
---|---|---|---|
b47f9b2606 | |||
2b5becfa34 | |||
ce02c3e4bd | |||
2ab1856b13 | |||
027a9dc729 | |||
b071db8f60 | |||
98d6557cd2 | |||
ebd7b1249f | |||
1b6eeaf4ad | |||
1d3dac0e51 | |||
48da58b681 | |||
68639eadf0 | |||
dc77984c10 | |||
5b4e1cd694 | |||
3fbd974fa9 | |||
b457496297 | |||
dd83491169 | |||
a73a8fb993 | |||
fb7a99653d | |||
297d75a2b3 | |||
47c5bb159a | |||
610b2d178c | |||
bb45e551a3 | |||
77cf6177dc | |||
a830856df2 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -23,8 +23,8 @@ using System.Runtime.CompilerServices;
|
||||
// Build YYMM (two digit year, two digit month)
|
||||
// Revision DHH (day - no leading zero, two digit hour - military time
|
||||
//
|
||||
[assembly: AssemblyVersion("2.3.2404.1611")]
|
||||
[assembly: AssemblyFileVersion("2.3.2404.1611")]
|
||||
[assembly: AssemblyVersion("2.3.2410.815")]
|
||||
[assembly: AssemblyFileVersion("2.3.2410.815")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
@@ -92,5 +92,6 @@ using System.Runtime.CompilerServices;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -100,6 +100,7 @@ using System.Text;
|
||||
using RODBInterface;
|
||||
using ROFields;
|
||||
using VlnStatus;
|
||||
using System.Linq;
|
||||
|
||||
namespace ROEditor
|
||||
{
|
||||
@@ -245,6 +246,37 @@ namespace ROEditor
|
||||
return CvtFldToUserFld(origGroup);
|
||||
}
|
||||
}
|
||||
|
||||
//CSM C2024-023
|
||||
//Part of 2024 PROMS Upgrades
|
||||
//When the Overall Form is activated
|
||||
//if there are any items that are Fields that are in use
|
||||
//add them as auto-complete options to the
|
||||
//Accessory Page Access - Value Textbox
|
||||
//Typing < will bring up the auto-complete options
|
||||
protected void tbValue_AddAutoComplete(object sender, EventArgs e)
|
||||
{
|
||||
string dummy = ""; // need for RODB_GetFIeldsInUse call, won't be used.
|
||||
ArrayList AvailList, InUseList;
|
||||
//first see if it is a valid 'InUse' Field.
|
||||
AvailList = myrodb.RODB_GetFields(elem, (uint)RecordType.Schema);
|
||||
InUseList = myrodb.RODB_GetFieldsInUse(elem, AvailList, "FieldsInUse", ref dummy, false);
|
||||
|
||||
//if any ROField items are in use,
|
||||
//use LINQ to get a string array of the FieldNames
|
||||
if (InUseList.Count > 0)
|
||||
{
|
||||
string[] InUseListFieldNames = InUseList.OfType<ROField>().Select(x => $"<{x.GetFieldname}>").ToArray();
|
||||
AutoCompleteStringCollection allowedTypes = new AutoCompleteStringCollection();
|
||||
allowedTypes.AddRange(InUseListFieldNames);
|
||||
tbValue.AutoCompleteCustomSource = allowedTypes;
|
||||
tbValue.AutoCompleteMode = AutoCompleteMode.Suggest;
|
||||
tbValue.AutoCompleteSource = AutoCompleteSource.CustomSource;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void FillInData()
|
||||
{
|
||||
this.tbGroup.Text = DetermineGroupName();
|
||||
@@ -432,6 +464,7 @@ namespace ROEditor
|
||||
this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
|
||||
this.Name = "GroupDefFrm";
|
||||
this.Text = "Group Definition";
|
||||
this.Activated += new EventHandler(tbValue_AddAutoComplete);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1670,16 +1670,38 @@ namespace VEPROMS
|
||||
return;
|
||||
}
|
||||
|
||||
string stk = Volian.Base.Library.vlnStackTrace.StackToString();
|
||||
string stk = Volian.Base.Library.vlnStackTrace.StackToString();
|
||||
|
||||
if (!stk.Contains("Exception"))
|
||||
{
|
||||
// B2018-091 Allow PROMS to close if only MSWord sections have been opened.
|
||||
// B2019-071 we will now close one or all of the tabs (even step editor ones)
|
||||
if (_WeAreExitingPROMS)
|
||||
{
|
||||
string DisplayTabID = "";
|
||||
int pos;
|
||||
int TabItemID;
|
||||
string DisplayTabName = "";
|
||||
int cnt = 0;
|
||||
// Deactivate previous procedure tab state by user
|
||||
VEPROMS.CSLA.Library.Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
|
||||
// Save current procedure tab state
|
||||
foreach (KeyValuePair<string, DisplayTabItem> pgTab in tc._MyDisplayTabItems)
|
||||
{
|
||||
cnt++;
|
||||
DisplayTabID = pgTab.Key;
|
||||
TabItemID = Int32.Parse(DisplayTabID.Substring(DisplayTabID.IndexOf("Item - ") + 7));
|
||||
DisplayTabName = pgTab.Value.ToString();
|
||||
//tc.SelectedDisplayTabItem.MyStepTabPanel.ToString()
|
||||
VEPROMS.CSLA.Library.Item.AddDisplayTabsState(TabItemID, DisplayTabID, DisplayTabName, MySessionInfo.UserID, cnt);
|
||||
}
|
||||
}
|
||||
|
||||
int n = tc._MyDisplayTabItems.Count;
|
||||
|
||||
while (n-- > 0 && tc._MyDisplayTabItems.Count > 0)
|
||||
{
|
||||
|
||||
tc.CloseTabItem(tc.SelectedDisplayTabItem);
|
||||
|
||||
// B2019-071 close just the current tab and continue working
|
||||
@@ -2320,6 +2342,27 @@ namespace VEPROMS
|
||||
CurrentID = txtSearch.Text;
|
||||
}
|
||||
}
|
||||
|
||||
// Add retrieve displaytabs state here.
|
||||
openDisplaytabstate();
|
||||
}
|
||||
|
||||
public void openDisplaytabstate()
|
||||
{
|
||||
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
|
||||
|
||||
if (DisPlayTabState.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow TabState in DisPlayTabState.Rows)
|
||||
{
|
||||
int _ItemID = (int)TabState["ItemID"];
|
||||
//ItemInfoList _Procedures = ItemInfoList.GetList(_ItemID, (int)E_FromType.Procedure));
|
||||
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
|
||||
//ItemInfo.Get
|
||||
//ItemInfo.Get
|
||||
OpenItem(_Procedure);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)
|
||||
|
@@ -8004,6 +8004,171 @@ namespace VEPROMS.CSLA.Library
|
||||
MyContent.Config = _ProcedureConfig.ToString();
|
||||
}
|
||||
#endregion
|
||||
public class DisplayTabs
|
||||
{
|
||||
private int _ItemID;
|
||||
public int ItemID
|
||||
{
|
||||
get { return _ItemID; }
|
||||
set { _ItemID = value; }
|
||||
|
||||
}
|
||||
private string _DisplayTabID;
|
||||
public string DisplayTabID
|
||||
{
|
||||
get { return _DisplayTabID; }
|
||||
set { _DisplayTabID = value; }
|
||||
}
|
||||
private string _DisplayTabName;
|
||||
public string DisplayTabName
|
||||
{
|
||||
get { return _DisplayTabName; }
|
||||
set { _DisplayTabName = value; }
|
||||
}
|
||||
|
||||
public SafeDataReader Dr { get; }
|
||||
|
||||
public DisplayTabs()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DisplayTabs(int itemID, String displayTabID, String displayTabName)
|
||||
{
|
||||
_ItemID = itemID;
|
||||
_DisplayTabID = displayTabID;
|
||||
_DisplayTabName = displayTabName;
|
||||
}
|
||||
|
||||
public DisplayTabs(SafeDataReader dr)
|
||||
{
|
||||
Dr = dr;
|
||||
}
|
||||
}
|
||||
public static DataTable GetDisplayTabs(int itemID) //, string displayTabID, string displayTabName)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable tmp = DataPortal.Fetch<DataTable>(new DisplayTabs(itemID, "", "")); //, displayTabID, displayTabName));
|
||||
//ItemInfo.AddList(tmp);
|
||||
//tmp.AddEvents();
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
|
||||
}
|
||||
}
|
||||
private DataTable dt = new DataTable();
|
||||
private DataTable DataPortal_Fetch(DisplayTabs criteria)
|
||||
{
|
||||
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "GetDisplayTabData";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
da.Fill(dt);
|
||||
cn.Close();
|
||||
da.Dispose();
|
||||
return dt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
|
||||
throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// //DisplayTabs tmp =
|
||||
// DataPortal.Fetch<DisplayTabs>(new DisplayTabs(itemID, displayTabID, displayTabName)); //, displayTabID, displayTabName));
|
||||
// //ItemInfo.AddList(tmp);
|
||||
// //tmp.AddEvents();
|
||||
// //return tmp;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
|
||||
// }
|
||||
//}
|
||||
//private DataTable dt = new DataTable();
|
||||
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||
//{
|
||||
|
||||
// using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
// {
|
||||
// using (SqlCommand cm = cn.CreateCommand())
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// cm.CommandType = CommandType.StoredProcedure;
|
||||
// cm.CommandText = "AddDisplayTabState";
|
||||
// cm.CommandTimeout = Database.DefaultTimeout;
|
||||
// cm.Parameters.AddWithValue("@ItemID", ItemID);
|
||||
// cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||
// cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||
// cm.ExecuteNonQuery();
|
||||
// //SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
// //da.Fill(dt);
|
||||
// //cn.Close();
|
||||
// //da.Dispose();
|
||||
// //return dt; // fix
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
|
||||
// throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
|
||||
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||
{
|
||||
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "AddDisplayTabState";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||
cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||
cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||
cm.ExecuteNonQuery();
|
||||
//SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
//da.Fill(dt);
|
||||
//cn.Close();
|
||||
//da.Dispose();
|
||||
//return dt; // fix
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.AddDisplayTabsState", ex);
|
||||
throw new DbCslaException("ItemExt.AddDisplayTabsState", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region SectionInfo
|
||||
|
@@ -1876,6 +1876,10 @@ namespace VEPROMS.CSLA.Library
|
||||
if (IsCaution) enhType = 20006;
|
||||
return enhType;
|
||||
}
|
||||
|
||||
// B2024-075: Paste Before/After with Enhanced Documents is creating situation
|
||||
//where Background item is linked to Source but Source is not linked to Background
|
||||
//When Fixing the linking, need to not create a duplicate link if one already exists
|
||||
public void DoCreateLinksEnhancedSingleItem(ItemInfo enhii, int enhtype)
|
||||
{
|
||||
// Link the 2 items, srcII & enhii:
|
||||
@@ -1893,12 +1897,15 @@ namespace VEPROMS.CSLA.Library
|
||||
using (Item ei = Item.Get(enhii.ItemID))
|
||||
{
|
||||
StepConfig sc = enhii.MyConfig as StepConfig;
|
||||
sc.AddEnhancedDocument(0, this.ItemID);
|
||||
sc.SaveEnhancedDocuments();
|
||||
ei.MyContent.Text = DisplayText;
|
||||
ei.MyContent.Config = sc.ToString();
|
||||
ei.Save();
|
||||
enhii.RefreshConfig();
|
||||
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||
{
|
||||
sc.AddEnhancedDocument(0, this.ItemID);
|
||||
sc.SaveEnhancedDocuments();
|
||||
ei.MyContent.Text = DisplayText;
|
||||
ei.MyContent.Config = sc.ToString();
|
||||
ei.Save();
|
||||
enhii.RefreshConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (IsSection)
|
||||
@@ -1916,12 +1923,15 @@ namespace VEPROMS.CSLA.Library
|
||||
using (Item ei = Item.Get(enhii.ItemID))
|
||||
{
|
||||
SectionConfig sc = enhii.MyConfig as SectionConfig;
|
||||
sc.AddEnhancedDocument(0, this.ItemID);
|
||||
sc.SaveEnhancedDocuments();
|
||||
ei.MyContent.Text = DisplayText;
|
||||
ei.MyContent.Config = sc.ToString();
|
||||
ei.Save();
|
||||
enhii.RefreshConfig();
|
||||
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||
{
|
||||
sc.AddEnhancedDocument(0, this.ItemID);
|
||||
sc.SaveEnhancedDocuments();
|
||||
ei.MyContent.Text = DisplayText;
|
||||
ei.MyContent.Config = sc.ToString();
|
||||
ei.Save();
|
||||
enhii.RefreshConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (IsProcedure)
|
||||
@@ -1942,16 +1952,66 @@ namespace VEPROMS.CSLA.Library
|
||||
using (Item ii = this.Get())
|
||||
{
|
||||
ProcedureConfig sc = this.MyConfig as ProcedureConfig;
|
||||
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
||||
sc.SaveEnhancedDocuments();
|
||||
ii.MyContent.Config = sc.ToString();
|
||||
ii.Save();
|
||||
RefreshConfig();
|
||||
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||
{
|
||||
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
||||
sc.SaveEnhancedDocuments();
|
||||
ii.MyContent.Config = sc.ToString();
|
||||
ii.Save();
|
||||
RefreshConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DataPortal
|
||||
// C2017-031: Support for paste/replace an enhanced step
|
||||
private void DataPortal_Fetch(PastingPartEnhancedCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
Csla.ApplicationContext.LocalContext["cn"] = cn;
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.Parameters.AddWithValue("@StartItemID", criteria.StartItemID); // copy children
|
||||
cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); //copy to
|
||||
cm.Parameters.AddWithValue("@Type", criteria.Type);
|
||||
cm.Parameters.AddWithValue("@DTS", criteria.DTS);
|
||||
cm.Parameters.AddWithValue("@UserID", criteria.UserID);
|
||||
SqlParameter param_ContentID = new SqlParameter("@NewItemID", SqlDbType.Int);
|
||||
param_ContentID.Direction = ParameterDirection.Output;
|
||||
cm.Parameters.Add(param_ContentID);
|
||||
cm.CommandText = "PasteItemEnhancedReplace";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
if (!dr.Read())
|
||||
{
|
||||
_ErrorMessage = "No Record Found";
|
||||
return;
|
||||
}
|
||||
ReadData(dr);
|
||||
}
|
||||
}
|
||||
// removing of item only needed for local data portal
|
||||
if (Csla.ApplicationContext.ExecutionLocation == Csla.ApplicationContext.ExecutionLocations.Client)
|
||||
Csla.ApplicationContext.LocalContext.Remove("cn");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (!ex.Message.Contains("This step has been deleted") && !ex.Message.Contains("This current step has been deleted in another session"))
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex);
|
||||
}
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(PastingPartCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode());
|
||||
@@ -2073,9 +2133,72 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region PastingPartEnhancedCriteria
|
||||
// C2017-031: Support for paste/replace an enhanced step
|
||||
[Serializable()]
|
||||
public class PastingPartEnhancedCriteria
|
||||
{
|
||||
#region Properties
|
||||
private int _StartItemID;
|
||||
public int StartItemID
|
||||
{
|
||||
get { return _StartItemID; }
|
||||
set { _StartItemID = value; }
|
||||
}
|
||||
private int _ItemID; // paste relative to this itemid
|
||||
public int ItemID
|
||||
{
|
||||
get { return _ItemID; }
|
||||
set { _ItemID = value; }
|
||||
}
|
||||
private EAddpingPart _AddType;
|
||||
public EAddpingPart AddType
|
||||
{
|
||||
get { return _AddType; }
|
||||
set { _AddType = value; }
|
||||
}
|
||||
private int? _FromType = null;
|
||||
public int? FromType
|
||||
{
|
||||
get { return _FromType; }
|
||||
set { _FromType = value; }
|
||||
}
|
||||
private int? _Type = null;
|
||||
public int? Type
|
||||
{
|
||||
get { return _Type; }
|
||||
set { _Type = value; }
|
||||
}
|
||||
private DateTime _DTS;
|
||||
public DateTime DTS
|
||||
{
|
||||
get { return _DTS; }
|
||||
set { _DTS = value; }
|
||||
}
|
||||
private string _UserID;
|
||||
public string UserID
|
||||
{
|
||||
get { return _UserID; }
|
||||
set { _UserID = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Constructor
|
||||
public PastingPartEnhancedCriteria(int startItemid, int itemID, EAddpingPart addType, int? type, int? fromType, DateTime dts, string userID)
|
||||
{
|
||||
_StartItemID = startItemid;
|
||||
_ItemID = itemID;
|
||||
_AddType = addType;
|
||||
_Type = type;
|
||||
_FromType = fromType;
|
||||
_DTS = dts;
|
||||
_UserID = userID;
|
||||
}
|
||||
#endregion
|
||||
#region PastingPartCriteria
|
||||
[Serializable()]
|
||||
}
|
||||
#endregion
|
||||
#region PastingPartCriteria
|
||||
[Serializable()]
|
||||
public class PastingPartCriteria
|
||||
{
|
||||
#region Properties
|
||||
@@ -2364,6 +2487,14 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyPrevious = null; // Reset list so that the next line gets a new list
|
||||
if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value
|
||||
}
|
||||
// C2017-031: Support for paste/replace an enhanced step
|
||||
internal static ItemInfo CopyPasteReplaceEnhancedItemInfoFetch(int copyStartID, ItemInfo itemInfo)
|
||||
{
|
||||
ItemInfo tmp = null;
|
||||
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);
|
||||
return tmp;
|
||||
}
|
||||
internal static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
||||
{
|
||||
ItemInfo tmp = null;
|
||||
@@ -2525,8 +2656,16 @@ namespace VEPROMS.CSLA.Library
|
||||
ItemInfo newItemInfo = null;
|
||||
try
|
||||
{
|
||||
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type);
|
||||
if (newItemInfo == null) return null;
|
||||
// C2017-031: Support for paste/replace an enhanced step, if this is replacing enhanced, do a specific query
|
||||
if (itemInfo.IsEnhancedStep)
|
||||
{
|
||||
newItemInfo = ItemInfo.CopyPasteReplaceEnhancedItemInfoFetch(copyStartID, itemInfo);
|
||||
if (newItemInfo == null) return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); if (newItemInfo == null) return null;
|
||||
}
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
|
@@ -1132,6 +1132,91 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("Item.Add", ex);
|
||||
}
|
||||
}
|
||||
public static void DeactivateStateDisplayTabTmp(string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "DeactivateStateDisplayTabTmp";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
throw new DbCslaException("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName, string UserID, int order)
|
||||
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "AddDisplayTabState";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||
cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||
cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
cm.Parameters.AddWithValue("@order", order);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.AddDisplayTabsState", ex);
|
||||
throw new DbCslaException("ItemExt.AddDisplayTabsState", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static DataTable GetDisplayTabs(string UserID) //, string displayTabID, string displayTabName)
|
||||
//public static void DeactivateStateDisplayTabTmp(string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "GetDisplayTabdata";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
//cm.ExecuteNonQuery();
|
||||
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
//da.Fill(dt);
|
||||
//cn.Close();
|
||||
//da.Dispose();
|
||||
//return dt; // fix
|
||||
|
||||
SqlDataReader reader = cm.ExecuteReader();
|
||||
DataTable dt = new DataTable();
|
||||
dt.Load(reader);
|
||||
return dt;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
throw new DbCslaException("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
protected override void DataPortal_Update()
|
||||
{
|
||||
|
@@ -9,6 +9,7 @@ using System.Text.RegularExpressions;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using System.Linq;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -893,6 +894,18 @@ namespace Volian.Controls.Library
|
||||
b4topadjust -= newFocus.Top;
|
||||
TopMostYBefore -= b4topadjust;
|
||||
|
||||
//B2024-075: If Deleting an item in a Source Document that is unlinked
|
||||
//and the overall procedure has connected Background Documents
|
||||
//and a window is open containing the background documents
|
||||
//then need to force a refresh on that window as
|
||||
//step numbering will shift
|
||||
EnhancedDocuments ProcEnh = MyItemInfo.MyProcedure.GetMyEnhancedDocuments();
|
||||
if (ProcEnh.Count > 0)
|
||||
{
|
||||
DisplayTabItem wndowToRefresh = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyBar.Items.Cast<DisplayTabItem>().FirstOrDefault(x => x.MyKey == $"Item - {ProcEnh[0].ItemID}");
|
||||
wndowToRefresh?.MyStepTabPanel.MyStepPanel.Reset(wndowToRefresh.MyItemInfo);
|
||||
}
|
||||
|
||||
//_MyTimer.ActiveProcess = "Dispose";
|
||||
Dispose();
|
||||
//_MyTimer.ActiveProcess = "SetAllTabs";
|
||||
@@ -1634,10 +1647,54 @@ namespace Volian.Controls.Library
|
||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Before, newItemInfo.MyContent.Type));
|
||||
|
||||
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||
ItemInfo newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Before, GetChangeId(MyItemInfo));
|
||||
//if doing a paste before/after and item being copied is unlinked, item pasted should also be unlinked.
|
||||
ItemInfo tmpCopyStartSourceItem = ItemInfo.Get(copyStartID);
|
||||
ItemInfo newEnh = null;
|
||||
if (tmpCopyStartSourceItem.GetMyEnhancedDocuments().Count > 0)
|
||||
{
|
||||
newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Before, GetChangeId(MyItemInfo));
|
||||
}
|
||||
|
||||
//B2024-075: When doing Paste Before / After with Enhanced Documents only link from Background document to source was created
|
||||
//since source is done first
|
||||
//this is so that after the steps are created in the enhanced, go back and update the link in the source to point to the correct item
|
||||
if (newEditItem != null && newEnh != null)
|
||||
{
|
||||
FixEnhanceLinkOnSource(newEditItem.MyItemInfo, newEnh, MyItemInfo.GetMyEnhancedDocuments());
|
||||
}
|
||||
else if (newEnh == null && newEditItem != null && newEditItem.MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
UnlinkEnhanced(newEditItem);
|
||||
}
|
||||
else if (newEnh == null && newEditItem != null)
|
||||
{
|
||||
//if did a paste before/after in a source document that contains enhanced steps
|
||||
//but step being pasted was non-enhanced (unlinked)
|
||||
//then look to see if the background page is open
|
||||
//and if it is, do a refresh so that step numbers update appropriately
|
||||
//without having to close and re-open the background steps
|
||||
foreach (EnhancedDocument edSource in MyItemInfo.GetMyEnhancedDocuments())
|
||||
{
|
||||
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||
DisplayTabItem wndowToRefresh = newEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyBar.Items.Cast<DisplayTabItem>().FirstOrDefault(x => x.MyKey == $"Item - {exEnh.MyProcedure.ItemID}");
|
||||
wndowToRefresh?.MyStepTabPanel.MyStepPanel.Reset(wndowToRefresh.MyItemInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// if enhanced items were created, then see if they need displayed:
|
||||
if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo);
|
||||
}
|
||||
|
||||
//B2024-075: When doing Paste Before / After with Enhanced Documents only link from Background document to source was created
|
||||
//since source is done first
|
||||
//this is so that after the steps are created in the enhanced, go back and update the link in the source to point to the correct item
|
||||
//if enhanced document wasn't created then paste happened inside a enhanced Step/background step - so remove any links that shouldn't be there
|
||||
//and don't have a corresponding spot in the Source
|
||||
private void FixEnhanceLinkOnSource(ItemInfo SourceItem, ItemInfo newEnhItem, EnhancedDocuments enhancedDocuments)
|
||||
{
|
||||
if (enhancedDocuments.Count > 0)
|
||||
CreateLinksEnhancedSingleItem(SourceItem, newEnhItem, enhancedDocuments[0].Type);
|
||||
}
|
||||
private void AddAllEnhancedItemsToDisplay(ItemInfo newItemInfo)
|
||||
{
|
||||
EnhancedDocuments eds = newItemInfo.GetMyEnhancedDocuments();
|
||||
@@ -1684,12 +1741,15 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
public void UnlinkEnhanced(ItemInfo enhII)
|
||||
public void UnlinkEnhanced(EditItem enhII)
|
||||
{
|
||||
// B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced
|
||||
// Pass in to unlink as before this change
|
||||
enhII.DoUnlinkEnhanced(enhII, 0, false);
|
||||
// B2024 - 075: Change made to pass in an EditTem instead of a ItemInfo
|
||||
//so can refresh the UI
|
||||
enhII.MyItemInfo.DoUnlinkEnhanced(enhII.MyItemInfo, 0, false);
|
||||
SetFocus();
|
||||
enhII.MyStepPanel.Reset(enhII.MyItemInfo); //need to reset parts so refreshes display to show as unlinked
|
||||
}
|
||||
public ItemInfo AddMissingEnhancedStep(ItemInfo ii, int EnhType)
|
||||
{
|
||||
@@ -1753,7 +1813,42 @@ namespace Volian.Controls.Library
|
||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.After, newItemInfo.MyContent.Type));
|
||||
|
||||
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||
ItemInfo newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.After, GetChangeId(MyItemInfo));
|
||||
//if doing a paste before/after and item being copied is unlinked, item pasted should also be unlinked.
|
||||
ItemInfo tmpCopyStartSourceItem = ItemInfo.Get(copyStartID);
|
||||
ItemInfo newEnh = null;
|
||||
if (tmpCopyStartSourceItem.GetMyEnhancedDocuments().Count > 0)
|
||||
{
|
||||
newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.After, GetChangeId(MyItemInfo));
|
||||
}
|
||||
|
||||
//B2024-075: When doing Paste Before / After with Enhanced Documents only link from Background document to source was created
|
||||
//since source is done first
|
||||
//this is so that after the steps are created in the enhanced, go back and update the link in the source to point to the correct item
|
||||
//if enhanced document wasn't created then paste happened inside a enhanced Step/background step - so remove any links that shouldn't be there
|
||||
//and don't have a cooresponding spot in the Source
|
||||
if (newEditItem != null && newEnh != null)
|
||||
{
|
||||
FixEnhanceLinkOnSource(newEditItem.MyItemInfo, newEnh, MyItemInfo.GetMyEnhancedDocuments());
|
||||
}
|
||||
else if (newEnh == null && newEditItem != null && newEditItem.MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
UnlinkEnhanced(newEditItem);
|
||||
}
|
||||
else if (newEnh == null && newEditItem != null)
|
||||
{
|
||||
//if did a paste before/after in a source document that contains enhanced steps
|
||||
//but step being pasted was non-enhanced (unlinked)
|
||||
//then look to see if the background page is open
|
||||
//and if it is, do a refresh so that step numbers update appropriately
|
||||
//without having to close and re-open the background steps
|
||||
foreach (EnhancedDocument edSource in MyItemInfo.GetMyEnhancedDocuments())
|
||||
{
|
||||
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||
DisplayTabItem wndowToRefresh = newEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyBar.Items.Cast<DisplayTabItem>().FirstOrDefault(x => x.MyKey == $"Item - {exEnh.MyProcedure.ItemID}");
|
||||
wndowToRefresh?.MyStepTabPanel.MyStepPanel.Reset(wndowToRefresh.MyItemInfo);
|
||||
}
|
||||
}
|
||||
|
||||
if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo);
|
||||
}
|
||||
public void PasteChild(int copyStartID)
|
||||
@@ -1944,7 +2039,8 @@ namespace Volian.Controls.Library
|
||||
sia.IdentifyChildren(highlight);
|
||||
}
|
||||
}
|
||||
if (MyBeforeEditItems != null)
|
||||
// C2017-031: Support for paste/replace an enhanced step: don't identify/copy before items, i.e. notes/cautions
|
||||
if (MyBeforeEditItems != null && !MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
foreach (EditItem sib in MyBeforeEditItems)
|
||||
{
|
||||
|
BIN
PROMS/Volian.Controls.Library/RTBItem.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/RTBItem.designer.cs
generated
Binary file not shown.
@@ -1231,7 +1231,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
public ItemSelectedChangedEventArgs(EditItem myEditItem)
|
||||
{
|
||||
_MyItemInfo = myEditItem.MyItemInfo;
|
||||
_MyItemInfo = myEditItem?.MyItemInfo;
|
||||
_MyEditItem = myEditItem;
|
||||
}
|
||||
}
|
||||
|
@@ -485,6 +485,8 @@ namespace Volian.Controls.Library
|
||||
public void RefreshDisplay(bool activeMode)
|
||||
{
|
||||
if (IsExperimenting) return;
|
||||
if (IsDisposed) return;
|
||||
|
||||
ActiveMode = activeMode;
|
||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 2");
|
||||
|
@@ -337,8 +337,10 @@ namespace Volian.Controls.Library
|
||||
else if (btn.Name.Contains("Unlink"))
|
||||
{
|
||||
// C2019=003: add a confirmation dialog before unlinking a step:
|
||||
// B2024 - 075: Change made to pass in an EditTem instead of a ItemInfo
|
||||
//so can refresh the UI
|
||||
if (FlexibleMessageBox.Show(this, "Do you want to unlink this step?", "Confirm Enhanced Step Unlink", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
MyEditItem.UnlinkEnhanced(MyEditItem.MyItemInfo);
|
||||
MyEditItem.UnlinkEnhanced(MyEditItem);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1750,7 +1752,7 @@ namespace Volian.Controls.Library
|
||||
// note in follow if statements, 'setting' == false when in enhanced document:
|
||||
if (setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked // B2018-112 and is allowed to edit
|
||||
allowDel = true; // allow delete if not linked
|
||||
btnCpyStp.Enabled = setting;
|
||||
btnCpyStp.Enabled = MyUserInfo.IsAllowedToEdit(Mydvi); // C2017-031: Support for paste/replace an enhanced step
|
||||
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
//B2020-058: crash on null reference
|
||||
@@ -1801,7 +1803,8 @@ namespace Volian.Controls.Library
|
||||
btnPasteAfter.Enabled = btnCMPasteAfter.Enabled = enable;
|
||||
//B20170-158 Don't allow a step to replace a linked step
|
||||
//B2017-180: The fix for B2017-158 also needed the 'HasEnhancedLinkedStep' to check if the copied step is a source step
|
||||
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && !MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep;
|
||||
// C2017-031: Support for paste/replace an enhanced step, enable button
|
||||
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && ((!MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep) || (MyItemInfo.IsEnhancedStep));
|
||||
}
|
||||
private void SetPasteButtonEnabled()
|
||||
{
|
||||
@@ -4110,9 +4113,19 @@ namespace Volian.Controls.Library
|
||||
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
|
||||
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, true);
|
||||
EditItem oldEditItem = MyEditItem;
|
||||
// C2017-031: Support for paste/replace an enhanced step, if pasting an enhanced, remove its EditItem from the 'cache'. A new EditItem gets created during paste.
|
||||
if (MyEditItem != null && MyEditItem.MyItemInfo.IsEnhancedStep) MyEditItem.MyStepPanel._LookupEditItems.Remove(MyEditItem.MyItemInfo.ItemID);
|
||||
MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||
if (MyEditItem == null) oldEditItem.IdentifyMe(false); // B2017-179 if null then we didn't do the replace but did position to the first transition that needs resolved
|
||||
if (MyEditItem != null && MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) oldEditItem.Dispose();
|
||||
// C2017-031: Support for paste/replace an enhanced step, add Dispose of old EditItem if enhanced
|
||||
if (MyEditItem != null && ((MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) || MyEditItem.MyItemInfo.IsEnhancedStep))
|
||||
oldEditItem.Dispose();
|
||||
// C2017-031: Support for paste/replace an enhanced step, refresh ItemInfo's in user interface caches.
|
||||
if (MyEditItem.MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
MyEditItem.MyItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||
tmp.MyStepPanel.SelectedItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPdfCreate_Click(object sender, EventArgs e)
|
||||
|
Reference in New Issue
Block a user