Пример #1
0
        static public void CheckOutClient(Client client)
        {
            CheckInHistory lastCheckIn = GetLastCheckin(client);

            if (lastCheckIn == null || lastCheckIn.IsCheckedOut)
            {
                throw new Exception("Client hasn't checked in to checkout");
            }
            lastCheckIn.CheckOut = DateTime.Now;
            DatabaseManager.InsertIntoCheckInHistory(client.Phonenumber, lastCheckIn);
        }
Пример #2
0
        static public void CheckInClient(Client client)
        {
            CheckInHistory lastCheckIn = GetLastCheckin(client);

            if (lastCheckIn != null && !lastCheckIn.IsCheckedOut)
            {
                lastCheckIn.CheckOut = lastCheckIn.CheckIn;
                DatabaseManager.InsertIntoCheckInHistory(client.Phonenumber, lastCheckIn);
            }
            DatabaseManager.InsertIntoCheckInHistory(client.Phonenumber, new CheckInHistory {
                CheckIn = DateTime.Now, CheckOut = null
            });
        }