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

            context.Categories.Add(category);
            return(context.SaveChanges() > 0);
        }
Ejemplo 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);
        }
Ejemplo 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());
        }
Ejemplo 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();
        }
Ejemplo n.º 5
0
        public Category GetCategoriesById(int ID)
        {
            var context = new APPContext();

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

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

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

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

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