Example #1
0
        /// <summary>
        /// Method to get all locations
        /// </summary>
        /// <returns>
        ///     A list of Locations
        /// </returns>
        public async Task <List <Location> > getAllLocationsByRange(int index, int offset)
        {
            try
            {
                List <Location> lLocations = new List <Location>();
                string          dataSource = ConfigurationManager.AppSettings["dataSource"];
                switch (dataSource)
                {
                case "CSV":
                    string fileName = ConfigurationManager.AppSettings["fileLocations"];
                    using (ExcelDL edl = new ExcelDL())
                    {
                        lLocations = await edl.geLocationsByRange(fileName, index, offset);
                    }
                    break;

                default:
                    break;
                }

                return(lLocations);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Method to get all locations 
        /// </summary>
        /// <returns>
        ///     A list of Locations
        /// </returns>
        public async Task<List<Location>> getAllLocationsByRange(int index, int offset)
        {
            try
            {

                List<Location> lLocations = new List<Location>();
                string dataSource = ConfigurationManager.AppSettings["dataSource"];
                switch (dataSource)
                {
                    case "CSV":
                        string fileName = ConfigurationManager.AppSettings["fileLocations"];
                        using (ExcelDL edl = new ExcelDL())
                        {
                            lLocations = await edl.geLocationsByRange(fileName, index, offset);
                        }
                        break;
                    default:
                        break;
                }

                return lLocations;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }