Merge branch 'Development' into C2025-024
This commit is contained in:
@@ -8335,6 +8335,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (_ProcedureConfig == null)
|
||||
{
|
||||
_ProcedureConfig = new ProcedureConfig(this);
|
||||
this.MyContent.Changed -= new ContentInfoEvent(MyContent_Changed);
|
||||
this.MyContent.Changed += new ContentInfoEvent(MyContent_Changed);
|
||||
}
|
||||
return _ProcedureConfig;
|
||||
@@ -8344,6 +8345,7 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
void MyContent_Changed(object sender)
|
||||
{
|
||||
this.MyContent.Changed -= new ContentInfoEvent(MyContent_Changed);
|
||||
this.MyContent.Changed += new ContentInfoEvent(MyContent_Changed);
|
||||
}
|
||||
#endregion
|
||||
|
175
PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs
Normal file
175
PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs
Normal file
@@ -0,0 +1,175 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Text.RegularExpressions;
|
||||
using Csla;
|
||||
using Csla.Data;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.ComponentModel;
|
||||
|
||||
|
||||
//namespace VEPROMS.CSLA.Library;
|
||||
|
||||
// C2025-027 this new file is used to support (data retrival) for selecting Annotation types to display on the Annotation screen. This is related to Annotation type filtering through V->Options.
|
||||
|
||||
namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public class AnnotationstypeSelections
|
||||
{
|
||||
public static DataTable Get(string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getAnnotationstypeFiltered";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@UsrID", UserID);
|
||||
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
SqlDataReader reader = cm.ExecuteReader();
|
||||
DataTable dt = new DataTable();
|
||||
dt.Load(reader);
|
||||
// if the user has not created a annotation sub-set list saved to AnnotationTypeSelections table.
|
||||
if (dt.Rows.Count < 1)
|
||||
{
|
||||
DataRow row;
|
||||
int rowflg = 0;
|
||||
foreach (AnnotationTypeInfo annosel in DataPortal.Fetch<AnnotationTypeInfoList>())
|
||||
{
|
||||
// C2025-027 need to use a datatable instead of AnnotationTypeInfoList so the global search Annotations will not be effected by the Annotation select list selections
|
||||
if (rowflg == 0)
|
||||
{
|
||||
row = dt.NewRow();
|
||||
dt.Rows.Add(row);
|
||||
rowflg = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
row = dt.NewRow();
|
||||
row["TypeID"] = annosel.TypeID;
|
||||
row["Name"] = annosel.Name;
|
||||
row["Config"] = annosel.Config;
|
||||
row["DTS"] = annosel.DTS;
|
||||
row["UserID"] = annosel.UserID;
|
||||
row["IsEPAnnotationType"] = annosel.IsEPAnnotationType;
|
||||
dt.Rows.Add(row);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
return dt;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//B2025-004
|
||||
//if it fails loading previously open tabs, simply treat it as if no tabs were open
|
||||
//instead of crashing
|
||||
return new DataTable();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public static DataTable Retrieve(string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getAnnotationstypeSelections";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@UsrID", UserID);
|
||||
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
SqlDataReader reader = cm.ExecuteReader();
|
||||
DataTable dt = new DataTable();
|
||||
dt.Load(reader);
|
||||
|
||||
return dt;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//B2025-004
|
||||
//if it fails loading previously open tabs, simply treat it as if no tabs were open
|
||||
//instead of crashing
|
||||
return new DataTable();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public static DataTable GetAnnoTypes(string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getAnnotationSelectListTypes";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
SqlDataReader reader = cm.ExecuteReader();
|
||||
DataTable dt = new DataTable();
|
||||
dt.Load(reader);
|
||||
|
||||
return dt;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//B2025-004
|
||||
//if it fails loading previously open tabs, simply treat it as if no tabs were open
|
||||
//instead of crashing
|
||||
return new DataTable();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Update(DataTable dt, string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "UpdateAnnotationstypeSelections";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
|
||||
//Pass table Valued parameter to Store Procedure
|
||||
SqlParameter sqlParam = cm.Parameters.AddWithValue("@TempTable", dt);
|
||||
sqlParam.SqlDbType = SqlDbType.Structured;
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error in UpdateAnnotationstypeSelections: update failed", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -386,12 +386,19 @@ namespace VEPROMS.CSLA.Library
|
||||
ItemInfo myItemInfo = o as ItemInfo;
|
||||
if (myItemInfo != null)
|
||||
{
|
||||
myItemInfo.Deleted -= new ItemInfoEvent(myItemInfo_Deleted);
|
||||
myItemInfo.Deleted += new ItemInfoEvent(myItemInfo_Deleted);
|
||||
myItemInfo.ChildrenDeleted -= new ItemInfoEvent(myItemInfo_ChildrenDeleted);
|
||||
myItemInfo.ChildrenDeleted += new ItemInfoEvent(myItemInfo_ChildrenDeleted);
|
||||
myItemInfo.MyContent.Changed -= new ContentInfoEvent(NodeText_Changed);
|
||||
myItemInfo.MyContent.Changed += new ContentInfoEvent(NodeText_Changed);
|
||||
myItemInfo.OrdinalChanged -= new ItemInfoEvent(NodeText_Changed);
|
||||
myItemInfo.OrdinalChanged += new ItemInfoEvent(NodeText_Changed);
|
||||
myItemInfo.NewSiblingAfter -= new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter);
|
||||
myItemInfo.NewSiblingAfter += new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter);
|
||||
myItemInfo.NewSiblingBefore -= new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore);
|
||||
myItemInfo.NewSiblingBefore += new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore);
|
||||
myItemInfo.NewChild -= new ItemInfoInsertEvent(myItemInfo_NewChild);
|
||||
myItemInfo.NewChild += new ItemInfoInsertEvent(myItemInfo_NewChild);
|
||||
}
|
||||
}
|
||||
@@ -429,12 +436,19 @@ namespace VEPROMS.CSLA.Library
|
||||
ItemInfo myItemInfo = o as ItemInfo;
|
||||
if (myItemInfo != null)
|
||||
{
|
||||
myItemInfo.Deleted -= new ItemInfoEvent(myItemInfo_Deleted);
|
||||
myItemInfo.Deleted += new ItemInfoEvent(myItemInfo_Deleted);
|
||||
myItemInfo.ChildrenDeleted -= new ItemInfoEvent(myItemInfo_ChildrenDeleted);
|
||||
myItemInfo.ChildrenDeleted += new ItemInfoEvent(myItemInfo_ChildrenDeleted);
|
||||
myItemInfo.MyContent.Changed -= new ContentInfoEvent(NodeText_Changed);
|
||||
myItemInfo.MyContent.Changed += new ContentInfoEvent(NodeText_Changed);
|
||||
myItemInfo.OrdinalChanged -= new ItemInfoEvent(NodeText_Changed);
|
||||
myItemInfo.OrdinalChanged += new ItemInfoEvent(NodeText_Changed);
|
||||
myItemInfo.NewSiblingAfter -= new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter);
|
||||
myItemInfo.NewSiblingAfter += new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter);
|
||||
myItemInfo.NewSiblingBefore -= new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore);
|
||||
myItemInfo.NewSiblingBefore += new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore);
|
||||
myItemInfo.NewChild -= new ItemInfoInsertEvent(myItemInfo_NewChild);
|
||||
myItemInfo.NewChild += new ItemInfoInsertEvent(myItemInfo_NewChild);
|
||||
}
|
||||
}
|
||||
|
@@ -387,6 +387,7 @@
|
||||
<Compile Include="Generated\ZContentInfo.cs" />
|
||||
<Compile Include="Generated\ZTransition.cs" />
|
||||
<Compile Include="Generated\ZTransitionInfo.cs" />
|
||||
<Compile Include="Minimal\AnnotationstypeSections.cs" />
|
||||
<Compile Include="Minimal\UserSettings.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="VEObjects\VEDrillDown.cs" />
|
||||
|
Reference in New Issue
Block a user