public void CreateReservation(Reservation newReservation) { var reservationCollection = jsonManager.GetCollection(); reservationCollection.Add(newReservation); jsonManager.SaveCollection(reservationCollection); }
public bool CreateDesk(Desk desk) { var deskCollection = jsonManager.GetCollection(); deskCollection.Add(desk); jsonManager.SaveCollection(deskCollection); return(true); }
public bool CreateReservation(Reservation newReservation) { var reservationCollection = jsonManager.GetCollection(); reservationCollection.Add(newReservation); jsonManager.SaveCollection(reservationCollection); return(true); }
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)); }