Beispiel #1
0
        private void RemoveRS(object obj)
        {
            ReservedServiceVo rsv = (ReservedServiceVo)obj;

            _reservedServiceRepository.RemoveReservedService(rsv.ResNum, rsv.SerId);
            ServiceCommands.Remove(ServiceCommands.Single(x => (x.Data == rsv)));

            ServiceVo     s  = ServiceList.Single(x => x.ServiceId == rsv.SerId);
            ReservationVo r  = ResList.Single(x => x.ResNum == rsv.ResNum);
            TimeSpan      ts = new TimeSpan(s.ServiceTime / 60, s.ServiceTime % 60, 0);

            r.EndAt = r.EndAt - ts;
            _reservationRepository.UpdateReservation(r);
        }
        private void ExcuteInsertMethod(object obj)
        {
            if (SelRes.StylistId == 0)
            {
                MessageBox.Show("선택된 예약이 없습니다.");
                return;
            }
            LedgerVo l = new LedgerVo();

            if (UserPoint < ConsumePoint)
            {
                MessageBox.Show("적립금이 부족합니다.");
                return;
            }

            if (ConsumePoint > Sum)
            {
                MessageBox.Show("사용할 적립금이 실제 가격보다 더 많습니다.");
                return;
            }
            l.ResNum = SelRes.ResNum;
            l.Sum    = Sum;
            _ledgerRepository.InsertLedger(l);

            UserVo user = _userList.Single(x => x.UserTel == SelRes.UserTel);

            user.Point += Point;
            user.Point -= ConsumePoint;
            _userRepository.UpdateUser(user);

            ReservationVo r = ResList.Single(x => x.ResNum == SelRes.ResNum);

            r.IsPaid = true;
            _reservationRepository.UpdateReservation(r);
            MessageBox.Show("결제 완료");
            // ResList = new ObservableCollection<ReservationVo>(_reservationRepository.GetReservations());
        }