Ejemplo n.º 1
0
 public Hours(Hours <T> hours) : this(hours.Repository)
 {
     OpeningHour = hours.OpeningHour;
     ClosingHour = hours.ClosingHour;
     Requested   = hours.Requested;
     Instance    = hours.Instance;
 }
Ejemplo n.º 2
0
        void LoadBarberHours <T>(Hours <T> instance, DateTime dateTime) where T : ISchedulable
        {
            // todo: special case check for holidays

            int openHour = 0, closeHour = 0;

            switch (dateTime.DayOfWeek)
            {
            case DayOfWeek.Sunday:
                openHour  = 0;
                closeHour = 0;
                break;

            case DayOfWeek.Monday:
            case DayOfWeek.Tuesday:
                openHour  = 8;
                closeHour = 20;
                break;

            case DayOfWeek.Wednesday:
                openHour  = 0;
                closeHour = 0;
                break;

            case DayOfWeek.Thursday:
            case DayOfWeek.Friday:
            case DayOfWeek.Saturday:
                openHour  = 8;
                closeHour = 20;
                break;
            }

            instance.OpeningHour = openHour;
            instance.ClosingHour = closeHour;
        }
Ejemplo n.º 3
0
        public Task LoadAsync <T>(Hours <T> hours, DateTime dateTime) where T : ISchedulable
        {
            switch (hours.Instance.Type)
            {
            case HoursType.Barber:
                LoadBarberHours(hours, dateTime);
                break;

            case HoursType.Shop:
                LoadShopHours(hours, dateTime);
                break;
            }
            return(Task.CompletedTask);
        }
Ejemplo n.º 4
0
 public void LoadFrom(Hours <ISchedulable> hours)
 {
     Hours.ClosingHour = hours.ClosingHour;
     Hours.OpeningHour = hours.OpeningHour;
 }
Ejemplo n.º 5
0
 public Barber(IShop shop, IRepository <Appointment> appointmentRepository, Hours <IBarber> hours)
 {
     this.shop = shop;
     this.appointmentRepository = appointmentRepository;
     Hours = hours;
 }
Ejemplo n.º 6
0
 public ShopHours(Hours <IShop> hours) : base(hours)
 {
 }
Ejemplo n.º 7
0
 public BarberHours(Hours <IBarber> hours) : base(hours)
 {
 }