Exemplo n.º 1
0
        public IEnumerable <R_Parish> GetParishListAdvancedSearch(
            int?countyId
            , int?districtId
            , int?countryId
            , string name
            , string code
            , double?latitude
            , double?longitude
            , bool?active
            )
        {
            IEnumerable <R_Parish> results = null;

            var sql = PetaPoco.Sql.Builder
                      .Select("*")
                      .From("R_Parish")
                      .Where("IsDeleted = 0"
                             + (countyId != null ? " and CountyId like '%" + countyId + "%'" : "")
                             + (districtId != null ? " and DistrictId like '%" + districtId + "%'" : "")
                             + (countryId != null ? " and CountryId like '%" + countryId + "%'" : "")
                             + (name != null ? " and Name like '%" + name + "%'" : "")
                             + (code != null ? " and Code like '%" + code + "%'" : "")
                             + (latitude != null ? " and Latitude like '%" + latitude + "%'" : "")
                             + (longitude != null ? " and Longitude like '%" + longitude + "%'" : "")
                             + (active != null ? " and Active = " + (active == true ? "1" : "0") : "")
                             )
            ;

            results = R_Parish.Query(sql);

            return(results);
        }
Exemplo n.º 2
0
        public IEnumerable <R_Parish> GetParishs()
        {
            IEnumerable <R_Parish> results = null;

            var sql = PetaPoco.Sql.Builder
                      .Select("*")
                      .From("R_Parish")
                      .Where("IsDeleted = 0")

            ;

            results = R_Parish.Query(sql);

            return(results);
        }