Exemple #1
0
        public bool SaveCategories(Category category)
        {
            var context = new APPContext();

            context.Categories.Add(category);
            return(context.SaveChanges() > 0);
        }
Exemple #2
0
        public bool DeleteCategories(Category category)
        {
            var context = new APPContext();

            context.Entry(category).State = System.Data.Entity.EntityState.Deleted;
            return(context.SaveChanges() > 0);
        }
Exemple #3
0
        public int SearchCategoriesCount(string searchTerm)
        {
            var context = new APPContext();

            var category = context.Categories.AsQueryable();

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


            return(category.Count());
        }
Exemple #4
0
        public List <Category> SearchCategories(string searchTerm, int pageNo, int recordSize)
        {
            var context = new APPContext();

            var categories = context.Categories.AsQueryable();

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

            var skipCount = (pageNo - 1) * recordSize;

            return(categories.OrderBy(x => x.Name).Skip(skipCount).Take(recordSize).ToList());

            //return accomodationTypes.ToList();
        }
Exemple #5
0
        public Category GetCategoriesById(int ID)
        {
            var context = new APPContext();

            return(context.Categories.Find(ID));
        }
Exemple #6
0
        public List <Category> GetAllCategories()
        {
            var context = new APPContext();

            return(context.Categories.ToList());
        }
Exemple #7
0
 public RepositoryCommand(APPContext context)
 {
     this._context = context;
 }
Exemple #8
0
 public ApplicationUserStore(APPContext context) : base(context)
 {
 }
 public RepositoryCommand()
 {
     this._context = new APPContext();
 }
 public FileUploadController(APPContext context)
 {
     this.context = context;
 }
Exemple #11
0
 public RepositoryQuery()
 {
     this._context = new APPContext();
 }
Exemple #12
0
 public RepositoryQuery(APPContext context)
 {
     this._context = context;
 }
 public ItemsController(APPContext context)
 {
     _context = context;
 }
Exemple #14
0
        public List <LanguageResource> GetLanguageResources()
        {
            var context = new APPContext();

            return(context.LanguageResources.ToList());
        }
Exemple #15
0
        public Language GetLanguageByShortCode(string shortCode)
        {
            var context = new APPContext();

            return(context.Languages.FirstOrDefault(x => x.ShortCode == shortCode));
        }
Exemple #16
0
        public Language GetDefaultLanguage()
        {
            var context = new APPContext();

            return(context.Languages.FirstOrDefault(x => x.IsDefault));
        }
 public ApplicationRoleStore(APPContext context) : base(context)
 {
 }
Exemple #18
0
 public UserService(APPContext aPPContext)
 {
     _appContext = aPPContext;
 }