public BaseEntity BuildObject(Dictionary <string, object> row)
        {
            var customer = new GeneralReportAirport
            {
                StoresGain        = 250000,
                GatesGain         = 12000,
                RunwayLandingGain = 50000,
            };

            return(customer);
        }
Esempio n. 2
0
        public GeneralReportAirport RetrieveReport(string airportId)
        {
            GeneralReportAirport reportAirportToReturn = null;

            try
            {
                reportAirportToReturn = crudGeneralReport.Retrieve <GeneralReportAirport>(airportId);
                if (reportAirportToReturn == null)
                {
                    //TODO: Log Exception
                    //The Airport doesn't have any report to process.
                    return(new GeneralReportAirport());
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }

            return(reportAirportToReturn);
        }
        public T Retrieve <T>(string airportId)
        {
            var lstResult = dao.ExecuteDataTableCollectionQuery(GeneralReportMapperInstance.GetRetrieveStatement(airportId));

            if (lstResult.Count > 0)
            {
                var airportStoresTable             = lstResult[0];
                var airlineTable                   = lstResult[1];
                var gateTable                      = lstResult[2];
                var flightList                     = lstResult[3];
                List <FullStoreInformation> stores = airportStoresTable.AsEnumerable().Select(row => new FullStoreInformation
                {
                    Name     = row.Field <string>(StoreNameColName),
                    IDStore  = row.Field <string>(StoreIdColName),
                    Category = new Category
                    {
                        Description = row.Field <string>(StoreDescriptionColName),
                        IDCategory  = row.Field <string>(StoreCategoryIdColName),
                        Status      = row.Field <bool>(StoreStatusColName)
                    },
                    ManagerName = "Cesar Lopez",
                    Rent        = row.Field <decimal>(StoreRentColName)
                }).ToList();
                List <Gate>    gates        = gateTable.AsEnumerable().Select(row => GateMapperInstance.BuildObjectFromDataRow(row)).ToList();
                List <Airline> airlines     = airlineTable.AsEnumerable().Select(row => AirlineMapperInstance.BuildObjectFromDataRow(row)).ToList();
                List <Flight>  flights      = new List <Flight>();
                var            reportResult = new GeneralReportAirport
                {
                    Airlines = airlines,
                    Flights  = flights,
                    Gates    = gates,
                    Stores   = stores
                };
                return((T)Convert.ChangeType(reportResult, typeof(T)));
            }
            return(default(T));
        }