コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.User.Identity.IsAuthenticated)
        {
            throw new UnauthorizedAccessException("You must be signed in to view this page.");
        }

        InitWizard(wzFlightsFromTelemetry);
        if (IsPostBack)
        {
            Session[SessionKeyTZ]  = TimeZone.SelectedTimeZone;
            Session[SessionKeyOpt] = AutofillOptionsChooser.Options;
        }
        else
        {
            Profile pf = Profile.GetUser(Page.User.Identity.Name);
            if (pf.PreferredTimeZone != null && Session[SessionKeyTZ] == null)
            {
                Session[SessionKeyTZ] = pf.PreferredTimeZone;
            }

            if (Session[SessionKeyTZ] != null)
            {
                TimeZone.SelectedTimeZone = (TimeZoneInfo)Session[SessionKeyTZ];
            }

            AutoFillOptions afo = AutoFillOptions.DefaultOptionsForUser(Page.User.Identity.Name);
            afo.SaveForUser(Page.User.Identity.Name);
            Session[SessionKeyOpt] = afo;
        }
    }
コード例 #2
0
ファイル: Leon.cs プロジェクト: ericberman/MyFlightbookWeb
        private static void AutoComplete(LogbookEntry le)
        {
            // Issue #939: autofill cross-country/night, when possible.
            AutoFillOptions afo = AutoFillOptions.DefaultOptionsForUser(le.User);

            if (afo != null && le.CrossCountry == 0.0M)
            {
                if (le.Nighttime == 0.0M)
                {
                    using (FlightData fd = new FlightData())
                        fd.AutoFill(le, afo);
                }
                else  // just do xc time based on part 121 xc
                {
                    CannedQuery fq = new CannedQuery()
                    {
                        Distance = FlightQuery.FlightDistance.NonLocalOnly
                    };
                    if (fq.IsAirportMatch(le))
                    {
                        le.CrossCountry = le.TotalFlightTime;
                    }
                }
            }
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Options = AutoFillOptions.DefaultOptionsForUser(Page.User.Identity.Name);
         Options.TimeZoneOffset = TimeZoneOffset;
     }
 }