shipLocationDate GetShipLocationDateForSectionAndRow(int section, int rowIndex)
        {
            switch (section)
            {
            case 0:
                return(CurrentShipDates.Where(o => o.shiplocationdatetype == "namehistory").ElementAt(rowIndex));

            case 1:
                return(CurrentShipDates.Where(o => o.shiplocationdatetype == "log").ElementAt(rowIndex));
            }
            throw new Exception("Invalid section row data retrieval");
        }
        public override nint RowsInSection(UITableView tableView, nint section)
        {
            switch (section)
            {
            case 0:
                return(CurrentShipDates.Count(o => o.shiplocationdatetype == "namehistory"));

            case 1:
                return(CurrentShipDates.Count(o => o.shiplocationdatetype == "log"));
            }
            throw new Exception("Invalid section row retrieval");
        }
        private void UpdateSearch()
        {
            if (string.IsNullOrEmpty(SearchController.SearchBar.Text))
            {
                SearchShipDates = null;
            }
            else
            {
                SearchShipDates = AllShipDates.Where(r => r.shipID.ToLower().Contains(SearchController.SearchBar.Text.ToLower())).ToList();
            }

            if (this.FilterApplied)
            {
                SearchShipDates = CurrentShipDates.Where(r =>
                {
                    if (string.IsNullOrEmpty(r.startdate))
                    {
                        return(false);
                    }

                    var startDate    = DateTime.Parse(r.startdate).Date;
                    var maxStartDate = this.FilterDateTime + TimeSpan.FromDays(this.FilterDayRange);
                    var minStartDate = this.FilterDateTime - TimeSpan.FromDays(this.FilterDayRange);

                    if (startDate < minStartDate ||
                        startDate > maxStartDate)
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }).ToList();
            }

            TableView.ReloadData();
        }