Esempio n. 1
0
        public bool SaveCategories(Category category)
        {
            var context = new APPContext();

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

            context.Entry(category).State = System.Data.Entity.EntityState.Deleted;
            return(context.SaveChanges() > 0);
        }
Esempio n. 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());
        }
Esempio n. 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();
        }
Esempio n. 5
0
        public Category GetCategoriesById(int ID)
        {
            var context = new APPContext();

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

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

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

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

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