using System;
using System.Collections.Generic;
using System.Text;
namespace HardwareDistributor.Business
{
public class Customer
{
private int _customerId;
private string _customerName;
private string _streetAddress;
private string _city;
private string _stateProvince;
private string _postalCode;
private string _contactName;
private string _contactPhone;
private int _routeId;
public Customer() { }
public Customer(int customerId, string customerName, string streetAddress,
string city, string stateProvince, string postalCode,
string contactName, string contactPhone, int routeId)
{
this._customerId = customerId;
this._customerName = customerName;
this._streetAddress = streetAddress;
this._city = city;
this._stateProvince = stateProvince;
this._postalCode = postalCode;
this._contactName = contactName;
this._contactPhone = contactPhone;
this._routeId = routeId;
}
/// <summary>
/// Customer's phone number
/// </summary>
public string ContactPhone
{
get
{
return _contactPhone;
}
set
{
_contactPhone = value;
}
}
/// <summary>
/// Point of contact at Customer's company
/// </summary>
public string ContactName
{
get
{
return _contactName;
}
set
{
_contactName = value;
}
}
/// <summary>
/// Customer's postal/zip code
/// </summary>
public string PostalCode
{
get
{
return _postalCode;
}
set
{
_postalCode = value;
}
}
/// <summary>
/// State or Province where customer resides
/// </summary>
public string StateProvince
{
get
{
return _stateProvince;
}
set
{
_stateProvince = value;
}
}
/// <summary>
/// City where customer resides
/// </summary>
public string City
{
get
{
return _city;
}
set
{
_city = value;
}
}
/// <summary>
/// Address of Customer's place of business
/// </summary>
public string StreetAddress
{
get
{
return _streetAddress;
}
set
{
_streetAddress = value;
}
}
/// <summary>
/// Id of the route this customer belongs to
/// </summary>
public int RouteId
{
get
{
return _routeId;
}
set
{
_routeId = value;
}
}
/// <summary>
/// Customer's unique Id
/// </summary>
public int CustomerId
{
get
{
return _customerId;
}
set
{
_customerId = value;
}
}
/// <summary>
/// Customer's company name
/// </summary>
public string CustomerName
{
get
{
return _customerName;
}
set
{
_customerName = value;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace HardwareDistributor.Business
{
public class CustomerCollection : CollectionBase
{
/// <summary>
/// Collection indexer
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public Customer this[int index]
{
get
{
return (Customer)List[index];
}
set
{
List[index] = value;
}
}
/// <summary>
/// Adds an object to the collection
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public int Add(Customer value)
{
return (List.Add(value));
}
/// <summary>
/// Returns the index of the passed-in object
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public int IndexOf(Customer value)
{
return (List.IndexOf(value));
}
/// <summary>
/// Inserts an object into a specfic index of the collection
/// </summary>
/// <param name="index"></param>
/// <param name="value"></param>
public void Insert(int index, Customer value)
{
List.Insert(index, value);
}
/// <summary>
/// Removes an object from the collection
/// </summary>
/// <param name="value"></param>
public void Remove(Customer value)
{
List.Remove(value);
}
/// <summary>
/// Tells you if this collection
/// contains the passed-in object
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool Contains(Customer value)
{
return (List.Contains(value));
}
浙公网安备 33010602011771号