
Add RoFstLookup Dicitonary Entries for Multiple Return Values AddByROFstIDImageIDs - Add a list of figures based upon a List of ImageIDs Fix regular expression to find RO Text to replace GetDROUsagesByROIDs - get a list of ROUSages for a list of ROIDs GetJustRODB - Get Just RODB object without children GetJustROFst - Get Just ROFst or ROFstInfo object without children Reduce duplicate gets of RODB and ROFst Improve ROFst Update Performance GetByRODbIDNoData - Get RoImageInfo objects without graphic data for ROFst Update comparison GetROUSagesByROIDs - Get a list of ROUSages by ROIDs. This reduces the number of ROIDs to be checked when updating ROFst. Use GetJustRoFst and GetJustRoDB to improve the performance to see if the "Update ROFst" button should be active.
78 lines
2.1 KiB
C#
78 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using Csla;
|
|
using Csla.Data;
|
|
using System.IO;
|
|
using Volian.Base.Library;
|
|
|
|
namespace VEPROMS.CSLA.Library
|
|
{
|
|
public partial class FigureInfoList
|
|
{
|
|
// GetByROFstAndImageIDs - Create any Figure records that are missing from the list
|
|
[Serializable()]
|
|
private class AddByROFstIDImageIDCriteria
|
|
{
|
|
private int _ROFstID;
|
|
public int ROFstID
|
|
{ get { return _ROFstID; } }
|
|
private string _ImagedIDs;
|
|
public string ImagedIDs
|
|
{ get { return _ImagedIDs; } }
|
|
public AddByROFstIDImageIDCriteria(int rOFstID, string imagedIDs)
|
|
{
|
|
_ROFstID = rOFstID;
|
|
_ImagedIDs = imagedIDs;
|
|
}
|
|
}
|
|
public static FigureInfoList AddByROFstIDImageIDs(int rOFstID,string imageIDs)
|
|
{
|
|
try
|
|
{
|
|
FigureInfoList tmp = DataPortal.Fetch<FigureInfoList>(new AddByROFstIDImageIDCriteria(rOFstID,imageIDs));
|
|
FigureInfo.AddList(tmp);
|
|
tmp.AddEvents();
|
|
return tmp;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new DbCslaException("Error on FigureInfoList.AddByROFstIDImageIDs", ex);
|
|
}
|
|
}
|
|
private void DataPortal_Fetch(AddByROFstIDImageIDCriteria criteria)
|
|
{
|
|
this.RaiseListChangedEvents = false;
|
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfoList.DataPortal_FetchROFstID", GetHashCode());
|
|
try
|
|
{
|
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
|
{
|
|
using (SqlCommand cm = cn.CreateCommand())
|
|
{
|
|
cm.CommandType = CommandType.StoredProcedure;
|
|
cm.CommandText = "addFiguresByROFstIDandImageIDs";
|
|
cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID);
|
|
cm.Parameters.AddWithValue("@ImageIDs", criteria.ImagedIDs);
|
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
|
{
|
|
IsReadOnly = false;
|
|
while (dr.Read()) this.Add(new FigureInfo(dr));
|
|
IsReadOnly = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfoList.DataPortal_FetchROFstID", ex);
|
|
throw new DbCslaException("FigureInfoList.DataPortal_Fetch", ex);
|
|
}
|
|
this.RaiseListChangedEvents = true;
|
|
}
|
|
|
|
}
|
|
}
|