예제 #1
0
        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);
        }
예제 #2
0
        public int GetAttendedGuest()
        {
            GuestsList dbGuest  = new GuestsList();
            int        attended = dbGuest.dbGuestsList.Where(g => g.Attendance == true).ToList().Count();

            return(attended);
        }
예제 #3
0
        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());
        }
예제 #4
0
        public int GetTotalGuest()
        {
            GuestsList dbGuest = new GuestsList();
            int        total   = dbGuest.dbGuestsList.Count();

            return(total);
        }
예제 #5
0
        public List <Guest> GetTableGuest(string TableNo)
        {
            GuestsList dbGuest  = new GuestsList();
            string     sqlQuery = "SELECT * FROM TblGuestsList WHERE TableNo = " + TableNo;

            return(dbGuest.dbGuestsList.SqlQuery(sqlQuery).ToList());
        }
예제 #6
0
        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();
        }
예제 #7
0
        public void DeleteGuest(int guestId)
        {
            GuestsList dbGuest  = new GuestsList();
            string     sqlQuery = "DELETE FROM TblGuestsList WHERE GuestId = " + guestId;

            dbGuest.Database.ExecuteSqlCommand(sqlQuery);
            dbGuest.SaveChanges();
        }
예제 #8
0
        public Guest EditGuest(Guest g)
        {
            GuestsList dbGuest = new GuestsList();

            dbGuest.Entry(g).State = EntityState.Modified;
            dbGuest.SaveChanges();
            return(g);
        }
예제 #9
0
        public Guest SaveGuest(Guest g)
        {
            GuestsList dbGuest = new GuestsList();

            dbGuest.dbGuestsList.Add(g);
            dbGuest.SaveChanges();
            return(g);
        }
예제 #10
0
 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));
     }
 }
예제 #11
0
 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));
        }
예제 #13
0
        private void ManageWelcomePack_Click(object sender, RoutedEventArgs e)
        {
            GuestsList newWindow = new GuestsList();

            newWindow.ShowDialog();
        }
예제 #14
0
        public Guest FindGuestsById(int guestId)
        {
            GuestsList dbGuest = new GuestsList();

            return(dbGuest.dbGuestsList.Find(guestId));
        }
예제 #15
0
        public List <Guest> GetGuests()
        {
            GuestsList dbGuest = new GuestsList();

            return(dbGuest.dbGuestsList.ToList());
        }
예제 #16
0
        public string GetMaxTable()
        {
            GuestsList dbGuest = new GuestsList();

            return(dbGuest.dbGuestsList.Max(g => g.TableNo));
        }