648 lines
24 KiB
C#
648 lines
24 KiB
C#
///////////////////////////////////////////////////////////
|
|
// PartList.cs
|
|
// Implementation of Class PartList
|
|
// CSLA type: Read only collection
|
|
// Created on: 01-Nov-2004
|
|
// Object design: John
|
|
// Coded: 01-Nov-2004
|
|
///////////////////////////////////////////////////////////
|
|
|
|
using System;
|
|
using System.Data;
|
|
using GZTW.Data;
|
|
using CSLA.Data;
|
|
using CSLA;
|
|
using System.Collections.Generic;
|
|
|
|
namespace GZTW.AyaNova.BLL
|
|
{
|
|
#pragma warning disable 1591
|
|
/// <summary>
|
|
/// Read only list of <see cref="PartList.PartListInfo"/> objects representing <see cref="Part"/> objects used by UI and summary report
|
|
/// </summary>
|
|
[Serializable]
|
|
public class PartList : ReadOnlyCollectionBase
|
|
{
|
|
|
|
|
|
#region Data structure
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[Serializable]
|
|
public struct PartListInfo
|
|
{
|
|
internal GridNameValueCellItem mName; //and ID
|
|
internal GridNameValueCellItem mPartNumber; //and ID
|
|
internal GridNameValueCellItem mPartCategory; //and ID
|
|
internal GridNameValueCellItem mManufacturer; //and ID
|
|
internal GridNameValueCellItem mWholesaler; //and ID
|
|
internal GridNameValueCellItem mAlternativeWholesaler; //and ID
|
|
internal GridNameValueCellItem mUnitOfMeasure; //and ID
|
|
internal GridNameValueCellItem mPartAssembly; //and ID
|
|
internal GridNameValueCellItem mUPC; //and ID if possible
|
|
|
|
internal string mManufacturerNumber;//manufacturer part number
|
|
internal string mWholesalerNumber;//wholesaler part number
|
|
internal string mAlternativeWholesalerNumber;//Alternative wholesaler part number
|
|
internal decimal mCost;
|
|
internal decimal mRetail;
|
|
internal bool mTrackSerialNumber;
|
|
internal bool mActive;
|
|
|
|
//Added: 17-Nov-2006 case 165
|
|
internal string mNotes;
|
|
|
|
//AALTERNATIVEWHOLESALERS
|
|
|
|
[SqlColumnNameAttribute("aPart.aName",
|
|
"aPart.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.Part)]
|
|
public GridNameValueCellItem LT_O_Part {get{return mName;}}
|
|
|
|
[SqlColumnNameAttribute("aPart.aPartNumber",
|
|
"aPart.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.Part)]
|
|
public GridNameValueCellItem LT_Part_Label_PartNumber {get{return mPartNumber;}}
|
|
|
|
[SqlColumnNameAttribute("aPartCategory.aName",
|
|
"aPartCategory.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.PartCategory)]
|
|
public GridNameValueCellItem LT_O_PartCategory {get{return mPartCategory;}}
|
|
|
|
[SqlColumnNameAttribute("aManufacturers.aName",
|
|
"aManufacturers.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.Vendor)]
|
|
public GridNameValueCellItem LT_Part_Label_ManufacturerID {get{return mManufacturer;}}
|
|
|
|
[SqlColumnNameAttribute("aWholesalers.aName",
|
|
"aWholesalers.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.Vendor)]
|
|
public GridNameValueCellItem LT_Part_Label_WholesalerID {get{return mWholesaler;}}
|
|
|
|
[SqlColumnNameAttribute("AALTERNATIVEWHOLESALERS.aName",
|
|
"AALTERNATIVEWHOLESALERS.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.Vendor)]
|
|
public GridNameValueCellItem LT_Part_Label_AlternativeWholesalerID {get{return mAlternativeWholesaler;}}
|
|
|
|
[SqlColumnNameAttribute("aUnitOfMeasure.aName",
|
|
"aUnitOfMeasure.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.UnitOfMeasure)]
|
|
public GridNameValueCellItem LT_O_UnitOfMeasure {get{return mUnitOfMeasure;}}
|
|
|
|
[SqlColumnNameAttribute("aPartAssembly.aName",
|
|
"aPartAssembly.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.PartAssembly)]
|
|
public GridNameValueCellItem LT_O_PartAssembly {get{return mPartAssembly;}}
|
|
|
|
[SqlColumnNameAttribute("aPart.aUPC",
|
|
"aPart.aID"),
|
|
Display(DisplayType.Button, RootObjectType = RootObjectTypes.Part)]
|
|
public GridNameValueCellItem LT_Part_Label_UPC {get{return mUPC;}}
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Part_Label_ManufacturerNumber {get{return mManufacturerNumber;}}
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Part_Label_WholesalerNumber {get{return mWholesalerNumber;}}
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Part_Label_AlternativeWholesalerNumber {get{return mAlternativeWholesalerNumber;}}
|
|
|
|
[Display(DisplayType.Currency)]
|
|
public decimal LT_Part_Label_Cost {get{return mCost;}}
|
|
|
|
[Display(DisplayType.Currency)]
|
|
public decimal LT_Part_Label_Retail {get{return mRetail;}}
|
|
|
|
[Display(DisplayType.TrueFalse, ShowInLite = false)]
|
|
public bool LT_Part_Label_TrackSerialNumber {get{return mTrackSerialNumber;}}
|
|
|
|
[Display(DisplayType.TrueFalse)]
|
|
public bool LT_Part_Label_Active {get{return mActive;}}
|
|
|
|
internal string mCustom1;
|
|
internal string mCustom2;
|
|
internal string mCustom3;
|
|
internal string mCustom4;
|
|
internal string mCustom5;
|
|
internal string mCustom6;
|
|
internal string mCustom7;
|
|
internal string mCustom8;
|
|
internal string mCustom9;
|
|
internal string mCustom0;
|
|
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom1{get{return mCustom1;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom2{get{return mCustom2;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom3{get{return mCustom3;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom4{get{return mCustom4;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom5{get{return mCustom5;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom6{get{return mCustom6;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom7{get{return mCustom7;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom8{get{return mCustom8;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom9{get{return mCustom9;}}
|
|
|
|
[Display(DisplayType.Text, ShowInLite = false)]
|
|
public string LT_Part_Label_Custom0{get{return mCustom0;}}
|
|
|
|
//Added: 17-Nov-2006 case 165
|
|
[Display(DisplayType.Hidden)]
|
|
public string LT_Part_Label_Notes { get { return mNotes; } }
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
public bool Equals(PartListInfo obj)
|
|
{
|
|
return this.mPartNumber.Value.Equals(obj.mPartNumber.Value);
|
|
}
|
|
|
|
}//end PartListInfo
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
protected PartList()
|
|
{
|
|
// AllowSort=false;
|
|
// AllowFind=true;
|
|
// AllowEdit=false;
|
|
// AllowNew=false;
|
|
// AllowRemove=false;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Business properties and methods
|
|
|
|
/// <summary>
|
|
/// Get item by index
|
|
/// </summary>
|
|
/// <param name="Item"></param>
|
|
public PartListInfo this[int Item]
|
|
{
|
|
|
|
get
|
|
{
|
|
return (PartListInfo) List[Item];
|
|
}
|
|
}
|
|
|
|
//BUGBUG: This is badly written and incorrect but
|
|
//not sure at this point if anything possibly relies on it
|
|
//so leaving as is.
|
|
/// <summary>
|
|
/// Returns display text that matches passed in itemid value
|
|
/// </summary>
|
|
/// <param name="ItemID"></param>
|
|
public string this[Guid ItemID]
|
|
{
|
|
|
|
get
|
|
{
|
|
foreach (PartListInfo child in List)
|
|
{
|
|
if(child.mPartNumber.Value==ItemID) return child.ToString();
|
|
}
|
|
return "Missing: "+ItemID.ToString();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region contains
|
|
/// <summary>
|
|
/// Check if item in collection
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
public bool Contains(PartListInfo obj)
|
|
{
|
|
foreach (PartListInfo child in List)
|
|
{
|
|
if(child.Equals(obj)) return true;
|
|
}
|
|
return false;
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region Reporting and shared UI editor helpers
|
|
|
|
/// <summary>
|
|
/// Returns the report key which is a property of
|
|
/// reports used to link all reports that can be used
|
|
/// with a particular data source.
|
|
/// </summary>
|
|
public static string ReportKey
|
|
{
|
|
get
|
|
{
|
|
return "PartList";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the Detailed report key
|
|
/// which is used to determine which reports and objects
|
|
/// will be used for detailed reports
|
|
///
|
|
/// If empty string then indicates there is no detailed report object or reports
|
|
/// </summary>
|
|
public static string DetailedReportKey
|
|
{
|
|
get
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Base object that this list is reporting on
|
|
/// used by shared UI editor to instantiate new objects
|
|
/// when user selects new in UI elements that display this list
|
|
///
|
|
/// (I.E. when user clicks on new in a read only list grid, this is the object type created)
|
|
/// </summary>
|
|
public static RootObjectTypes BaseObjectType
|
|
{
|
|
get
|
|
{
|
|
return RootObjectTypes.Part;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Locale key so that generic list editor
|
|
/// UI code knows what title to give the list in a
|
|
/// grid
|
|
/// </summary>
|
|
public string LocaleKey
|
|
{
|
|
get
|
|
{
|
|
return "Part.Label.List";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// The Type of the struct used to store list records
|
|
/// Used to fetch the custom display attributes of the fields
|
|
/// contained within the record to modify the grid display accordingly
|
|
/// <see cref="DisplayAttribute"/>
|
|
/// </summary>
|
|
public static Type ListRecordType
|
|
{
|
|
get
|
|
{
|
|
return typeof(PartListInfo);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Field that contains the ID of the objects
|
|
/// that are the basis of this list.
|
|
///
|
|
/// Used for compiling an ID list for reporting from user
|
|
/// selections in a grid.
|
|
/// </summary>
|
|
public static string IDField
|
|
{
|
|
get
|
|
{
|
|
return "LT_O_Part";
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Same as IDField but for detailed reports
|
|
/// </summary>
|
|
public static string IDFieldDetailed
|
|
{
|
|
get
|
|
{
|
|
return IDField;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Static methods
|
|
|
|
//Added: 17-Nov-2006 Case 167
|
|
/// <summary>
|
|
/// Takes a single ID and returns a "list" of one object
|
|
/// </summary>
|
|
/// <param name="PartID">ID of Part object</param>
|
|
/// <returns>list of <see cref="PartList.PartListInfo"/> objects</returns>
|
|
public static PartList GetListForSingleItem(Guid PartID)
|
|
{
|
|
//Case 556
|
|
List<Guid> l = new List<Guid>();
|
|
l.Add(PartID);
|
|
return GetListFromIDList(l);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Internal method used by list factory
|
|
/// </summary>
|
|
internal static PartList Get(string Filter, int MaxRecords, List<Guid> IDList)
|
|
{
|
|
return (PartList)DataPortal.Fetch(new Criteria(Filter, IDList, MaxRecords));
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Get all Part (filtered by crit)
|
|
/// </summary>
|
|
/// <param name="xmlCriteria">Use AyaNova UI to easily build xmlCriteria and Ctrl-Alt-g keyboard command to display it for use in your code</param>
|
|
/// <returns>list of <see cref="PartList.PartListInfo"/> objects</returns>
|
|
public static PartList GetList(string xmlCriteria)
|
|
{
|
|
return (PartList)DataPortal.Fetch(new Criteria(xmlCriteria,null, -1));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get list by items indicated in IDList
|
|
/// </summary>
|
|
/// <param name="IDList">Generic list of Guid's</param>
|
|
/// <returns>list of <see cref="PartList.PartListInfo"/> objects</returns>
|
|
public static PartList GetListFromIDList(List<Guid> IDList)
|
|
{
|
|
//case 556
|
|
//Handle empty list
|
|
if (IDList.Count == 0)
|
|
return new PartList();
|
|
return (PartList)DataPortal.Fetch(new Criteria("", IDList, -1));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return an empty list
|
|
/// used for initializing grid
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static PartList GetEmptyList()
|
|
{
|
|
return new PartList();
|
|
}
|
|
|
|
//added case 1975
|
|
/// <summary>
|
|
/// Get list of parts selected in passed in WorkorderItem parts collection
|
|
/// (used by UI)
|
|
/// </summary>
|
|
/// <param name="wiparts">Workorder item parts object which will be scanned for selected parts</param>
|
|
/// <returns>list of <see cref="PartList.PartListInfo"/> objects</returns>
|
|
public static PartList GetListFromWorkorderItemParts(WorkorderItemParts wiparts)
|
|
{
|
|
List<Guid> IDList = new List<Guid>();
|
|
foreach(WorkorderItemPart p in wiparts)
|
|
{
|
|
IDList.Add(p.PartID);
|
|
}
|
|
//case 556
|
|
//Handle empty list
|
|
if (IDList.Count == 0)
|
|
return new PartList();
|
|
return (PartList)DataPortal.Fetch(new Criteria("", IDList, -1));
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region DAL DATA ACCESS
|
|
///
|
|
/// <param name="Criteria"></param>
|
|
protected override void DataPortal_Fetch(object Criteria)
|
|
{
|
|
|
|
Criteria crit = (Criteria)Criteria;
|
|
|
|
SafeDataReader dr = null;
|
|
try
|
|
{
|
|
if (crit.IDList != null)
|
|
{
|
|
//Case 556
|
|
System.Text.StringBuilder sbIN = new System.Text.StringBuilder();
|
|
sbIN.Append(" WHERE (APART.aID in (");
|
|
foreach (Guid gItem in crit.IDList)
|
|
{
|
|
sbIN.Append("'");
|
|
sbIN.Append("{");
|
|
sbIN.Append(gItem.ToString().ToUpperInvariant());
|
|
sbIN.Append("}");
|
|
sbIN.Append("',");
|
|
}
|
|
sbIN.Length = sbIN.Length - 1;
|
|
sbIN.Append(")) ");
|
|
|
|
string q = "SELECT aPart.aID, aPart.aName, aPart.aPartNumber, " +
|
|
"aPartCategory.aName AS aPartCategoryName, aPartCategory.aID " +
|
|
"AS aPartCategoryID, aManufacturers.aName " +
|
|
"AS aManufacturerName, aManufacturers.aID AS aManufacturerID, " +
|
|
"aWholesalers.aName AS aWholesalerName, aWholesalers.aID " +
|
|
"AS aWholesalerID, aPart.aManufacturerNumber, " +
|
|
"aPart.aWholesalerNumber, AALTERNATIVEWHOLESALERS.aName " +
|
|
"AS AALTERNATIVEWHOLESALERNAME, AALTERNATIVEWHOLESALERS.aID " +
|
|
"AS AALTERNATIVEWHOLESALERID, aPart.AALTERNATIVEWHOLESALERNUMBER, " +
|
|
"aPart.aCost, " +
|
|
"aPart.aRetail, aUnitOfMeasure.aName AS aUnitOfMeasureName, " +
|
|
"aUnitOfMeasure.aID AS aUnitOfMeasureID, " +
|
|
"aPartAssembly.aName AS aPartAssemblyName, " +
|
|
"aPartAssembly.aID AS aPartAssemblyID, aPart.aUPC, " +
|
|
"aPart.aTrackSerialNumber, aPart.AACTIVE, " +
|
|
" aPart.aCustom1, " +
|
|
" aPart.aCustom2, aPart.aCustom3, " +
|
|
" aPart.aCustom4, " +
|
|
" aPart.aCustom5, aPart.aCustom6, " +
|
|
" aPart.aCustom7, aPart.aCustom8, " +
|
|
" aPart.aCustom9, " +
|
|
" aPart.aCustom0, aPart.aNotes " +
|
|
" FROM " +
|
|
"APART " +
|
|
" LEFT OUTER JOIN APARTASSEMBLY ON (APART.APARTASSEMBLYID=APARTASSEMBLY.AID) " +
|
|
" LEFT OUTER JOIN AVENDOR aManufacturers ON (APART.AMANUFACTURERID=aManufacturers.AID) " +
|
|
" LEFT OUTER JOIN AVENDOR aWholesalers ON (APART.AWHOLESALERID=aWholesalers.AID) " +
|
|
" LEFT OUTER JOIN AVENDOR AALTERNATIVEWHOLESALERS ON (APART.AALTERNATIVEWHOLESALERID=AALTERNATIVEWHOLESALERS.AID) " +
|
|
" LEFT OUTER JOIN AUNITOFMEASURE ON (APART.AUNITOFMEASUREID=AUNITOFMEASURE.AID) " +
|
|
" LEFT OUTER JOIN APARTCATEGORY ON (APART.APARTCATEGORYID=APARTCATEGORY.AID) ";
|
|
|
|
|
|
dr = DBUtil.GetReaderFromSQLString(q + sbIN.ToString() + " " +
|
|
AyaBizUtils.GetGridSortOrderColumns(crit.CriteriaXML));
|
|
}
|
|
else
|
|
{
|
|
|
|
//Added: 17-Nov-2006 Notes column case 165
|
|
//************************************************************
|
|
string q = "SELECT ~MAXRECS~ aPart.aID, aPart.aName, aPart.aPartNumber, " +
|
|
"aPartCategory.aName AS aPartCategoryName, aPartCategory.aID " +
|
|
"AS aPartCategoryID, aManufacturers.aName " +
|
|
"AS aManufacturerName, aManufacturers.aID AS aManufacturerID, " +
|
|
"aWholesalers.aName AS aWholesalerName, aWholesalers.aID " +
|
|
"AS aWholesalerID, aPart.aManufacturerNumber, " +
|
|
"aPart.aWholesalerNumber, AALTERNATIVEWHOLESALERS.aName " +
|
|
"AS AALTERNATIVEWHOLESALERNAME, AALTERNATIVEWHOLESALERS.aID " +
|
|
"AS AALTERNATIVEWHOLESALERID, aPart.AALTERNATIVEWHOLESALERNUMBER, " +
|
|
"aPart.aCost, " +
|
|
"aPart.aRetail, aUnitOfMeasure.aName AS aUnitOfMeasureName, " +
|
|
"aUnitOfMeasure.aID AS aUnitOfMeasureID, " +
|
|
"aPartAssembly.aName AS aPartAssemblyName, " +
|
|
"aPartAssembly.aID AS aPartAssemblyID, aPart.aUPC, " +
|
|
"aPart.aTrackSerialNumber, aPart.AACTIVE, " +
|
|
" aPart.aCustom1, " +
|
|
" aPart.aCustom2, aPart.aCustom3, " +
|
|
" aPart.aCustom4, " +
|
|
" aPart.aCustom5, aPart.aCustom6, " +
|
|
" aPart.aCustom7, aPart.aCustom8, " +
|
|
" aPart.aCustom9, " +
|
|
" aPart.aCustom0, aPart.aNotes " +
|
|
" FROM " +
|
|
"APART " +
|
|
" LEFT OUTER JOIN APARTASSEMBLY ON (APART.APARTASSEMBLYID=APARTASSEMBLY.AID) " +
|
|
" LEFT OUTER JOIN AVENDOR aManufacturers ON (APART.AMANUFACTURERID=aManufacturers.AID) " +
|
|
" LEFT OUTER JOIN AVENDOR aWholesalers ON (APART.AWHOLESALERID=aWholesalers.AID) " +
|
|
" LEFT OUTER JOIN AVENDOR AALTERNATIVEWHOLESALERS ON (APART.AALTERNATIVEWHOLESALERID=AALTERNATIVEWHOLESALERS.AID) " +
|
|
" LEFT OUTER JOIN AUNITOFMEASURE ON (APART.AUNITOFMEASUREID=AUNITOFMEASURE.AID) " +
|
|
" LEFT OUTER JOIN APARTCATEGORY ON (APART.APARTCATEGORYID=APARTCATEGORY.AID) " +
|
|
AyaBizUtils.GetGridColumnCriteria(crit.CriteriaXML, true) + " " +
|
|
AyaBizUtils.GetGridSortOrderColumns(crit.CriteriaXML)
|
|
//************************************************************
|
|
;
|
|
|
|
if (crit.MaxRecords > 0)
|
|
q = q.Replace("~MAXRECS~", "TOP " + crit.MaxRecords.ToString());
|
|
else
|
|
q = q.Replace("~MAXRECS~", "");
|
|
|
|
dr = DBUtil.GetReaderFromSQLString(q);
|
|
}
|
|
|
|
while(dr.Read())
|
|
{
|
|
//*******************************************
|
|
PartListInfo info=new PartListInfo();
|
|
|
|
info.mName=new GridNameValueCellItem(
|
|
dr.GetGuid("aID"),
|
|
dr.GetString("aName"),
|
|
RootObjectTypes.Part);
|
|
|
|
info.mPartNumber=new GridNameValueCellItem(
|
|
dr.GetGuid("aID"),
|
|
dr.GetString("aPartNumber"),
|
|
RootObjectTypes.Part);
|
|
|
|
info.mPartCategory=new GridNameValueCellItem(
|
|
dr.GetGuid("aPartCategoryID"),
|
|
dr.GetString("aPartCategoryName"),
|
|
RootObjectTypes.PartCategory);
|
|
|
|
info.mManufacturer=new GridNameValueCellItem(
|
|
dr.GetGuid("aManufacturerID"),
|
|
dr.GetString("aManufacturerName"),
|
|
RootObjectTypes.Vendor);
|
|
|
|
info.mWholesaler=new GridNameValueCellItem(
|
|
dr.GetGuid("aWholesalerID"),
|
|
dr.GetString("aWholesalerName"),
|
|
RootObjectTypes.Vendor);
|
|
|
|
info.mAlternativeWholesaler=new GridNameValueCellItem(
|
|
dr.GetGuid("AALTERNATIVEWHOLESALERID"),
|
|
dr.GetString("AALTERNATIVEWHOLESALERNAME"),
|
|
RootObjectTypes.Vendor);
|
|
|
|
info.mUnitOfMeasure=new GridNameValueCellItem(
|
|
dr.GetGuid("aUnitOfMeasureID"),
|
|
dr.GetString("aUnitOfMeasureName"),
|
|
RootObjectTypes.UnitOfMeasure);
|
|
|
|
info.mPartAssembly=new GridNameValueCellItem(
|
|
dr.GetGuid("aPartAssemblyID"),
|
|
dr.GetString("aPartAssemblyName"),
|
|
RootObjectTypes.PartAssembly);
|
|
|
|
info.mUPC=new GridNameValueCellItem(
|
|
dr.GetGuid("aID"),
|
|
dr.GetString("aUPC"),
|
|
RootObjectTypes.Part);
|
|
|
|
info.mManufacturerNumber=dr.GetString("aManufacturerNumber");//manufacturer part number
|
|
info.mWholesalerNumber=dr.GetString("aWholeSalerNumber");//wholesaler part number
|
|
info.mAlternativeWholesalerNumber=dr.GetString("AALTERNATIVEWHOLESALERNUMBER");//AALTERNATIVEWHOLESALERNUMBER Alternative wholesaler part number
|
|
info.mCost=dr.GetDecimal("aCost");
|
|
info.mRetail=dr.GetDecimal("aRetail");
|
|
info.mTrackSerialNumber=dr.GetBoolean("aTrackSerialNumber");
|
|
info.mActive=dr.GetBoolean("AACTIVE");
|
|
info.mCustom0=dr.GetString("aCustom0");
|
|
info.mCustom1=dr.GetString("aCustom1");
|
|
info.mCustom2=dr.GetString("aCustom2");
|
|
info.mCustom3=dr.GetString("aCustom3");
|
|
info.mCustom4=dr.GetString("aCustom4");
|
|
info.mCustom5=dr.GetString("aCustom5");
|
|
info.mCustom6=dr.GetString("aCustom6");
|
|
info.mCustom7=dr.GetString("aCustom7");
|
|
info.mCustom8=dr.GetString("aCustom8");
|
|
info.mCustom9=dr.GetString("aCustom9");
|
|
|
|
//Added: 17-Nov-2006 case 165
|
|
info.mNotes = dr.GetString("aNotes");
|
|
InnerList.Add(info);
|
|
//*******************************************
|
|
}
|
|
}
|
|
finally
|
|
{
|
|
if(dr!=null) dr.Close();
|
|
}
|
|
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region criteria
|
|
|
|
//Modified to add ID criteria: 17-Nov-2006 Case 167
|
|
/// <summary>
|
|
/// Criteria for identifying existing object
|
|
/// </summary>
|
|
[Serializable]
|
|
private class Criteria
|
|
{
|
|
public List<Guid> IDList;
|
|
public string CriteriaXML;
|
|
public int MaxRecords;
|
|
public Criteria(string _CriteriaXML, List<Guid> _IDList, int _MaxRecords)
|
|
{
|
|
CriteriaXML = _CriteriaXML;
|
|
IDList = _IDList;
|
|
MaxRecords = _MaxRecords;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
}//end PartList
|
|
#pragma warning restore 1591
|
|
}//end namespace GZTW.AyaNova.BLL |