Fixed code so that Deletes of Procedures and Sections would no cause steps to be resequenced.
Added code to Just Get RODb and not all of it's children. Added code to create an RoImageFile (Temporary) to be used to view and print images Additional DEBUG info
This commit is contained in:
@@ -16,6 +16,10 @@ using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using Csla;
|
||||
using Csla.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
|
||||
namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
@@ -34,6 +38,80 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public partial class RODb
|
||||
{
|
||||
public static RODb GetJustRoDb(int rODbID)
|
||||
{
|
||||
if (!CanGetObject())
|
||||
throw new System.Security.SecurityException("User not authorized to view a RODb");
|
||||
try
|
||||
{
|
||||
RODb tmp = DataPortal.Fetch<RODb>(new PKCriteriaJustRoDb(rODbID));
|
||||
if (tmp.ErrorMessage == "No Record Found")
|
||||
{
|
||||
tmp.Dispose(); // Clean-up RODb
|
||||
tmp = null;
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on RODb.Get", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(PKCriteriaJustRoDb criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
ApplicationContext.LocalContext["cn"] = cn;
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getJustRODb";
|
||||
cm.Parameters.AddWithValue("@RODbID", criteria.RODbID);
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
if (!dr.Read())
|
||||
{
|
||||
_ErrorMessage = "No Record Found";
|
||||
return;
|
||||
}
|
||||
ReadData(dr);
|
||||
// Don't load child objects
|
||||
//dr.NextResult();
|
||||
//_RODbROFsts = RODbROFsts.Get(dr);
|
||||
// load child objects
|
||||
//dr.NextResult();
|
||||
//_RODbROImages = RODbROImages.Get(dr);
|
||||
// load child objects
|
||||
//dr.NextResult();
|
||||
//_RODbRoUsages = RODbRoUsages.Get(dr);
|
||||
}
|
||||
}
|
||||
// removing of item only needed for local data portal
|
||||
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
|
||||
ApplicationContext.LocalContext.Remove("cn");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.DataPortal_Fetch", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("RODb.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
[Serializable()]
|
||||
protected class PKCriteriaJustRoDb
|
||||
{
|
||||
private int _RODbID;
|
||||
public int RODbID
|
||||
{ get { return _RODbID; } }
|
||||
public PKCriteriaJustRoDb(int rODbID)
|
||||
{
|
||||
_RODbID = rODbID;
|
||||
}
|
||||
}
|
||||
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
Reference in New Issue
Block a user