protected void btnFindClubs_Click(object sender, EventArgs e)
        {
            txtHomeAirport.Text = HttpUtility.HtmlEncode(txtHomeAirport.Text).ToUpper(CultureInfo.CurrentCulture).Trim();

            SearchResults.Clear();

            bool fAdmin = Page.User.Identity.IsAuthenticated && util.GetIntParam(Request, "a", 0) != 0 && MyFlightbook.Profile.GetUser(Page.User.Identity.Name).CanManageData;

            if (String.IsNullOrEmpty(txtHomeAirport.Text))
            {
                SearchResults.AddRange(Club.AllClubs(fAdmin));
            }
            else
            {
                AirportList    al  = new AirportList(txtHomeAirport.Text);
                List <airport> lst = new List <airport>(al.GetAirportList());
                lst.RemoveAll(ap => !ap.IsPort);

                if (lst.Count == 0)
                {
                    lblErr.Text = Resources.Club.errHomeAirportNotFound;
                    return;
                }

                mfbGoogleMapManager2.Map.SetAirportList(al);
                SearchResults.AddRange(Club.ClubsNearAirport(hdnMatchingHomeAirport.Value = lst[0].Code, fAdmin));
            }

            DisplaySearchResults();
        }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bool fAdmin = Page.User.Identity.IsAuthenticated && util.GetIntParam(Request, "a", 0) != 0 && MyFlightbook.Profile.GetUser(Page.User.Identity.Name).CanManageData;

        gvClubs.DataSource = Club.AllClubs(fAdmin);
        gvClubs.DataBind();
    }