Ejemplo n.º 1
0
        public IEnumerable <R_Checkpoint> GetCheckpointListByPlannedRouteId(int itemId)
        {
            IEnumerable <R_Checkpoint> results = null;

            var sql = PetaPoco.Sql.Builder
                      .Select("*")
                      .From("R_Checkpoint")
                      .Where("IsDeleted = 0 and PlannedRouteId = @0", itemId)
            ;

            results = R_Checkpoint.Query(sql);

            return(results);
        }
Ejemplo n.º 2
0
        public IEnumerable <R_Checkpoint> GetCheckpoints()
        {
            IEnumerable <R_Checkpoint> results = null;

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

            ;

            results = R_Checkpoint.Query(sql);

            return(results);
        }
Ejemplo n.º 3
0
        public IEnumerable <R_Checkpoint> GetCheckpointListAdvancedSearch(
            int?plannedRouteId
            , string name
            , int?orderNumber
            , double?latitude
            , double?longitude
            , int?addressId
            , int?estimatedTimeArrival
            , System.DateTime?minimumTimeFrom
            , System.DateTime?minimumTimeTo
            , System.DateTime?maximumTimeFrom
            , System.DateTime?maximumTimeTo
            , int?nucleoId
            , int?supplierId
            , bool?active
            )
        {
            IEnumerable <R_Checkpoint> results = null;

            var sql = PetaPoco.Sql.Builder
                      .Select("*")
                      .From("R_Checkpoint")
                      .Where("IsDeleted = 0"
                             + (plannedRouteId != null ? " and PlannedRouteId = " + plannedRouteId : "")
                             + (name != null ? " and Name like '%" + name + "%'" : "")
                             + (orderNumber != null ? " and OrderNumber = " + orderNumber : "")
                             + (latitude != null ? " and Latitude like '%" + latitude + "%'" : "")
                             + (longitude != null ? " and Longitude like '%" + longitude + "%'" : "")
                             + (addressId != null ? " and AddressId like '%" + addressId + "%'" : "")
                             + (estimatedTimeArrival != null ? " and EstimatedTimeArrival = " + estimatedTimeArrival : "")
                             + (minimumTimeFrom != null ? " and MinimumTime >= '" + minimumTimeFrom.Value.ToShortDateString() + "'" : "")
                             + (minimumTimeTo != null ? " and MinimumTime <= '" + minimumTimeTo.Value.ToShortDateString() + "'" : "")
                             + (maximumTimeFrom != null ? " and MaximumTime >= '" + maximumTimeFrom.Value.ToShortDateString() + "'" : "")
                             + (maximumTimeTo != null ? " and MaximumTime <= '" + maximumTimeTo.Value.ToShortDateString() + "'" : "")
                             + (nucleoId != null ? " and NucleoId like '%" + nucleoId + "%'" : "")
                             + (supplierId != null ? " and SupplierId like '%" + supplierId + "%'" : "")
                             + (active != null ? " and Active = " + (active == true ? "1" : "0") : "")
                             )
            ;

            results = R_Checkpoint.Query(sql);

            return(results);
        }