Exemplo n.º 1
0
 public Driver(int?id, PersonName name, string carModel,
               string carColor, string carPlateNumber) : base(0)
 {
     this.Identificator = id;
     this.Name          = name;
     this.Car           = new Car(carModel, carColor, carPlateNumber);
 }
Exemplo n.º 2
0
 public TaxiOrder(int id, PersonName clientName, Address startAddress, DateTime dateTime) : base(id)
 {
     this.id      = id;
     ClientName   = clientName;
     Start        = startAddress;
     CreationTime = dateTime;
 }
 public Driver(int id,
               PersonName driverName,
               Car car) : base(id)
 {
     Id         = id;
     DriverName = driverName;
     Car        = car;
 }
Exemplo n.º 4
0
 public TaxiOrder(int id, PersonName clientName, Address startAddress, DateTime creationTime) : base(id)
 {
     ClientName        = clientName;
     Start             = startAddress;
     Destination       = new Address(null, null);
     Driver            = new Driver(-1, new PersonName(null, null), new Car());
     this.creationTime = creationTime;
     status            = TaxiOrderStatus.WaitingForDriver;
 }
Exemplo n.º 5
0
 public TaxiOrder(int id,
                  string clientFirstName,
                  string clientLastName,
                  string street,
                  string building,
                  DateTime creationTime)
     : base(id)
 {
     ClientName           = new PersonName(clientFirstName, clientLastName);
     Start                = new Address(street, building);
     CreationCreationTime = creationTime;
 }
        public Driver GetDriver(int driverId)
        {
            if (driverId == 15)
            {
                var driverName = new PersonName("Drive", "Driverson");
                var car        = new Car("Lada sedan", "Baklazhan", "A123BT 66");
                var driver     = new Driver(driverId, driverName, car);

                return(driver);
            }
            else
            {
                throw new Exception("Unknown driver id " + driverId);
            }
        }
        public TaxiOrder CreateOrderWithoutDestination(string firstName, string lastName, string street, string building)
        {
            var client = new PersonName(firstName, lastName);
            var start  = new Address(street, building);

            return(new TaxiOrder(
                       idCounter++,
                       client,
                       start,
                       null,
                       null,
                       null,
                       currentTime(),
                       null,
                       null,
                       null,
                       null));
        }
Exemplo n.º 8
0
 private string FormatName(PersonName person)
 {
     return(person == null ? "" : string.Join(" ", person.FirstName, person.LastName));
 }
Exemplo n.º 9
0
 public Driver(int id, string firstName, string lastName) : base(id)
 {
     Name = new PersonName(firstName, lastName);
 }
Exemplo n.º 10
0
 public static TaxiOrder CreateOrderWithoutDestination(int id, PersonName client, Address start, DateTime orderTime)
 {
     return(new TaxiOrder(id, client, start, orderTime));
 }
Exemplo n.º 11
0
 public TaxiOrder(int id, PersonName clientName, Address start, DateTime orderTime) : base(id)
 {
     ClientName = clientName;
     Start      = start;
     TimeReport = new TaxiOrderTimeReport(orderTime, this);
 }
Exemplo n.º 12
0
 private static string FormatName(PersonName name)
 {
     return(Equals(name, null) ? "" : $"{name.FirstName} {name.LastName}");
 }
Exemplo n.º 13
0
 public Driver(int driverId, PersonName name) : base(driverId)
 {
     Name     = name;
     DriverId = driverId;
 }
Exemplo n.º 14
0
 public Driver(int id, PersonName name, Car car) : base(id)
 {
     Name = name;
     Car  = car;
 }
Exemplo n.º 15
0
 public static string GetFullName(this PersonName person)
 {
     return($"{person.FirstName} {person.LastName}");
 }