public Client(string name, string address, string uniqueNumber, IValidateModel modelValidator) : base(name, address, uniqueNumber)
 {
     this.modelValidator = modelValidator;
     this.dueDaysAllowed = 5;
     this.discount       = 0;
     this.vehicles       = new List <IVehicle>();
 }
示例#2
0
        public IVehicle CreateTruck(string model, string make, string registrationNumber, string year, EngineType engine,
                                    int weightAllowedInKilograms, IValidateModel modelValidator)
        {
            IVehicle newTruck = new Truck(model, make, registrationNumber, year, engine, weightAllowedInKilograms, modelValidator);

            return(newTruck);
        }
 public IssueInvoices(IDatabase database, IValidateCore coreValidator, IValidateModel modelValidator, IWriter writer)
 {
     this.database       = database ?? throw new ArgumentNullException();
     this.coreValidator  = coreValidator ?? throw new ArgumentNullException();
     this.modelValidator = modelValidator ?? throw new ArgumentNullException();
     this.writer         = writer;
 }
 public HireEmployee(IAutoServiceFactory autoServiceFactory, IDatabase database, IValidateCore coreValidator, IWriter writer, IValidateModel modelValidator)
 {
     this.database           = database ?? throw new ArgumentNullException();
     this.autoServiceFactory = autoServiceFactory ?? throw new ArgumentNullException();
     this.coreValidator      = coreValidator ?? throw new ArgumentNullException();
     this.writer             = writer ?? throw new ArgumentNullException();
     this.modelValidator     = modelValidator ?? throw new ArgumentNullException();
 }
 public AddVehicleToClient(IDatabase database, IWriter writer, IValidateCore coreValidator, IAutoServiceFactory factory, IValidateModel modelValidator)
 {
     this.database       = database ?? throw new ArgumentNullException();
     this.writer         = writer ?? throw new ArgumentNullException();
     this.coreValidator  = coreValidator ?? throw new ArgumentNullException();
     this.modelValidator = modelValidator ?? throw new ArgumentNullException();
     this.factory        = factory ?? throw new ArgumentNullException();
 }
示例#6
0
 //Initialize the singleInstance objects that are used in the methods
 //properties not needed for now
 public StockManager(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database       = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.modelValidator = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
 }
示例#7
0
 public SellStockToClientVehicle(IAutoServiceFactory autoServiceFactory, IDatabase database, IValidateCore coreValidator, IWriter writer, IStockManager stockManager, IValidateModel modelValidator)
 {
     this.database           = database ?? throw new ArgumentNullException();
     this.coreValidator      = coreValidator ?? throw new ArgumentNullException();
     this.writer             = writer ?? throw new ArgumentNullException();
     this.stockManager       = stockManager ?? throw new ArgumentNullException();
     this.autoServiceFactory = autoServiceFactory ?? throw new ArgumentNullException();
     this.modelValidator     = modelValidator ?? throw new ArgumentNullException();
 }
        public Invoice(string number, DateTime date, IClient client, IValidateModel modelValidator)
        {
            this.modelValidator = modelValidator;
            this.ModelValidator.StringForNullEmpty(number);
            this.ModelValidator.CheckNullObject(client);

            this.number       = number;
            this.client       = client;
            this.date         = date;
            this.invoiceItems = new List <ISell>();
        }
示例#9
0
 public IssueInvoices(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database       = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.coreValidator  = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.modelValidator = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
     this.writer         = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
 }
 public SellServiceToClientVehicle(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database           = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.coreValidator      = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer             = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
     this.autoServiceFactory = processorLocator.GetProcessor <IAutoServiceFactory>() ?? throw new ArgumentNullException();
     this.modelValidator     = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
 }
示例#11
0
 public Employee(string firstName, string lastName, string position, decimal salary, decimal ratePerMinute,
                 DepartmentType department, IValidateModel modelValidator)
 {
     this.modelValidator   = modelValidator;
     this.FirstName        = firstName;
     this.LastName         = lastName;
     this.Position         = position;
     this.Salary           = salary;
     this.RatePerMinute    = ratePerMinute;
     this.Department       = department;
     this.isHired          = true;
     this.responsibilities = new List <ResponsibilityType>();
 }
 //Constructor
 public OrderStockToWarehouse(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database           = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.autoServiceFactory = processorLocator.GetProcessor <IAutoServiceFactory>() ?? throw new ArgumentNullException();
     this.coreValidator      = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer             = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
     this.stockManager       = processorLocator.GetProcessor <IStockManager>() ?? throw new ArgumentNullException();
     this.modelValidator     = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
 }
示例#13
0
        public Vehicle(string make, string model, string registrationNumber,
                       string year, EngineType engine, IValidateModel modelValidator)
        {
            this.modelValidator = modelValidator;
            this.ModelValidator.StringForNullEmpty(make, model, registrationNumber, year);
            this.ModelValidator.MakeAndModelLength(make, model);
            this.ModelValidator.RegistrationNumber(registrationNumber);
            this.ModelValidator.VehicleYear(year);

            this.model = model;
            this.make  = make;
            this.registrationNumber = registrationNumber;
            this.year   = year;
            this.engine = engine;
        }
