public async Task <bool> CanImportAsync(IDictionary <string, TData> data, IDataAccessFacade <TData> access) { var csvs = data.Keys.Where(filename => Path.GetExtension(filename).Equals(".csv", StringComparison.OrdinalIgnoreCase)).ToArray(); if (csvs.Any()) { foreach (var csv in csvs) { using (var stream = await Reader.OpenStreamProvider(await access.GetFileAsync(csv))) { int i = 3; using (var reader = new StreamReader(stream)) { //Goto line 3 string line = null; while (i-- > 0) { line = await reader.ReadLineAsync(); } ParseHeaderData(line); if (Headers.Count == 12 && line.StartsWith(TABLE_HEADER_START)) { return(true); } } } } } return(false); }
public void SetValidData() { dataAccessFacadeStub = new DataAccessFacadeStub(); validName = "VF Jan"; validNote = "8 Persons"; validType = CustomerType.Bureau; }
internal Customer(CustomerType type, string note, string name, IDataAccessFacade dataAccessFacade) { validateName(name); this.dataAccessFacade = dataAccessFacade; _customerEntity = dataAccessFacade.CreateCustomer(type, note, name); initializeParty(_customerEntity); }
public BookingController(PaymentController paymentController, CustomerController customerController) { dataAccessFacade = DataAccessFacade.GetInstance(); bookingCollection = new BookingCollection(dataAccessFacade); this.paymentController = paymentController; this.customerController = customerController; }
public PartimInformatieRepository(IDataAccessFacade db, IBamaflexRepository bamaflexRepository, IDocentRepository docentRepository) { _docentRepository = docentRepository; _bamaflexRepository = bamaflexRepository; _db = db; _genericRepository = new GenericRepository <PartimInformation>(db.Context); }
public StudentRepository(IDataAccessFacade db, IBamaflexRepository bamaflexRepository, IOpleidingRepository opleidingRepository) { _bamaflexRepository = bamaflexRepository; _opleidingRepository = opleidingRepository; _db = db; _genericRepository = new GenericRepository <Student>(db.Context); }
internal Supplier(IDataAccessFacade dataAccessFacade, ISupplier supplierEntity) { this.dataAccessFacade = dataAccessFacade; _supplierEntity = supplierEntity; initializeParty(_supplierEntity); readPaymentRules(); }
/// <summary> /// For testing against a specified DataAccessFacade /// </summary> /// <param name="dataAccessFacade"></param> public BookingController(PaymentController paymentController, CustomerController customerController, IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; bookingCollection = new BookingCollection(dataAccessFacade); this.paymentController = paymentController; this.customerController = customerController; }
internal Booking(IBooking bookingEntity, IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; _bookingEntity = bookingEntity; // Create Models of supplier and customer _supplier = new Supplier(dataAccessFacade, _bookingEntity.Supplier); _customer = new Customer(_bookingEntity.Customer, dataAccessFacade); }
internal PaymentRule(IPaymentRule paymentRuleEntity, Supplier supplier, IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; this._paymentRuleEntity = paymentRuleEntity; // Get/Create Models of supplier and customer Supplier = supplier; Customer = new Customer(_paymentRuleEntity.Customer, dataAccessFacade); }
internal Supplier(string name, string note, SupplierType type, IDataAccessFacade dataAccessFacade) { //Calls validation on "name" for securing right input. validateName(name); this.dataAccessFacade = dataAccessFacade; _supplierEntity = dataAccessFacade.CreateSupplier(name, note, type); //Calls party class to put supplierentity as a party. initializeParty(_supplierEntity); }
public void SetValidData() { dataAccessFacadeStub = new DataAccessFacadeStub(); validDueDate = new DateTime(2010, 10, 10); validDueAmount = 1m; validPayer = new Customer(CustomerType.Bureau, "", "Lonely Tree", dataAccessFacadeStub); validPayee = new Supplier("Galasam", "", SupplierType.Cruise, dataAccessFacadeStub); validType = PaymentType.Balance; validSale = "VF Jan"; validBooking = 2; }
//Reads all entities of customer there is in the DataAccessFacade. //Returns them to a list here. internal static List <Customer> ReadAll(IDataAccessFacade dataAccessFacade) { List <ICustomer> customerEntities = dataAccessFacade.ReadAllCustomers(); List <Customer> customers = new List <Customer>(); foreach (ICustomer customerEntity in customerEntities) { Customer customer = new Customer(customerEntity, dataAccessFacade); customers.Add(customer); } return(customers); }
/// <summary> /// Initializes a new instance of the <see cref="GestureLogic"/> class. /// Initialize the attributes, and check if exists the discrete and continuous modals. /// </summary> public GestureLogic() { _dataAccessFacade = new DataAccessFacade(); _discreteGestures = new List <Tuple <Person, string> >(); _processedDiscreteGestureNames = new List <string>(); _processedContinuousGestureNames = new List <string>(); _dataAccessFacade.GetModalAccess().AddIfNotExists("Discrete Posture", "Evaluates every moment and return true or false"); _dataAccessFacade.GetModalAccess().AddIfNotExists("Continuous Posture", "Evaluates every moment and return a number associated to the progress"); }
public void Initialize() { culture = new CultureInfo("en-US"); // Used for comparing decimals with strings dataAccessFacade = new DataAccessFacadeStub(); customerController = new CustomerController(dataAccessFacade); supplierController = new SupplierController(dataAccessFacade); paymentController = new PaymentController(dataAccessFacade); bookingController = new BookingController(paymentController, customerController, dataAccessFacade); ICustomer lonelyTree = customerController.CreateCustomer(CustomerType.Bureau, "", "Lonely Tree"); }
internal static List <Supplier> ReadAll(IDataAccessFacade dataAccessFacade) { //Takes all the objects that read and changes them to a supplier from an entity. List <ISupplier> supplierEntities = dataAccessFacade.ReadAllSuppliers(); List <Supplier> suppliers = new List <Supplier>(); foreach (ISupplier supplierEntity in supplierEntities) { Supplier supplier = new Supplier(dataAccessFacade, supplierEntity); suppliers.Add(supplier); } return(suppliers); }
/// <summary> /// Reads all ArtistEntities from the persistence subsystem and creates a new Artist /// representation for each entity /// </summary> /// <param name="dataAccessFacade">Facade to persistence subsystem</param> /// <returns>A list of all Artists stored in the persistence subsystem</returns> internal static List <Artist> ReadAll(IDataAccessFacade dataAccessFacade) { List <Artist> artists = new List <Artist>(); List <IArtist> entities = dataAccessFacade.ReadAllArtists(); foreach (IArtist entity in entities) { Artist artist = new Artist(entity, dataAccessFacade); artists.Add(artist); } return(artists); }
internal static List <Booking> ReadAll(IDataAccessFacade dataAccessFacade) { //Calls readall bookings and adds them to a list List <IBooking> bookingEntities = dataAccessFacade.ReadAllBookings(); List <Booking> bookings = new List <Booking>(); foreach (IBooking bookingEntity in bookingEntities) { Booking booking = new Booking(bookingEntity, dataAccessFacade); bookings.Add(booking); } return(bookings); }
//Returns a list of all payments created, with dataAccessFacade as parameter to access ReadAllPayments //through dataAccessFacade, to get a list of paymentEntities. internal static List <Payment> ReadAll(IDataAccessFacade dataAccessFacade) { List <IPayment> paymentEntities = dataAccessFacade.ReadAllPayments(); List <Payment> payments = new List <Payment>(); //foreach converts each paymentEntity from paymentEntities to a payment, and adds it to a list of payments. foreach (IPayment paymentEntity in paymentEntities) { Payment payment = new Payment(paymentEntity, dataAccessFacade); payments.Add(payment); } return(payments); }
internal PaymentRule(Supplier supplier, Customer customer, BookingType bookingType, decimal percentage, int daysOffset, BaseDate baseDate, PaymentType paymentType, IDataAccessFacade dataAccessFacade) { // validate validateCustomer(customer); validateSupplier(supplier); // Get entities for DataAccess ISupplier supplierEntity = supplier._supplierEntity; ICustomer customerEntity = customer._customerEntity; this.dataAccessFacade = dataAccessFacade; _paymentRuleEntity = dataAccessFacade.CreatePaymentRule(supplierEntity, customerEntity, bookingType, percentage, daysOffset, baseDate, paymentType); }
internal Payment(IPayment paymentEntity, IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; this._paymentEntity = paymentEntity; // Create Models of payer and payee if (_paymentEntity.Payer is ISupplier) { _payer = new Supplier(dataAccessFacade, (ISupplier)_paymentEntity.Payer); _payee = new Customer((ICustomer)_paymentEntity.Payee, dataAccessFacade); } else if (_paymentEntity.Payer is ICustomer) { _payer = new Customer((ICustomer)_paymentEntity.Payer, dataAccessFacade); _payee = new Supplier(dataAccessFacade, (ISupplier)_paymentEntity.Payee); } }
internal Booking(Supplier supplier, Customer customer, string sale, int bookingNumber, DateTime startDate, DateTime endDate, IDataAccessFacade dataAccessFacade) { validateSale(sale); validateEndDate(startDate, endDate); // Get entities for DataAccess ISupplier supplierEntity = supplier._supplierEntity; ICustomer customerEntity = customer._customerEntity; this.dataAccessFacade = dataAccessFacade; _bookingEntity = dataAccessFacade.CreateBooking(supplierEntity, customerEntity, sale, bookingNumber, startDate, endDate); _supplier = supplier; _customer = customer; }
internal Payment(DateTime dueDate, decimal dueAmount, IParty payer, IParty payee, PaymentType type, string sale, int booking, IDataAccessFacade dataAccessFacade) { validateDueAmount(dueAmount); validateParty(payer); validateParty(payee); validateSale(sale); // Get entities for DataAccess IParty payerEntity = ((AParty)payer)._partyEntity; IParty payeeEntity = ((AParty)payee)._partyEntity; this.dataAccessFacade = dataAccessFacade; _paymentEntity = dataAccessFacade.CreatePayment(dueDate, dueAmount, payerEntity, payeeEntity, type, sale, booking); Payer = payer; Payee = payee; }
/// <summary> /// For testing against a specified DataAccessFacade /// </summary> /// <param name="dataAccessFacade"></param> public SupplierController(IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; supplierCollection = new SupplierCollection(dataAccessFacade); }
public SupplierController() { dataAccessFacade = DataAccessFacade.GetInstance(); supplierCollection = new SupplierCollection(dataAccessFacade); }
//Construtor calls readall on for the new instance of dataaccessfacade. internal PaymentCollection(IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; ReadAll(); }
//Reads all entities of customer there is in the DataAccessFacade. //Returns them to a list here. internal static List<Customer> ReadAll(IDataAccessFacade dataAccessFacade) { List<ICustomer> customerEntities = dataAccessFacade.ReadAllCustomers(); List<Customer> customers = new List<Customer>(); foreach (ICustomer customerEntity in customerEntities) { Customer customer = new Customer(customerEntity, dataAccessFacade); customers.Add(customer); } return customers; }
internal static List<Supplier> ReadAll(IDataAccessFacade dataAccessFacade) { //Takes all the objects that read and changes them to a supplier from an entity. List<ISupplier> supplierEntities = dataAccessFacade.ReadAllSuppliers(); List<Supplier> suppliers = new List<Supplier>(); foreach (ISupplier supplierEntity in supplierEntities) { Supplier supplier = new Supplier(dataAccessFacade, supplierEntity); suppliers.Add(supplier); } return suppliers; }
internal static List<Booking> ReadAll(IDataAccessFacade dataAccessFacade) { //Calls readall bookings and adds them to a list List<IBooking> bookingEntities = dataAccessFacade.ReadAllBookings(); List<Booking> bookings = new List<Booking>(); foreach (IBooking bookingEntity in bookingEntities) { Booking booking = new Booking(bookingEntity, dataAccessFacade); bookings.Add(booking); } return bookings; }
/// <summary> /// For testing against a specified DataAccessFacade /// </summary> /// <param name="dataAccessFacade"></param> public PaymentController(IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; paymentCollection = new PaymentCollection(dataAccessFacade); }
public PaymentController() { dataAccessFacade = DataAccessFacade.GetInstance(); paymentCollection = new PaymentCollection(dataAccessFacade); }
public CustomerController() { dataAccessFacade = DataAccessFacade.GetInstance(); customerCollection = new CustomerCollection(dataAccessFacade); }
/// <summary> /// For testing against a specified DataAccessFacade /// </summary> /// <param name="dataAccessFacade"></param> public CustomerController(IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; customerCollection = new CustomerCollection(dataAccessFacade); }
internal SupplierCollection(IDataAccessFacade dataAccessFacade) { //uses a new instance of dataAccessFacade and calls readAll. this.dataAccessFacade = dataAccessFacade; ReadAll(); }
public OpleidingRepository(IDataAccessFacade db, IBamaflexRepository bamaflexRepository) { _db = db; _genericRepository = new GenericRepository <Opleiding>(db.Context); _bamaflexRepository = bamaflexRepository; }
public AanvraagRepository(IDataAccessFacade db) { _db = db; _genericRepository = new GenericRepository <Request>(db.Context); }
//Returns a list of all payments created, with dataAccessFacade as parameter to access ReadAllPayments //through dataAccessFacade, to get a list of paymentEntities. internal static List<Payment> ReadAll(IDataAccessFacade dataAccessFacade) { List<IPayment> paymentEntities = dataAccessFacade.ReadAllPayments(); List<Payment> payments = new List<Payment>(); //foreach converts each paymentEntity from paymentEntities to a payment, and adds it to a list of payments. foreach (IPayment paymentEntity in paymentEntities) { Payment payment = new Payment(paymentEntity, dataAccessFacade); payments.Add(payment); } return payments; }
internal Customer(ICustomer customerEntity, IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; _customerEntity = customerEntity; initializeParty(_customerEntity); }
public BookingCollection(IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; ReadAll(); }
internal CustomerCollection(IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; ReadAll(); }
public FeedbackRepository(IDataAccessFacade db) { _db = db; _genericRepository = new GenericRepository <Feedback>(db.Context); }
public BewijsRepository(IDataAccessFacade db) { _db = db; _genericRepository = new GenericRepository <Evidence>(db.Context); }