using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlServerCe;
using SinosysHardware.DataAccess;

namespace SinosysHardware.Business
{
    class CustomerDB
    {
        
        public string StreetAddress;
        public string City;
        public string StateProvince;
       
        /// <summary>
        /// Retrieve a Collection of Customer objects
        /// </summary>
        /// <returns></returns>
        public   DataSet GetCustomers()
        {

            string Sql = "SELECT CustomerId, Name AS CustomerName, StreetAddress, City, StateProvince, PostalCode, ContactName, ContactPhone, RouteId FROM Customers";
            HelperDB hdb = new HelperDB();
            DataSet Ds = hdb.GetDataSet(Sql, "Customers");
            return Ds;
        }
        public DataSet GetCustomers(int customerId)
        {

            string Sql = "SELECT CustomerId, Name AS CustomerName, StreetAddress, City, StateProvince, PostalCode, ContactName, ContactPhone, RouteId FROM Customers where CustomerId=@customerid";
            SqlCeParameter paras = new SqlCeParameter("@customerid", customerId);
            HelperDB hdb = new HelperDB();
            DataSet Ds = hdb.GetDataSet(Sql, "Customers",paras);
            return Ds;
        }
       
    }
}