示例#14
0
 public ISell CreateSellService(IEmployee responsibleEmployee, IClient client, IVehicle vehicle, string serviceName,
                                int durationInMinutes, IValidateModel modelValidator)
 {
     return(new SellService(responsibleEmployee, client, vehicle, serviceName, durationInMinutes, modelValidator));
 }
 public SellStock(IEmployee responsibleEmployee, IClient client, IVehicle vehicle, IStock stock, IValidateModel modelValidator)
     : base(responsibleEmployee, stock.PurchasePrice * 1.2m, client, vehicle, modelValidator)
 {
     modelValidator.CheckNullObject(stock);
     this.stock = stock;
 }
示例#16
0
 protected Order(IEmployee responsibleEmployee, ICounterparty supplier, IValidateModel modelValidator)
     : base(responsibleEmployee, TypeOfWork.Ordering, modelValidator)
 {
     modelValidator.CheckNullObject(supplier);
     this.supplier = supplier;
 }
示例#17
0
 //Initialize the singleInstance objects that are used in the methods
 //properties not needed for now
 public StockManager(IDatabase database, IValidateModel modelValidator)
 {
     this.database       = database ?? throw new ArgumentNullException();
     this.modelValidator = modelValidator ?? throw new ArgumentNullException();
 }
示例#18
0
 public OrderStock(IEmployee responsibleEmployee, ICounterparty supplier, IStock stock, IValidateModel modelValidator)
     : base(responsibleEmployee, supplier, modelValidator)
 {
     modelValidator.CheckNullObject(stock);
     this.stock = stock;
 }
示例#19
0
        public IVehicle CreateVehicle(string make, string model, string registrationNumber,
                                      string year, EngineType engine, int passengerCapacity, IValidateModel modelValidator)
        {
            IVehicle newCar = new Car(model, make, registrationNumber, year, engine, passengerCapacity, modelValidator);

            return(newCar);
        }
示例#20
0
 public IInvoice CreateInvoice(string number, DateTime date, IClient client, IValidateModel modelValidator)
 {
     return(new Invoice(number, date, client, modelValidator));
 }
示例#21
0
 public Car(string model, string make, string registrationNumber, string year, EngineType engine, int passengerCapacity, IValidateModel modelValidator)
     : base(model, make, registrationNumber, year, engine, modelValidator)
 {
     this.ModelValidator.PassengerCapacity(passengerCapacity);
     this.passengerCapacity = passengerCapacity;
     this.VehicleType       = VehicleType.Car;
 }
示例#22
0
        public SellService(IEmployee responsibleEmployee, IClient client, IVehicle vehicle, string serviceName, int durationInMinutes, IValidateModel modelValidator)
            : base(responsibleEmployee, durationInMinutes * responsibleEmployee.RatePerMinute * (1 - client.Discount), client, vehicle, modelValidator)
        {
            modelValidator.StringForNullEmpty(serviceName);
            modelValidator.ServiceNameLength(serviceName);
            modelValidator.ServiceDurationInMinutes(durationInMinutes, minDuration, maxDuration);

            this.serviceName       = serviceName.Trim();
            this.durationInMinutes = durationInMinutes;
        }
示例#23
0
 public Work(IEmployee responsibleEmployee, TypeOfWork job, IValidateModel modelValidator)
 {
     this.responsibleEmployee = responsibleEmployee;
     this.job            = job;
     this.modelValidator = modelValidator;
 }
示例#24
0
        IEmployee IAutoServiceFactory.CreateEmployee(string firstName, string lastName, string position, decimal salary, decimal ratePerMinute, DepartmentType department, IValidateModel modelValidator)
        {
            IEmployee newEmployee = new Employee(firstName, lastName, position, salary, ratePerMinute, department, modelValidator);

            return(newEmployee);
        }
示例#25
0
 public ICounterparty CreateClient(string name, string address, string uniqueNumber, IValidateModel modelValidator)
 {
     return(new Client(name, address, uniqueNumber, modelValidator));
 }
示例#26
0
 public ISell CreateSellStock(IEmployee responsibleEmployee, IClient client, IVehicle vehicle, IStock stock, IValidateModel modelValidator)
 {
     return(new SellStock(responsibleEmployee, client, vehicle, stock, modelValidator));
 }
示例#27
0
        protected Sell(IEmployee responsibleEmployee, decimal sellPrice, IClient client, IVehicle vehicle, IValidateModel modelValidator)
            : base(responsibleEmployee, TypeOfWork.Selling, modelValidator)
        {
            modelValidator.CheckNullObject(new object[] { client, vehicle });
            modelValidator.SellPrice(sellPrice);

            this.client    = client;
            this.sellPrice = sellPrice;
            this.vehicle   = vehicle;
        }
示例#28
0
 public IOrderStock CreateOrderStock(IEmployee responsibleEmployee, ICounterparty supplier, IStock stock, IValidateModel modelValidator)
 {
     return(new OrderStock(responsibleEmployee, supplier, stock, modelValidator));
 }
示例#29
0
 public Truck(string model, string make, string registrationNumber, string year, EngineType engine, int weightAllowedInKilograms, IValidateModel modelValidator)
     : base(model, make, registrationNumber, year, engine, modelValidator)
 {
     this.WeightAllowedInKilograms = weightAllowedInKilograms;
     this.VehicleType = VehicleType.Truck;
 }
示例#30
0
 public IEmployee CreateEmployee(string firstName, string lastName, string position, decimal salary, decimal ratePerMinute,
                                 DepartmentType department, IValidateModel modelValidator)
 {
     return(new Employee(firstName, lastName, position, salary, ratePerMinute, department, modelValidator));
 }