//---------------------------------------------------------------------------
// Excel Multivalue Formula Add-In
// Copyright (C) <2005> <Herbert Danler>
// Contact: danler@users.sourceforge.net
// Project Home Page: http://excelmvf.sourceforge.net/
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//---------------------------------------------------------------------------
/***********************************************************************
* Module: TCustomerRecord.cpp
* Author: Herbert Danler
* Modified: Montag, 4. Oktober 2004 16:11:25
* Purpose: Implementation of the class TCustomerRecord
***********************************************************************/
#include "TCustomerDataset.h"
#include "TCustomerRecord.h"
TFieldDescriptor TCustomerRecord::fieldDescriptor[]={
{"1","CUSTOMERID",1},{"CUSTOMERID","CUSTOMERID",1},{"ID","CUSTOMERID",1},
{"2","FIRSTNAME",2},{"FIRSTNAME","FIRSTNAME",2},{"FIRST NAME","FIRSTNAME",2},{"VORNAME","FIRSTNAME",2},
{"3","LASTNAME",3},{"LASTNAME","LASTNAME",3},{"LAST NAME","LASTNAME",3},{"NACHNAME","LASTNAME",3},{"NAME","LASTNAME",3},
{"4","ADDRESS",4},{"ADDRESS","ADDRESS",4},{"ADRESSE","ADDRESS",4},{"ANSCHRIFT","ADDRESS",4},
{"5","POSTALCODE",5},{"POSTALCODE","POSTALCODE",5},{"POSTAL CODE","POSTALCODE",5},{"POSTLEITZAHL","POSTALCODE",5},{"PLZ","POSTALCODE",5},
{"6","CITY",6},{"CITY","CITY",6},{"STADT","CITY",6},
{"7","AREA",7},{"AREA","AREA",7},{"BUNDESLAND","AREA",7},
{"8","COUNTRY",8},{"COUNTRY","COUNTRY",8},{"STATE","COUNTRY",8},{"STAAT","COUNTRY",8}
};
/* default field list is displayed when user enters no or invalid field list
* Extend whenever new fields are added! */
std::string TCustomerRecord::defaultFieldList="customerID,firstname,lastname,address,postalCode,city,area,country";
int TCustomerRecord::getfieldDescriptorArraySize(){
return sizeof(fieldDescriptor);
}
////////////////////////////////////////////////////////////////////////
// Name: TCustomerRecord::operator[](int pfieldnumber)
// Purpose: Implementation of TCustomerRecord::operator[]()
// Comment: returns field i. Fields are numbered in a sequence
// purpose:
// Parameters:
// - pfieldnumber
// Return: Variant
////////////////////////////////////////////////////////////////////////
Variant TCustomerRecord::operator[](int pfieldnumber) const
{
switch (pfieldnumber){
case 1:
return customerID;
case 2:
return firstname;
case 3:
return lastname;
case 4:
return address;
case 5:
return postalcode;
case 6:
return city;
case 7:
return area;
case 8:
return country;
default:
return Variant(0);
}
}