Esempio n. 1
0
 public PagedList <User> GetAllUsers(User user, string orderBy, string orderAs, int page)
 {
     try
     {
         using (IDbContextBase context = DbContextFactory.GetDbContext())
         {
             string           userName = user == null ? "" : user.UserName + "";
             PagedList <User> listUser = context.FindAllByPage <User>(obj => obj.UserName.Contains(userName), orderBy, orderAs, page);
             return(listUser);
         }
     }
     catch
     {
         throw;
     }
 }
Esempio n. 2
0
        public PagedList <City> GetAllCities(City city, string orderBy, string orderAs, int page)
        {
            try
            {
                using (IDbContextBase context = DbContextFactory.GetDbContext())
                {
                    string           name     = city == null ? "" : city.Name + "";
                    PagedList <City> listCity = context.FindAllByPage <City>(obj => obj.Name.Contains(name), orderBy, orderAs, page);

                    return(listCity);
                }
            }
            catch
            {
                throw;
            }
        }
Esempio n. 3
0
        public PagedList <District> GetAllDistricts(District district, string orderBy, string orderAs, int page)
        {
            try
            {
                using (IDbContextBase context = DbContextFactory.GetDbContext())
                {
                    string name = district == null ? "" : district.Name + "";
                    PagedList <District> listDistrict = context.FindAllByPage <District>(obj => obj.Name.Contains(name), orderBy, orderAs, page);

                    return(listDistrict);
                }
            }
            catch
            {
                throw;
            }
        }
Esempio n. 4
0
        //IDbContextBase context = DbContextFactory.GetDbContext();

        public PagedList <Property> GetAllProperties(Property property, string orderBy, string orderAs, int page)
        {
            try
            {
                using (IDbContextBase context = DbContextFactory.GetDbContext())
                {
                    string name = property == null ? "" : property.Name + "";
                    Expression <Func <Property, bool> > conditions = obj => obj.Name.Contains(name);
                    PagedList <Property> listProperty = context.FindAllByPage <Property>(conditions, orderBy, orderAs, page);

                    return(listProperty);
                }
            }
            catch
            {
                throw;
            }
        }