public void CreateReservation(Reservation newReservation)
        {
            var reservationCollection = jsonManager.GetCollection();

            reservationCollection.Add(newReservation);

            jsonManager.SaveCollection(reservationCollection);
        }
Exemple #2
0
        public bool CreateDesk(Desk desk)
        {
            var deskCollection = jsonManager.GetCollection();

            deskCollection.Add(desk);
            jsonManager.SaveCollection(deskCollection);
            return(true);
        }
Exemple #3
0
        public bool CreateReservation(Reservation newReservation)
        {
            var reservationCollection = jsonManager.GetCollection();

            reservationCollection.Add(newReservation);
            jsonManager.SaveCollection(reservationCollection);
            return(true);
        }
Exemple #4
0
        public bool CreateAdmin()
        {
            var userCollection = jsonManager.GetCollection();

            if (!userCollection.Any(p => p.Name == "ADMIN" &&
                                    p.LastName == "ADMIN" &&
                                    p.Email == "ADMIN"))
            {
                try
                {
                    var adminUser = new User()
                    {
                        Name     = "ADMIN",
                        LastName = "ADMIN",
                        Email    = "ADMIN",
                        UserId   = Guid.NewGuid(),
                        PassWord = EncryptData.EncryptText("4dmin!")
                    };

                    userCollection.Add(adminUser);

                    jsonManager.SaveCollection(userCollection);
                }
                catch
                {
                    return(false);
                }


                return(true);
            }

            return(true);
        }
        public Desk FindDesk(string numberDesk)
        {
            var deskCollection = jsonManager.GetCollection();

            return(deskCollection.FirstOrDefault(p => p.Number == numberDesk));
        }