adjust OK/Cancel button locations
Enhanced: convert 16-32 bit link data at procedure level
This commit is contained in:
@@ -1134,7 +1134,8 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Enhanced_Unlink
|
||||
#region Enhanced
|
||||
#region Enhanced_UnlinkItems
|
||||
[Serializable()]
|
||||
private class EnhancedUnlinkCriteria
|
||||
{
|
||||
@@ -1192,6 +1193,8 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("Error on ContentInfoList.DoEnhancedUnlink", ex);
|
||||
}
|
||||
}
|
||||
#endregion Enhanced_UnlinkItems
|
||||
#region Enhanced_UnlinkDocVersionAndItems
|
||||
//////
|
||||
[Serializable()]
|
||||
private class EnhancedDocVersionUnlinkCriteria
|
||||
@@ -1250,8 +1253,159 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("Error on ContentInfoList.DoEnhancedDocVersionUnlink", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion Enhanced_Unlink
|
||||
#endregion Enhanced_UnlinkDocVersionAndItems
|
||||
#region Enhanced_Convert16To32
|
||||
//////
|
||||
[Serializable()]
|
||||
private class GetEnhanced16To32ContentsCriteria
|
||||
{
|
||||
public GetEnhanced16To32ContentsCriteria(int? srcProcID, int? enhancedProcID, int enhType)
|
||||
{
|
||||
_SrcProcID = srcProcID;
|
||||
_EnhancedProcID = enhancedProcID;
|
||||
_EnhType = enhType;
|
||||
}
|
||||
private int? _SrcProcID;
|
||||
public int? SrcProcID
|
||||
{
|
||||
get { return _SrcProcID; }
|
||||
set { _SrcProcID = value; }
|
||||
}
|
||||
private int? _EnhancedProcID;
|
||||
public int? EnhancedProcID
|
||||
{
|
||||
get { return _EnhancedProcID; }
|
||||
set { _EnhancedProcID = value; }
|
||||
}
|
||||
private int? _EnhType;
|
||||
public int? EnhType
|
||||
{
|
||||
get { return _EnhType; }
|
||||
set { _EnhType = value; }
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(GetEnhanced16To32ContentsCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "vesp_Get16BitEnhancedContents";
|
||||
cm.Parameters.AddWithValue("@SourceID", criteria.SrcProcID);
|
||||
cm.Parameters.AddWithValue("@EnhanceID", criteria.EnhancedProcID);
|
||||
cm.Parameters.AddWithValue("@EnhType", criteria.EnhType);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read())
|
||||
{
|
||||
ContentInfo contentInfo = new ContentInfo(dr);
|
||||
this.Add(contentInfo);
|
||||
}
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("GetEnhanced16To32ContentsCriteria.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
public static ContentInfoList Get16BitEnhancedContents(int srcProcID, int enhProcID, int enhType)
|
||||
{
|
||||
// query returns a list of items that were found to have compatible 16bit data to set link to enhanced
|
||||
// from the input source. Caller can check if there are non-procedure items, then procedures can be
|
||||
// linked using 16bit data in the config field
|
||||
try
|
||||
{
|
||||
ContentInfoList tmp = DataPortal.Fetch<ContentInfoList>(new GetEnhanced16To32ContentsCriteria(srcProcID, enhProcID, enhType));
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on ContentInfoList.Get16BitEnhancedContents", ex);
|
||||
}
|
||||
}
|
||||
//////
|
||||
[Serializable()]
|
||||
private class ConvertEnhanced16To32ContentsCriteria
|
||||
{
|
||||
public ConvertEnhanced16To32ContentsCriteria(int? srcProcID, int? enhancedProcID, int enhType)
|
||||
{
|
||||
_SrcProcID = srcProcID;
|
||||
_EnhancedProcID = enhancedProcID;
|
||||
_EnhType = enhType;
|
||||
}
|
||||
private int? _SrcProcID;
|
||||
public int? SrcProcID
|
||||
{
|
||||
get { return _SrcProcID; }
|
||||
set { _SrcProcID = value; }
|
||||
}
|
||||
private int? _EnhancedProcID;
|
||||
public int? EnhancedProcID
|
||||
{
|
||||
get { return _EnhancedProcID; }
|
||||
set { _EnhancedProcID = value; }
|
||||
}
|
||||
private int? _EnhType;
|
||||
public int? EnhType
|
||||
{
|
||||
get { return _EnhType; }
|
||||
set { _EnhType = value; }
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(ConvertEnhanced16To32ContentsCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "vesp_Convert16to32EnhancedContents";
|
||||
cm.Parameters.AddWithValue("@SourceID", criteria.SrcProcID);
|
||||
cm.Parameters.AddWithValue("@EnhanceID", criteria.EnhancedProcID);
|
||||
cm.Parameters.AddWithValue("@EnhType", criteria.EnhType);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read())
|
||||
{
|
||||
ContentInfo contentInfo = new ContentInfo(dr);
|
||||
this.Add(contentInfo);
|
||||
}
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("ConvertEnhanced16To32ContentsCriteria.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
public static ContentInfoList Convert16To32EnhancedContents(int srcProcID, int enhProcID, int enhType)
|
||||
{
|
||||
// query links the 2 procedures (source and enhanced) setting the Enhanced type to 'enhType'
|
||||
try
|
||||
{
|
||||
ContentInfoList tmp = DataPortal.Fetch<ContentInfoList>(new ConvertEnhanced16To32ContentsCriteria(srcProcID, enhProcID, enhType));
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on ContentInfoList.Convert16To32EnhancedContents", ex);
|
||||
}
|
||||
}
|
||||
#endregion Enhanced_Convert16To32
|
||||
#endregion Enhanced
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user