public List <PrivateCustomer> GetPrivateCustomers()
        {
            biz       business      = new biz();
            DataSet   dataSet       = business.Execute("SELECT * FROM PrivateCustomer");
            DataTable customerTable = dataSet.Tables[0];
            List <PrivateCustomer> privateCustomers = new List <PrivateCustomer>();

            foreach (DataRow itemRow in customerTable.Rows)
            {
                privateCustomers.Add(
                    new PrivateCustomer((string)itemRow["firstName"], (string)itemRow["lastName"], (string)itemRow["address"], (int)itemRow["zipCode"], (int)itemRow["phoneNumber"], (int)itemRow["id"], (int)itemRow["amountSpent"]));
            }
            return(privateCustomers);
        }
예제 #2
0
        public List <CorporateCustomer> GetCorporateCustomers()
        {
            biz       business      = new biz();
            DataSet   dataSet       = business.Execute("SELECT * FROM CorporateCustomer");
            DataTable customerTable = dataSet.Tables[0];
            List <CorporateCustomer> corporateCustomers = new List <CorporateCustomer>();

            foreach (DataRow itemRow in customerTable.Rows)
            {
                corporateCustomers.Add(
                    new CorporateCustomer((string)itemRow["companyName"], (int)itemRow["seNumber"], (int)itemRow["phoneNumber"], (int)itemRow["id"], (int)itemRow["amountSpent"])
                    );
            }
            return(corporateCustomers);
        }