Exemple #1
0
 public void AddShow(Show show)
 {
     using (var context = new StarShowDBEntities())
     {
         context.Shows.Add(show);
     }
 }
Exemple #2
0
 public void AddUser(User user)
 {
     using (var context = new StarShowDBEntities())
     {
         context.Users.Add(user);
     }
 }
 public void AddSlot(Slot slot)
 {
     using (var context = new StarShowDBEntities())
     {
         context.Slots.Add(slot);
     }
 }
 public void AddLocation(Location location)
 {
     using (var context = new StarShowDBEntities())
     {
         context.Locations.Add(location);
     }
 }
 public bool DeleteLocation(Location location)
 {
     using (var context = new StarShowDBEntities())
     {
         context.Locations.Remove(location);
     }
     return(true);
 }
 public bool DeleteOrder(Order order)
 {
     using (var context = new StarShowDBEntities())
     {
         context.Orders.Remove(order);
     }
     return(true);
 }
Exemple #7
0
 public void UpdateShow(Show show)
 {
     using (var context = new StarShowDBEntities())
     {
         Show _show = context.Shows.Where(q => q.id == show.id).FirstOrDefault();
         _show = show;
         context.SaveChanges();
     }
 }
 public void UpdateLocation(Location location)
 {
     using (var context = new StarShowDBEntities())
     {
         Location l = context.Locations.Where(q => q.id == location.id).FirstOrDefault();
         l = location;
         context.SaveChanges();
     }
 }
 public void UpdateSlot(Slot slot)
 {
     using (var context = new StarShowDBEntities())
     {
         Slot _slot = context.Slots.Where(q => q.id == slot.id).FirstOrDefault();
         _slot = slot;
         context.SaveChanges();
     }
 }
Exemple #10
0
 public bool DeleteSlot(string id)
 {
     using (var context = new StarShowDBEntities())
     {
         Slot slot = context.Slots.Where(q => q.id == id).FirstOrDefault();
         context.Slots.Remove(slot);
     }
     return(true);
 }
Exemple #11
0
 public bool DeleteShow(string id)
 {
     using (var context = new StarShowDBEntities())
     {
         Show show = context.Shows.Where(q => q.id == id).FirstOrDefault();
         show.status = 0;
         context.SaveChanges();
     }
     return(true);
 }
        public List <Order> GetOrders()
        {
            List <Order> orders;

            using (var context = new StarShowDBEntities())
            {
                orders = context.Orders.ToList();
            }
            return(orders);
        }
        public Order GetOrder(string id)
        {
            Order order;

            using (var context = new StarShowDBEntities())
            {
                order = context.Orders.Where(q => q.id == id).FirstOrDefault();
            }
            return(order);
        }
Exemple #14
0
        public List <Show> GetShows()
        {
            List <Show> shows;

            using (var context = new StarShowDBEntities())
            {
                shows = context.Shows.Where(q => q.status != 0).ToList();
            }
            return(shows);
        }
Exemple #15
0
        public List <Slot> GetSlots()
        {
            List <Slot> slots;

            using (var context = new StarShowDBEntities())
            {
                slots = context.Slots.ToList();
            }
            return(slots);
        }
Exemple #16
0
        public Slot GetSlot(string id)
        {
            Slot slot;

            using (var context = new StarShowDBEntities())
            {
                slot = context.Slots.Where(q => q.id == id).FirstOrDefault();
            }
            return(slot);
        }
Exemple #17
0
        public List <User> GetUsers()
        {
            List <User> users;

            using (var context = new StarShowDBEntities())
            {
                users = context.Users.ToList();
            }
            return(users);
        }
Exemple #18
0
        public Show GetShow(string id)
        {
            Show show;

            using (var context = new StarShowDBEntities())
            {
                show = context.Shows.Where(q => q.id == id && q.status != 0).FirstOrDefault();
            }
            return(show);
        }
        public Location GetLocation(string id)
        {
            Location location;

            using (var context = new StarShowDBEntities())
            {
                location = context.Locations.Where(q => q.id == id).FirstOrDefault();
            }
            return(location);
        }
        public List <Location> GetLocations()
        {
            List <Location> locations;

            using (var context = new StarShowDBEntities())
            {
                locations = context.Locations.ToList();
            }
            return(locations);
        }