Пример #1
0
    private FlightQuery GetFlightQuery()
    {
        if (String.IsNullOrEmpty(Username))
        {
            Username = Page.User.Identity.Name;
        }

        m_fq = new CannedQuery(Username)
        {
            DateRange = FlightQuery.DateRanges.AllTime, QueryName = txtQueryName.Text
        };

        // General text
        m_fq.GeneralText = txtRestrict.Text;

        // Airports:
        if (txtAirports.Text.Length > 0)
        {
            m_fq.AirportList = AirportList.NormalizeAirportList(txtAirports.Text);
        }

        m_fq.Distance = (FlightQuery.FlightDistance)Convert.ToInt32(rblFlightDistance.SelectedValue, CultureInfo.InvariantCulture);

        // Remaining sections
        QueryDateFromForm();
        AircraftFromForm();
        ModelsFromForm();
        AircraftCharacteristicsFromForm();
        FlightCharacteristicsFromForm();
        CatClassFromForm();
        CustomPropsFromForm();

        // Typenames aren't exposed to the user; reset them here.
        m_fq.TypeNames = (string[])ViewState[szKeyVSTypes] ?? new string[0];

        m_fq.Refresh();

        return(m_fq);
    }