703 lines
23 KiB
C#
703 lines
23 KiB
C#
///////////////////////////////////////////////////////////
|
|
// VendorListDetailed.cs
|
|
// Implementation of Class VendorListDetailed
|
|
// CSLA type: Read only collection
|
|
// Created on: 26-Nov-2005
|
|
// Object design: Joyce
|
|
// Coded: 28-Nov-2005
|
|
///////////////////////////////////////////////////////////
|
|
|
|
using System;
|
|
using System.Data;
|
|
using GZTW.Data;
|
|
using CSLA.Data;
|
|
using CSLA;
|
|
using System.Threading;
|
|
using CSLA.Security;
|
|
using System.Collections.Generic;
|
|
|
|
namespace GZTW.AyaNova.BLL
|
|
{
|
|
#pragma warning disable 1591
|
|
/// <summary>
|
|
/// Read only detailed list of <see cref="VendorListDetailed.VendorListDetailedInfo"/> objects representing <see cref="Vendor"/> objects.
|
|
/// Used in detailed reports.
|
|
/// </summary>
|
|
[Serializable]
|
|
public class VendorListDetailed : ReadOnlyCollectionBase
|
|
{
|
|
|
|
#region Data structure
|
|
/// <summary>
|
|
/// Properties
|
|
/// </summary>
|
|
[Serializable]
|
|
public struct VendorListDetailedInfo
|
|
{
|
|
|
|
internal GridNameValueCellItem mVendor;
|
|
internal VendorTypes mVendorType;//Vendor.Label.VendorType
|
|
|
|
internal string mDeliveryAddress;
|
|
internal string mCity;
|
|
internal string mStateProv;
|
|
internal string mCountry;
|
|
internal string mPostal;
|
|
internal bool mActive;
|
|
internal string mAccountNumber;
|
|
internal string mWebAddress;
|
|
internal string mLatitude;
|
|
internal string mLongitude;
|
|
internal string mCountryCode;
|
|
|
|
#region Detailed fields
|
|
internal string mPDeliveryAddress;
|
|
internal string mPCity; //(these are all from postaladdress)
|
|
internal string mPStateProv;
|
|
internal string mPCountry;
|
|
internal string mPPostal;
|
|
|
|
//to be able to provide into reports
|
|
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;
|
|
|
|
internal string mNotes;
|
|
|
|
|
|
#endregion
|
|
|
|
#region Detail properties
|
|
public string LT_Address_Label_PostalDeliveryAddress
|
|
{get{return mPDeliveryAddress;}}
|
|
public string LT_Address_Label_PostalCity
|
|
{get{return mPCity;}}
|
|
public string LT_Address_Label_PostalStateProv
|
|
{get{return mPStateProv;}}
|
|
public string LT_Address_Label_PostalCountry
|
|
{get{return mPCountry;}}
|
|
public string LT_Address_Label_PostalPostal
|
|
{get{return mPPostal;}}
|
|
|
|
public string LT_Vendor_Label_Custom1
|
|
{get{return mCustom1;}}
|
|
public string LT_Vendor_Label_Custom2
|
|
{get{return mCustom2;}}
|
|
public string LT_Vendor_Label_Custom3
|
|
{get{return mCustom3;}}
|
|
public string LT_Vendor_Label_Custom4
|
|
{get{return mCustom4;}}
|
|
public string LT_Vendor_Label_Custom5
|
|
{get{return mCustom5;}}
|
|
public string LT_Vendor_Label_Custom6
|
|
{get{return mCustom6;}}
|
|
public string LT_Vendor_Label_Custom7
|
|
{get{return mCustom7;}}
|
|
public string LT_Vendor_Label_Custom8
|
|
{get{return mCustom8;}}
|
|
public string LT_Vendor_Label_Custom9
|
|
{get{return mCustom9;}}
|
|
public string LT_Vendor_Label_Custom0
|
|
{get{return mCustom0;}}
|
|
|
|
[SqlColumnNameAttribute("grid")]
|
|
public string LT_Vendor_Label_Notes
|
|
{get{return mNotes;}}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
[SqlColumnNameAttribute("aVendor.aName",
|
|
"AVendor.AID")]
|
|
public GridNameValueCellItem LT_Vendor_Label_ID
|
|
{
|
|
get
|
|
{
|
|
return mVendor;
|
|
}
|
|
}
|
|
|
|
//Case 798
|
|
[SqlColumnNameAttribute("aVendor.aName",
|
|
"AVendor.AID"),
|
|
Display(DisplayType.Hidden, RootObjectType = RootObjectTypes.Vendor)]
|
|
public GridNameValueCellItem LT_O_Vendor
|
|
{
|
|
get
|
|
{
|
|
return mVendor;
|
|
}
|
|
}
|
|
|
|
public VendorTypes LT_Vendor_Label_VendorType
|
|
{
|
|
get
|
|
{
|
|
return mVendorType;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string LT_Vendor_Label_AccountNumber
|
|
{
|
|
get
|
|
{
|
|
return mAccountNumber;
|
|
}
|
|
}
|
|
|
|
|
|
public string LT_Address_Label_DeliveryAddress
|
|
{
|
|
get
|
|
{
|
|
return mDeliveryAddress;
|
|
}
|
|
}
|
|
|
|
public string LT_Address_Label_City
|
|
{
|
|
get
|
|
{
|
|
return mCity;
|
|
}
|
|
}
|
|
public string LT_Address_Label_StateProv
|
|
{
|
|
get
|
|
{
|
|
return mStateProv;
|
|
}
|
|
}
|
|
public string LT_Address_Label_Country
|
|
{
|
|
get
|
|
{
|
|
return mCountry;
|
|
}
|
|
}
|
|
public string LT_Address_Label_Postal
|
|
{
|
|
get
|
|
{
|
|
return mPostal;
|
|
}
|
|
}
|
|
|
|
|
|
public bool LT_Vendor_Label_Active
|
|
{
|
|
get
|
|
{
|
|
return mActive;
|
|
}
|
|
}
|
|
|
|
public string LT_Vendor_Label_WebAddress
|
|
{
|
|
get
|
|
{
|
|
return mWebAddress;
|
|
}
|
|
}
|
|
|
|
public string LT_Address_Label_Latitude
|
|
{
|
|
get
|
|
{
|
|
return mLatitude;
|
|
}
|
|
}
|
|
|
|
public string LT_Address_Label_Longitude
|
|
{
|
|
get
|
|
{
|
|
return mLongitude;
|
|
}
|
|
}
|
|
|
|
public string LT_Address_Label_CountryCode
|
|
{
|
|
get
|
|
{
|
|
return mCountryCode;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
public bool Equals(VendorListDetailedInfo obj)
|
|
{
|
|
return this.mVendor.Value.Equals(obj.mVendor.Value);
|
|
}
|
|
|
|
|
|
#region Contact fields and properties
|
|
//CONTACT FIELDS
|
|
internal string mContact;
|
|
internal string mEmail;
|
|
internal string mPhone1;
|
|
internal string mPhone2;
|
|
internal string mPhone3;
|
|
internal string mPhone4;
|
|
internal string mPhone5;
|
|
internal string mContactNotes;
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Vendor_Label_Contact
|
|
{ get { return mContact; } }
|
|
|
|
[Display(DisplayType.URL_Email)]
|
|
public string LT_Vendor_Label_Email
|
|
{ get { return mEmail; } }
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Vendor_Label_Phone1
|
|
{ get { return mPhone1; } }
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Vendor_Label_Phone2
|
|
{ get { return mPhone2; } }
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Vendor_Label_Phone3
|
|
{ get { return mPhone3; } }
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Vendor_Label_Phone4
|
|
{ get { return mPhone4; } }
|
|
|
|
[Display(DisplayType.Text)]
|
|
public string LT_Vendor_Label_Phone5
|
|
{ get { return mPhone5; } }
|
|
|
|
[Display(DisplayType.MultiLineText)]
|
|
public string LT_Vendor_Label_ContactNotes
|
|
{ get { return mContactNotes; } }
|
|
|
|
|
|
#endregion
|
|
|
|
}//end VendorListDetailedInfo
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
protected VendorListDetailed()
|
|
{
|
|
// 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 VendorListDetailedInfo this[int Item]
|
|
{
|
|
|
|
get
|
|
{
|
|
return (VendorListDetailedInfo) List[Item];
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Returns display text that matches passed in itemid value
|
|
/// </summary>
|
|
/// <param name="ItemID"></param>
|
|
public string this[Guid ItemID]
|
|
{
|
|
|
|
get
|
|
{
|
|
foreach (VendorListDetailedInfo child in List)
|
|
{
|
|
if(child.mVendor.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(VendorListDetailedInfo obj)
|
|
{
|
|
foreach (VendorListDetailedInfo child in List)
|
|
{
|
|
if(child.Equals(obj)) return true;
|
|
}
|
|
return false;
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region Reporting
|
|
|
|
/// <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 "VendorListDetailed";
|
|
}
|
|
}
|
|
|
|
|
|
/// <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 VendorList.IDField;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Same as IDField but for detailed reports
|
|
/// </summary>
|
|
public static string IDFieldDetailed
|
|
{
|
|
get
|
|
{
|
|
return IDField;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Static methods
|
|
/// <summary>
|
|
/// Internal method used by list factory
|
|
/// </summary>
|
|
internal static VendorListDetailed Get(string Filter, int MaxRecords, List<Guid> IDList)
|
|
{
|
|
return (VendorListDetailed)DataPortal.Fetch(new Criteria(Filter, IDList, MaxRecords));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Takes an xml column list and where criteria
|
|
/// and returns a list filtered and sorted accordingly
|
|
/// </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="VendorListDetailed.VendorListDetailedInfo"/> objects</returns>
|
|
public static VendorListDetailed GetListByCriteria(string xmlCriteria)
|
|
{
|
|
return (VendorListDetailed) DataPortal.Fetch(new Criteria(xmlCriteria,null,-1));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Takes a single ID and returns a "list" of one object
|
|
/// </summary>
|
|
/// <param name="VendorID">ID of Vendor object</param>
|
|
/// <returns>list of <see cref="VendorListDetailed.VendorListDetailedInfo"/> objects</returns>
|
|
public static VendorListDetailed GetListForSingleItem(Guid VendorID)
|
|
{
|
|
//Case 556
|
|
List<Guid> l = new List<Guid>();
|
|
l.Add(VendorID);
|
|
return GetListFromIDList(l);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get list by items indicated in IDList
|
|
/// </summary>
|
|
/// <param name="IDList">Generic list of Guid's</param>
|
|
/// <returns>list of <see cref="VendorListDetailed.VendorListDetailedInfo"/> objects</returns>
|
|
public static VendorListDetailed GetListFromIDList(List<Guid> IDList)
|
|
{
|
|
//case 556
|
|
//Handle empty list
|
|
if (IDList.Count == 0)
|
|
return new VendorListDetailed();
|
|
return (VendorListDetailed)DataPortal.Fetch(new Criteria("", IDList, -1));
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Return an empty list
|
|
/// used for initializing grid
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static VendorListDetailed GetEmptyList()
|
|
{
|
|
return new VendorListDetailed();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region DAL DATA ACCESS
|
|
///
|
|
/// <param name="Criteria"></param>
|
|
protected override void DataPortal_Fetch(object Criteria)
|
|
{
|
|
|
|
Criteria crit = (Criteria)Criteria;
|
|
|
|
SafeDataReader dr = null;
|
|
try
|
|
{
|
|
DBCommandWrapper dbCommandWrapper = null;
|
|
if (crit.IDList != null)
|
|
{
|
|
//Case 556
|
|
System.Text.StringBuilder sbIN = new System.Text.StringBuilder();
|
|
sbIN.Append(" AND (aVendor.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(")) ");
|
|
|
|
dbCommandWrapper = DBUtil.DB.GetSqlStringCommandWrapper(
|
|
//************************************************************
|
|
//"SELECT aVendor.aID, aVendor.aName, " +
|
|
//"aVendor.AACTIVE, aVendor.aWebAddress, aVendor.aVendorType, aVendor.AACCOUNTNUMBER, " +
|
|
// " AVENDOR.ACONTACT, AVENDOR.AEMAIL, AVENDOR.APHONE1, AVENDOR.APHONE2, AVENDOR.APHONE3, AVENDOR.APHONE4, AVENDOR.APHONE5, AVENDOR.ACONTACTNOTES, " +
|
|
|
|
//"AADDRESS.aDeliveryAddress, AADDRESS.aCity, " +
|
|
//"AADDRESS.aStateProv, AADDRESS.aCountry, " +
|
|
//"AADDRESS.aPostal, AADDRESS.AADDRESSTYPE, " +
|
|
//"AADDRESS.aLongitude, AADDRESS.aLatitude, AADDRESS.aCountryCode " +
|
|
//"FROM " +
|
|
//" AVENDOR " +
|
|
//" LEFT OUTER JOIN AADDRESS ON (AVENDOR.AID=AADDRESS.AROOTOBJECTID) " +
|
|
//"WHERE (AADDRESS.AADDRESSTYPE = 2 OR AADDRESS.AADDRESSTYPE IS NULL) " +
|
|
|
|
//case 797
|
|
"SELECT aVendor.aID, aVendor.aName, " +
|
|
"aVendor.AACTIVE, aVendor.aWebAddress, aVendor.aVendorType, aVendor.AACCOUNTNUMBER, " +
|
|
" AVENDOR.ACONTACT, AVENDOR.AEMAIL, AVENDOR.APHONE1, AVENDOR.APHONE2, AVENDOR.APHONE3, AVENDOR.APHONE4, AVENDOR.APHONE5, AVENDOR.ACONTACTNOTES, AVENDOR.ANOTES, " +
|
|
" AVENDOR.ACUSTOM1, AVENDOR.ACUSTOM2, " +
|
|
" AVENDOR.ACUSTOM3, AVENDOR.ACUSTOM4, " +
|
|
" AVENDOR.ACUSTOM5, AVENDOR.ACUSTOM6, " +
|
|
" AVENDOR.ACUSTOM7, AVENDOR.ACUSTOM8, AVENDOR.ACUSTOM9, " +
|
|
" AVENDOR.ACUSTOM0, " +
|
|
|
|
" aPHYSICAL.aDeliveryAddress, " +
|
|
"aPHYSICAL.aCity, aPHYSICAL.aStateProv, aPHYSICAL.aCountry, " +
|
|
" aPHYSICAL.aPostal, aPHYSICAL.AADDRESSTYPE, " +
|
|
" aPHYSICAL.aLongitude, aPHYSICAL.aLatitude, " +
|
|
|
|
"aPHYSICAL.aCountryCode, " +
|
|
" aPOSTAL.AADDRESSTYPE AS aPAddressType, " +
|
|
" aPOSTAL.aDeliveryAddress AS aPDeliveryAddress, " +
|
|
" aPOSTAL.aCity AS aPCity, aPOSTAL.aStateProv " +
|
|
"AS aPStateProv, aPOSTAL.aCountryCode AS aPCountryCode, " +
|
|
" aPOSTAL.aCountry AS aPCountry, aPOSTAL.aPostal " +
|
|
"AS aPPostal " +
|
|
|
|
"FROM " +
|
|
" AVENDOR " +
|
|
" LEFT OUTER JOIN AADDRESS aPHYSICAL ON (AVENDOR.AID=aPHYSICAL.AROOTOBJECTID) " +
|
|
" LEFT OUTER JOIN AADDRESS aPOSTAL ON (AVENDOR.AID=aPOSTAL.AROOTOBJECTID) " +
|
|
"WHERE (aPHYSICAL.AADDRESSTYPE " +
|
|
"IS NULL OR aPHYSICAL.AADDRESSTYPE " +
|
|
"= 2) AND (aPOSTAL.AADDRESSTYPE IS NULL OR aPOSTAL.AADDRESSTYPE " +
|
|
"= 1) " +
|
|
|
|
sbIN.ToString() +
|
|
AyaBizUtils.GetGridSortOrderColumns(crit.CriteriaXML).Replace("AADDRESS", "aPHYSICAL")
|
|
//************************************************************
|
|
);
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
//************************************************************
|
|
//string q = "SELECT ~MAXRECS~ aVendor.aID, aVendor.aName, " +
|
|
//"aVendor.AACTIVE, aVendor.aWebAddress, aVendor.aVendorType, aVendor.AACCOUNTNUMBER, " +
|
|
// " AVENDOR.ACONTACT, AVENDOR.AEMAIL, AVENDOR.APHONE1, AVENDOR.APHONE2, AVENDOR.APHONE3, AVENDOR.APHONE4, AVENDOR.APHONE5, AVENDOR.ACONTACTNOTES, " +
|
|
|
|
//"AADDRESS.aDeliveryAddress, AADDRESS.aCity, " +
|
|
//"AADDRESS.aStateProv, AADDRESS.aCountry, " +
|
|
//"AADDRESS.aPostal, AADDRESS.AADDRESSTYPE, " +
|
|
//"AADDRESS.aLongitude, AADDRESS.aLatitude, AADDRESS.aCountryCode " +
|
|
//"FROM " +
|
|
//" AVENDOR " +
|
|
//" LEFT OUTER JOIN AADDRESS ON (AVENDOR.AID=AADDRESS.AROOTOBJECTID) " +
|
|
//"WHERE (AADDRESS.AADDRESSTYPE = 2 OR AADDRESS.AADDRESSTYPE IS NULL) \r\n" +
|
|
//AyaBizUtils.GetGridColumnCriteria(crit.CriteriaXML, false) + "\r\n" +
|
|
//AyaBizUtils.GetGridSortOrderColumns(crit.CriteriaXML);
|
|
|
|
|
|
//case 797
|
|
string q = "SELECT ~MAXRECS~ aVendor.aID, aVendor.aName, " +
|
|
"aVendor.AACTIVE, aVendor.aWebAddress, aVendor.aVendorType, aVendor.AACCOUNTNUMBER, " +
|
|
" AVENDOR.ACONTACT, AVENDOR.AEMAIL, AVENDOR.APHONE1, AVENDOR.APHONE2, AVENDOR.APHONE3, AVENDOR.APHONE4, AVENDOR.APHONE5, AVENDOR.ACONTACTNOTES, AVENDOR.ANOTES, " +
|
|
" AVENDOR.ACUSTOM1, AVENDOR.ACUSTOM2, " +
|
|
" AVENDOR.ACUSTOM3, AVENDOR.ACUSTOM4, " +
|
|
" AVENDOR.ACUSTOM5, AVENDOR.ACUSTOM6, " +
|
|
" AVENDOR.ACUSTOM7, AVENDOR.ACUSTOM8, AVENDOR.ACUSTOM9, " +
|
|
" AVENDOR.ACUSTOM0, " +
|
|
|
|
" aPHYSICAL.aDeliveryAddress, " +
|
|
"aPHYSICAL.aCity, aPHYSICAL.aStateProv, aPHYSICAL.aCountry, " +
|
|
" aPHYSICAL.aPostal, aPHYSICAL.AADDRESSTYPE, " +
|
|
" aPHYSICAL.aLongitude, aPHYSICAL.aLatitude, " +
|
|
|
|
"aPHYSICAL.aCountryCode, " +
|
|
" aPOSTAL.AADDRESSTYPE AS aPAddressType, " +
|
|
" aPOSTAL.aDeliveryAddress AS aPDeliveryAddress, " +
|
|
" aPOSTAL.aCity AS aPCity, aPOSTAL.aStateProv " +
|
|
"AS aPStateProv, aPOSTAL.aCountryCode AS aPCountryCode, " +
|
|
" aPOSTAL.aCountry AS aPCountry, aPOSTAL.aPostal " +
|
|
"AS aPPostal " +
|
|
|
|
"FROM " +
|
|
" AVENDOR " +
|
|
" LEFT OUTER JOIN AADDRESS aPHYSICAL ON (AVENDOR.AID=aPHYSICAL.AROOTOBJECTID) " +
|
|
" LEFT OUTER JOIN AADDRESS aPOSTAL ON (AVENDOR.AID=aPOSTAL.AROOTOBJECTID) " +
|
|
"WHERE (aPHYSICAL.AADDRESSTYPE " +
|
|
"IS NULL OR aPHYSICAL.AADDRESSTYPE " +
|
|
"= 2) AND (aPOSTAL.AADDRESSTYPE IS NULL OR aPOSTAL.AADDRESSTYPE " +
|
|
"= 1) \r\n" +
|
|
AyaBizUtils.GetGridColumnCriteria(crit.CriteriaXML, false)+ "\r\n" +
|
|
AyaBizUtils.GetGridSortOrderColumns(crit.CriteriaXML).Replace("AADDRESS", "aPHYSICAL") ;
|
|
|
|
//************************************************************
|
|
|
|
if (crit.MaxRecords > 0)
|
|
q = q.Replace("~MAXRECS~", "TOP " + crit.MaxRecords.ToString());
|
|
else
|
|
q = q.Replace("~MAXRECS~", "");
|
|
|
|
|
|
|
|
dbCommandWrapper = DBUtil.DB.GetSqlStringCommandWrapper(q);
|
|
|
|
}
|
|
|
|
|
|
|
|
dbCommandWrapper.AddInParameter("@aTrue",DbType.Boolean,true);
|
|
dr = new SafeDataReader(DBUtil.DB.ExecuteReader(dbCommandWrapper));
|
|
|
|
while(dr.Read())
|
|
{
|
|
//*******************************************
|
|
VendorListDetailedInfo info=new VendorListDetailedInfo();
|
|
info.mVendor=new GridNameValueCellItem(
|
|
dr.GetGuid("aID"),
|
|
dr.GetString("aName"),
|
|
RootObjectTypes.Vendor);
|
|
|
|
info.mContact = dr.GetString("ACONTACT");
|
|
info.mEmail = dr.GetString("AEMAIL");
|
|
info.mPhone1 = dr.GetString("APHONE1");
|
|
info.mPhone2 = dr.GetString("APHONE2");
|
|
info.mPhone3 = dr.GetString("APHONE3");
|
|
info.mPhone4 = dr.GetString("APHONE4");
|
|
info.mPhone5 = dr.GetString("APHONE5");
|
|
info.mContactNotes = dr.GetString("ACONTACTNOTES");
|
|
|
|
info.mAccountNumber=dr.GetString("AACCOUNTNUMBER");
|
|
info.mDeliveryAddress=dr.GetString("aDeliveryAddress");
|
|
info.mCity=dr.GetString("aCity");
|
|
info.mStateProv=dr.GetString("aStateProv");
|
|
info.mCountry=dr.GetString("aCountry");
|
|
info.mPostal=dr.GetString("aPostal");
|
|
info.mActive=dr.GetBoolean("AACTIVE");
|
|
info.mVendorType=(VendorTypes)dr.GetInt16("aVendorType");
|
|
info.mWebAddress=dr.GetString("aWebAddress");
|
|
info.mLatitude=Address.LatitudeToString(dr.GetDecimal("aLatitude"));
|
|
info.mLongitude=Address.LongitudeToString(dr.GetDecimal("aLongitude"));
|
|
info.mCountryCode=dr.GetString("aCountryCode");
|
|
|
|
//case 797
|
|
//------- Detailed fields ----------------
|
|
info.mPDeliveryAddress = dr.GetString("aPDeliveryAddress");
|
|
info.mPCity = dr.GetString("aPCity");
|
|
info.mPStateProv = dr.GetString("aPStateProv");
|
|
info.mPCountry = dr.GetString("aPCountry");
|
|
info.mPPostal = dr.GetString("aPPostal");
|
|
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");
|
|
info.mCustom0 = dr.GetString("aCustom0");
|
|
info.mNotes = dr.GetString("ANOTES");
|
|
|
|
InnerList.Add(info);
|
|
//*******************************************
|
|
}
|
|
}
|
|
finally
|
|
{
|
|
if(dr!=null) dr.Close();
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region criteria
|
|
/// <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 VendorListDetailed
|
|
#pragma warning restore 1591
|
|
}//end namespace GZTW.AyaNova.BLL |