Example #1
0
        public MainPageViewModel()
        {
            _reservationRepository     = ReservationRepository.Rr;;
            _reservedServiceRepository = ReservedServiceRepository.RSR;
            _serviceRepository         = ServiceRepository.SR;
            _stylistRepository         = StylistRepository.SR;
            _userRepository            = UserRepository.UR;

            _selectedRes        = new ReservationVo();
            SelectedRes.Gender  = -1;
            SelectedRes.StartAt = DateTime.Today;
            SelectedRes.EndAt   = new DateTime();
            formerDate          = new DateTime(1, 1, 1);
            StartDate           = new DateTime();
            StartDate           = DateTime.Today;

            ResList         = new ObservableCollection <ReservationVo>(_reservationRepository.GetReservations());
            ServiceList     = new ObservableCollection <ServiceVo>(_serviceRepository.GetServicesFromLocal());
            ServiceCommands = new ObservableCollection <DataCommandViewModel <ReservedServiceVo> >();
            StylistList     = new ObservableCollection <StylistVo>(_stylistRepository.GetStylistsFromLocal());

            _availableHour = new List <int>();
            for (int x = 0; x < 24; x++)
            {
                _availableHour.Add(x);
            }
            _availableMinute = new List <int>()
            {
                0, 30
            };

            InsertCommand    = new Command(ExecuteInsertMethod, CanExecuteMethod);
            ModifyCommand    = new Command(ExecuteModifyMethod, CanExecuteMethod);
            DeleteCommand    = new Command(ExecuteDeleteMethod, CanExecuteMethod);
            InsertRSCommand  = new Command(ExecuteInsertRSMethod, CanExecuteMethod);
            InitalizeCommand = new Command(ExecuteInitalizeMethod, CanExecuteMethod);

            _noticeService = NoticeService.NS;


            _timer          = new DispatcherTimer();
            _timer.Interval = new System.TimeSpan(0, 0, 5);
            _timer.Tick    += _timer_Tick;
            _timer.Start();

            MakeTimeTable(_selectedRes);
        }
        public TimetableViewModel()
        {
            DateTime _selectedDate = new DateTime();

            _selectedDate = DateTime.Today;

            _timetableRepository       = TimetableRepository.TR;
            _reservationRepository     = ReservationRepository.Rr;
            _reservedServiceRepository = ReservedServiceRepository.RSR;
            _stylistRepository         = StylistRepository.SR;

            TimeTableList   = new ObservableCollection <TimeTableVo>(_timetableRepository.GetTimeTables());
            ReservationList = new ObservableCollection <ReservationVo>(_reservationRepository.GetReservations());
            StylistList     = new ObservableCollection <StylistVo>(_stylistRepository.GetStylistsFromLocal());

            MakeTimeTable(_selectedDate);
        }
Example #3
0
        public PayViewModel()
        {
            _reservationRepository     = ReservationRepository.Rr;
            _reservedServiceRepository = ReservedServiceRepository.RSR;
            _ledgerRepository          = LedgerRepository.LR;
            _userRepository            = UserRepository.UR;
            _stylistRepository         = StylistRepository.SR;
            _resList     = new ObservableCollection <ReservationVo>(_reservationRepository.GetReservations());
            _serviceList = new List <ServiceVo>(ServiceRepository.SR.GetServicesFromLocal());
            _userList    = new List <UserVo>(UserRepository.UR.GetUserList());

            _sum = 0;
            _stylistadditionalCost = 0;
            _consumePoint          = 0;
            _selRes           = new ReservationVo();
            _selRes.StylistId = 0;

            InsertCommand = new Command(ExcuteInsertMethod);
        }