Ejemplo n.º 1
0
        public IHttpActionResult Put(Users value)
        {
            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                var entity = db.Users.FirstOrDefault(e => e.UsersId == value.UsersId);

                entity.Names       = value.Names;
                entity.Passwords   = value.Passwords;
                entity.Email       = value.Email;
                entity.Department  = value.Department;
                entity.Nationality = value.Nationality;
                entity.Profilepic  = value.Profilepic;
                entity.Code        = value.Code;

                db.SaveChanges();
            }
            try
            {
                string message = "Added";
                return(Ok(message));
            }
            catch (Exception ex)
            {
                string message = "Add Fail" + ex.Message;
                return(Ok(message));
            }
        }
Ejemplo n.º 2
0
        public IHttpActionResult Get()
        {
            List <Booking> bookingList = new List <Booking>();

            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                List <cancelbooking> BookingList = (from b in db.Users
                                                    join c in db.Booking
                                                    on b.UsersId equals c.UsersId
                                                    where (c.Status == "Approve")
                                                    orderby(c.BookingId) descending
                                                    select new cancelbooking
                {
                    BookingId = c.BookingId,
                    UsersId = b.UsersId,
                    RoomId = c.RoomId,
                    Name = c.Name,
                    Title = c.Title,
                    Location = c.Location,
                    Date = c.Date,
                    Time = c.Time,
                    Status = c.Status,
                    Username = b.Names
                }).ToList();

                return(Ok(BookingList));
            }
        }
Ejemplo n.º 3
0
        public IHttpActionResult Get()
        {
            List <schedule> schedulelists = new List <schedule>();

            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                List <schedule> schedulelist = (from b in db.Users
                                                join c in db.Booking
                                                on b.UsersId equals c.UsersId
                                                join e in db.Room on c.RoomId equals e.RoomId
                                                where (c.Status == "Approve")
                                                select new schedule
                {
                    Roompic = e.Image,
                    BookingId = c.BookingId,
                    UsersId = b.UsersId,
                    RoomId = c.RoomId,
                    Name = c.Name,
                    Title = c.Title,
                    Location = c.Location,
                    Date = c.Date,
                    Time = c.Time,
                    Status = c.Status,
                    Username = b.Names
                }).ToList();

                return(Ok(schedulelist));
            }
        }
Ejemplo n.º 4
0
        public IHttpActionResult Get()
        {
            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                List <BookingAppilcation> BookingApplicationList = (from d in db.Booking
                                                                    join e in db.Users on d.UsersId equals e.UsersId
                                                                    where (d.Status == "New")
                                                                    select new BookingAppilcation
                {
                    Username = e.Names,
                    BookingId = d.BookingId,
                    UserId = d.UsersId,
                    RoomName = d.Name,
                    Title = d.Title,
                    Status = d.Status,
                    Location = d.Location,
                    Time = d.Time,
                    Date = d.Date,
                }).ToList();



                return(Ok(BookingApplicationList));
            }
        }
        public IHttpActionResult Get()
        {
            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                List <Data> CancellationList = (from c in db.Cancellation
                                                join d in db.Booking
                                                on c.BookingId equals d.BookingId
                                                join e in db.Users on d.UsersId equals e.UsersId
                                                where (c.Status == "New")
                                                select new Data
                {
                    Username = e.Names,
                    CancelId = c.CancellationId,
                    BookingId = d.BookingId,
                    RoomName = d.Name,
                    Title = d.Title,
                    Status = c.Status,
                    Reason = c.Reason,
                    Location = d.Location,
                    Time = d.Time,
                    Date = d.Date,
                }).ToList();



                return(Ok(CancellationList));
            }
        }
Ejemplo n.º 6
0
        public IHttpActionResult Get()
        {
            List <Booking> bookingList = new List <Booking>();

            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                bookingList = db.Booking.ToList();

                return(Ok(bookingList));
            }
        }
        public IHttpActionResult Get()
        {
            List <Booking> bookingList = new List <Booking>();

            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                bookingList = db.Booking.Where(a => a.Status == "Approve").OrderBy(a => a.BookingId).ToList();

                return(Ok(bookingList));
            }
        }
Ejemplo n.º 8
0
        public IHttpActionResult Get()
        {
            List <Cancellation> cancelList = new List <Cancellation>();

            using (ezbookdatabaseContext db = new ezbookdatabaseContext())
            {
                cancelList = db.Cancellation.Where(a => a.Status == "New").OrderBy(a => a.CancellationId).ToList();

                return(Ok(cancelList));
            }
        }
Ejemplo n.º 9
0
 public IHttpActionResult Get()
 {
     using (ezbookdatabaseContext db = new ezbookdatabaseContext())
     {
         List <UserData> User = (from u in db.Users
                                 select new UserData
         {
             UsersId = u.UsersId,
             Names = u.Names,
             Passwords = u.Passwords,
             Email = u.Email,
             Department = u.Department,
             StartDate = u.StartDate,
             Nationality = u.Nationality,
             Position = u.Position,
             Code = u.Code,
             Profilepic = u.Profilepic,
         }).ToList();
         return(Ok(User));
     }
 }