Beispiel #1
0
        public bool SavePlace(Place place)
        {
            var context = new BBDbContext();

            context.Places.Add(place);
            return(context.SaveChanges() > 0);
        }
Beispiel #2
0
        public bool UpdatePlace(Place place)
        {
            var context = new BBDbContext();

            context.Entry(place).State = System.Data.Entity.EntityState.Modified;
            return(context.SaveChanges() > 0);
        }
Beispiel #3
0
        public bool SaveCategory(Category category)
        {
            var context = new BBDbContext();

            context.Categories.Add(category);

            return(context.SaveChanges() > 0);
        }
Beispiel #4
0
        public bool DeleteCategory(Category category)
        {
            var context = new BBDbContext();

            context.Entry(category).State = System.Data.Entity.EntityState.Deleted;

            return(context.SaveChanges() > 0);
        }
        public bool DeletePartner(Partner partner)
        {
            var context = new BBDbContext();

            context.Entry(partner).State = System.Data.Entity.EntityState.Deleted;

            return(context.SaveChanges() > 0);
        }
        public bool SavePartner(Partner partner)
        {
            var context = new BBDbContext();

            context.Partners.Add(partner);

            return(context.SaveChanges() > 0);
        }
Beispiel #7
0
        public IEnumerable <Place> SearchPlaces(string search)
        {
            var context = new BBDbContext();
            var place   = context.Places.AsQueryable();

            if (!string.IsNullOrEmpty(search))
            {
                place = place.Where(p => p.Name.ToLower().Contains(search.ToLower()));
            }
            return(place.ToList());
        }
        public IEnumerable <Partner> SearchPartners(string search)
        {
            var context = new BBDbContext();

            var partners = context.Partners.AsQueryable();

            if (!string.IsNullOrEmpty(search))
            {
                partners = partners.Where(a => a.Name.ToLower().Contains(search.ToLower()));
            }

            return(partners.ToList());
        }
Beispiel #9
0
        public IEnumerable <Category> SearchCategory(string search)
        {
            var context = new BBDbContext();

            var category = context.Categories.AsQueryable();

            if (!string.IsNullOrEmpty(search))
            {
                category = category.Where(a => a.Name.ToLower().Contains(search.ToLower()));
            }

            return(category.ToList());
        }
Beispiel #10
0
 public IEnumerable <Category> GetCategories()
 {
     context = new BBDbContext();
     return(context.Categories.ToList());
 }
Beispiel #11
0
        public Partner GetPartnerID(int ID)
        {
            var context = new BBDbContext();

            return(context.Partners.Find(ID));
        }
Beispiel #12
0
        public IEnumerable <Partner> GetPartners()
        {
            var context = new BBDbContext();

            return(context.Partners.ToList());
        }
 public GroupRepository(BBDbContext context) : base(context)
 {
 }
Beispiel #14
0
 public UserRepository(BBDbContext context) : base(context)
 {
 }
 public FileRepository(BBDbContext context) : base(context)
 {
 }
Beispiel #16
0
 public ChatRepository(BBDbContext context) : base(context)
 {
 }
Beispiel #17
0
 public CommentRepository(BBDbContext context) : base(context)
 {
 }
Beispiel #18
0
        public Category GetCategoryID(int ID)
        {
            var context = new BBDbContext();

            return(context.Categories.Find(ID));
        }
Beispiel #19
0
        public Place GetPlaceID(int ID)
        {
            var context = new BBDbContext();

            return(context.Places.Find(ID));
        }
Beispiel #20
0
        public IEnumerable <Place> GetPlaces()
        {
            var context = new BBDbContext();

            return(context.Places.ToList());
        }
Beispiel #21
0
 public ActivityRepository(BBDbContext context) : base(context)
 {
 }