public bool GetAttd(int GuestId) { GuestsList dbGuest = new GuestsList(); Guest guest = dbGuest.dbGuestsList.Where(a => a.GuestId == GuestId).Single(a => a.Attendance); return(guest.Attendance); }
public int GetAttendedGuest() { GuestsList dbGuest = new GuestsList(); int attended = dbGuest.dbGuestsList.Where(g => g.Attendance == true).ToList().Count(); return(attended); }
public List <Guest> FindGuests(string name) { GuestsList dbGuest = new GuestsList(); string sqlQuery = "SELECT * FROM TblGuestsList WHERE Name LIKE '%" + name + "%'"; return(dbGuest.dbGuestsList.SqlQuery(sqlQuery).ToList()); }
public int GetTotalGuest() { GuestsList dbGuest = new GuestsList(); int total = dbGuest.dbGuestsList.Count(); return(total); }
public List <Guest> GetTableGuest(string TableNo) { GuestsList dbGuest = new GuestsList(); string sqlQuery = "SELECT * FROM TblGuestsList WHERE TableNo = " + TableNo; return(dbGuest.dbGuestsList.SqlQuery(sqlQuery).ToList()); }
public void SetAttd(string GuestId) { GuestsList dbGuest = new GuestsList(); string sqlQuery = "UPDATE TblGuestsList SET Attendance = 1 WHERE GuestId = " + GuestId; dbGuest.Database.ExecuteSqlCommand(sqlQuery); dbGuest.SaveChanges(); }
public void DeleteGuest(int guestId) { GuestsList dbGuest = new GuestsList(); string sqlQuery = "DELETE FROM TblGuestsList WHERE GuestId = " + guestId; dbGuest.Database.ExecuteSqlCommand(sqlQuery); dbGuest.SaveChanges(); }
public Guest EditGuest(Guest g) { GuestsList dbGuest = new GuestsList(); dbGuest.Entry(g).State = EntityState.Modified; dbGuest.SaveChanges(); return(g); }
public Guest SaveGuest(Guest g) { GuestsList dbGuest = new GuestsList(); dbGuest.dbGuestsList.Add(g); dbGuest.SaveChanges(); return(g); }
public void RemoveGuest(Guest guest) { EventQueue.Enqueue(new EventData(Event.GuestGone, new List <object> { Tables[guest.NumberOfTable].Position })); GuestsList.Remove(guest); Rating.UpdateRating(Tables[guest.NumberOfTable], guest); Tables[guest.NumberOfTable].Clean(); EventQueue.Enqueue(new EventData(Event.RatingUpdated, new List <object> { Rating.Grade, Rating.CountRating })); if (Rating.Grade == 0) { EventQueue.Enqueue(new EventData(Event.FinishGame)); } }
void StartTimer() { timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(8); timer.Tick += (sender, args) => { var g = new Guest(this); if (g.TryTakeTable()) { GuestsList.Add(g); Tables[g.NumberOfTable].IsOccupated = true; EventQueue.Enqueue(new EventData(Event.GuestArrived, new List <object> { Tables[g.NumberOfTable].Position })); } }; timer.Start(); }
//[OutputCache(Duration = 3600, VaryByParam = "id")] public ActionResult GetGuestDetails(int?id) { var guest = GuestsList.FirstOrDefault(x => x.Id == id); if (guest == null) { guest = new POSService.Entities.Guest { Id = 0, FullName = "House Keeping Staff", RoomNumber = "House Keeping Staff", GuestRoomId = 0 } } ; return(Json(new { Details = guest.RoomNumber, SuccessText = "Department Successfully Added", Id = guest.Id, GuestRoomId = guest.GuestRoomId }, JsonRequestBehavior.AllowGet)); }
private void ManageWelcomePack_Click(object sender, RoutedEventArgs e) { GuestsList newWindow = new GuestsList(); newWindow.ShowDialog(); }
public Guest FindGuestsById(int guestId) { GuestsList dbGuest = new GuestsList(); return(dbGuest.dbGuestsList.Find(guestId)); }
public List <Guest> GetGuests() { GuestsList dbGuest = new GuestsList(); return(dbGuest.dbGuestsList.ToList()); }
public string GetMaxTable() { GuestsList dbGuest = new GuestsList(); return(dbGuest.dbGuestsList.Max(g => g.TableNo)); }