Ejemplo n.º 1
0
        public phone_booking AddNewBooking(phone_booking phone)
        {
            phone_booking book = null;

            book = context.phone_booking.Add(phone);
            context.SaveChanges();
            return(book);
        }
Ejemplo n.º 2
0
        public phone_booking FindById(int id)
        {
            phone_booking book = null;

            try
            {
                book = context.phone_booking.FirstOrDefault(e => e.id == id);
            }
            catch (Exception e) { }
            return(book);
        }
Ejemplo n.º 3
0
        public phone_booking EditPhoneBooking(int id, String status)
        {
            phone_booking phone = null;

            try
            {
                phone = FindById(id);
                if (phone != null)
                {
                    phone.status = status;
                    context.SaveChanges();
                }
            }
            catch (Exception e) { }
            return(phone);
        }