public void UpdateTyperatingAndQualificationsDate()
        {
            LastFlight lf = new LastFlight();

            LastFlight.UpdateRatingDate(lf.AircraftOfLastFlight, lf.DateOfLastFlight);

            if (lf.QualificationNeed != 0)
            {
                LastFlight.UpdateQualificationDate(lf.QualificationNeed, lf.DateOfLastFlight);
            }
        }
        public void AlertFlight()
        {
            a = new UserInfo();

            if (CurrentLocation != a.Location)
            {
                flightAssignmentCtrl.assingmentCtrl.comboTypeRatings();
            }

            if (Flightid != 0)
            {
                if (!f.OnFlight)
                {
                    lblFlightAlert.Text       = String.Format("Alert!! You have one flight with callsign {0}, from {1} to {2} with {3}", FlightCallsign, UserDeparture, UserArrival, UserAircraft);
                    lblFlightAlert.ForeColor  = Color.Red;
                    lblFlightAlert.Visible    = true;
                    label1.Visible            = true;
                    pBarFlightTimeEnd.Visible = true;
                    FlightTimeEndTick.Start();
                }
                else
                {
                    lblFlightAlert.Text       = String.Format("On Flying!! -> {0}, from {1} to {2} with {3}", FlightCallsign, UserDeparture, UserArrival, UserAircraft);
                    lblFlightAlert.ForeColor  = Color.ForestGreen;
                    lblFlightAlert.Visible    = true;
                    label1.Visible            = false;
                    pBarFlightTimeEnd.Visible = false;
                    FlightTimeEndTick.Stop();
                }
            }
            else
            {
                if (a.Location != a.Hub)
                {
                    LastFlight lf = new LastFlight();

                    int RemainingDaysToFlightExpire = ((lf.DateOfFlightExpire - DateTime.UtcNow.Date).Days - 1);

                    if (RemainingDaysToFlightExpire <= -1)
                    {
                        lblFlightAlert.Visible = false;
                        LastFlight.ReturnToHub(a.MediaTotalFlights);
                    }
                    else if (RemainingDaysToFlightExpire == 0)
                    {
                        lblFlightAlert.Text      = String.Format("Alert!! Today is last day to return your hub without penalizations", RemainingDaysToFlightExpire.ToString());
                        lblFlightAlert.ForeColor = Color.Red;
                        lblFlightAlert.Visible   = true;
                    }
                    else
                    {
                        lblFlightAlert.Text      = String.Format("Alert!! You have {0} days to return your hub without penalizations", RemainingDaysToFlightExpire.ToString());
                        lblFlightAlert.ForeColor = Color.Orange;
                        lblFlightAlert.Visible   = true;
                    }
                    label1.Visible            = false;
                    pBarFlightTimeEnd.Visible = false;
                    FlightTimeEndTick.Stop();
                }
                else
                {
                    lblFlightAlert.Visible    = false;
                    label1.Visible            = false;
                    pBarFlightTimeEnd.Visible = false;
                    FlightTimeEndTick.Stop();
                }
            }
            CurrentLocation = a.Location;
        }