C2025-022-Remove-UCF-2
This commit is contained in:
@@ -596,68 +596,68 @@ public partial class FormatInfo : IFormatOrFormatInfo
|
||||
}
|
||||
// Get format data, but do not resolve the 'Data' and 'Genmac' fields, i.e. keep empty if they are
|
||||
// empty.
|
||||
public static FormatInfo GetFormatNoUCFByFormatID(int formatID)
|
||||
{
|
||||
try
|
||||
{
|
||||
FormatInfo tmp = DataPortal.Fetch<FormatInfo>(new FormatIDNoUCFCriteria(formatID));
|
||||
if (tmp.ErrorMessage == "No Record Found")
|
||||
{
|
||||
tmp.Dispose(); // Clean-up FormatInfo
|
||||
tmp = null;
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on FormatInfo.GetFormatNoUCFByFormatID", ex);
|
||||
}
|
||||
}
|
||||
protected class FormatIDNoUCFCriteria
|
||||
{
|
||||
private int _FormatID;
|
||||
public int FormatID { get { return _FormatID; } }
|
||||
public FormatIDNoUCFCriteria(int formatID)
|
||||
{
|
||||
_FormatID = formatID;
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(FormatIDNoUCFCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfo.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 = "getFormatNoUCF";
|
||||
cm.Parameters.AddWithValue("@FormatID", criteria.FormatID);
|
||||
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 (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
|
||||
ApplicationContext.LocalContext.Remove("cn");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfo.DataPortal_Fetch", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("FormatInfo.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
//public static FormatInfo GetFormatNoUCFByFormatID(int formatID)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// FormatInfo tmp = DataPortal.Fetch<FormatInfo>(new FormatIDNoUCFCriteria(formatID));
|
||||
// if (tmp.ErrorMessage == "No Record Found")
|
||||
// {
|
||||
// tmp.Dispose(); // Clean-up FormatInfo
|
||||
// tmp = null;
|
||||
// }
|
||||
// return tmp;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// throw new DbCslaException("Error on FormatInfo.GetFormatNoUCFByFormatID", ex);
|
||||
// }
|
||||
//}
|
||||
//protected class FormatIDNoUCFCriteria
|
||||
//{
|
||||
// private int _FormatID;
|
||||
// public int FormatID { get { return _FormatID; } }
|
||||
// public FormatIDNoUCFCriteria(int formatID)
|
||||
// {
|
||||
// _FormatID = formatID;
|
||||
// }
|
||||
//}
|
||||
//private void DataPortal_Fetch(FormatIDNoUCFCriteria criteria)
|
||||
//{
|
||||
// if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfo.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 = "getFormatNoUCF";
|
||||
// cm.Parameters.AddWithValue("@FormatID", criteria.FormatID);
|
||||
// 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 (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
|
||||
// ApplicationContext.LocalContext.Remove("cn");
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfo.DataPortal_Fetch", ex);
|
||||
// _ErrorMessage = ex.Message;
|
||||
// throw new DbCslaException("FormatInfo.DataPortal_Fetch", ex);
|
||||
// }
|
||||
//}
|
||||
#region PlantFormat
|
||||
[NonSerialized]
|
||||
private PlantFormat _PlantFormat;
|
||||
|
||||
Reference in New Issue
Block a user