Exemple #1
0
        public Drivers GetDrivers(int depotNumber)
        {
            //
            Drivers drivers = new Drivers();

            try {
                DataSet ds = new RoadshowGateway().GetDispatchDrivers(depotNumber);
                if (ds != null)
                {
                    RoadshowDataset _drivers = new RoadshowDataset();
                    _drivers.Merge(ds);
                    for (int i = 0; i < _drivers.DriverTable.Rows.Count; i++)
                    {
                        drivers.Add(new Driver(_drivers.DriverTable[i]));
                    }
                }
            }
            catch (ApplicationException aex) { throw new FaultException <RoadshowFault>(new RoadshowFault(aex.Message), "Gateway Error"); }
            catch (Exception ex) { throw new FaultException <RoadshowFault>(new RoadshowFault(ex.Message), "Unexpected Error"); }
            return(drivers);
        }
Exemple #2
0
        public Customers2 GetCustomers2()
        {
            //
            Customers2 customers = new Customers2();

            try {
                DataSet ds = new RoadshowGateway().GetDispatchCustomers2();
                if (ds != null)
                {
                    RoadshowDataset _customers = new RoadshowDataset();
                    _customers.Merge(ds);
                    for (int i = 0; i < _customers.CustomerTable.Rows.Count; i++)
                    {
                        customers.Add(new Customer2(_customers.CustomerTable[i]));
                    }
                }
            }
            catch (ApplicationException aex) { throw new FaultException <RoadshowFault>(new RoadshowFault(aex.Message), "Gateway Error"); }
            catch (Exception ex) { throw new FaultException <RoadshowFault>(new RoadshowFault(ex.Message), "Unexpected Error"); }
            return(customers);
        }