Ejemplo n.º 1
0
        private async void OnKorrektMessage(int roleId)
        {
            await Windows.ApplicationModel.Core.CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                switch (roleId)
                {
                case 2:
                    SelectedMekanikerDetails = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                    OpgaveArkiv.Mekanikker   = DateTime.Now;
                    break;

                case 3:
                    SelectedCrewDetails = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                    OpgaveArkiv.Crew    = DateTime.Now;
                    break;

                case 4:
                    SelectedFulersDetails = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                    OpgaveArkiv.Fuelers   = DateTime.Now;
                    break;

                case 5:
                    SelectedBaggersDetails = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                    OpgaveArkiv.Baggers    = DateTime.Now;
                    break;

                case 6:
                    SelectedCatersDetails = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                    OpgaveArkiv.Caters    = DateTime.Now;
                    break;

                case 7:
                    SelectedRedcapDetails = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                    OpgaveArkiv.Redcap    = DateTime.Now;
                    break;

                case 9:
                    SelectedRengøringDetails = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                    OpgaveArkiv.Rengøring    = DateTime.Now;
                    break;
                }
                OpgaveAdapter = new OpgaveAdapter(OpgaveArkiv, Flyopgave);

                OnPropertyChanged();

                _dtoOpgaveArkiv.UpdateOpgaveArkiv(OpgaveArkiv, OpgaveArkiv.Id);

                _dtoOpgaveArkiv.LoadOpgaveArkiv();
            });
        }
Ejemplo n.º 2
0
        private async void OnForsinketMessage(int roleId, TimeSpan span)
        {
            await Windows.ApplicationModel.Core.CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DateTime forsinketTime = Flyopgave.Afgang + span;

                switch (roleId)
                {
                case 2:
                    SelectedMekanikerDetails = "Forventet klar: " + forsinketTime;
                    OpgaveArkiv.Mekanikker   = forsinketTime;
                    break;

                case 3:
                    SelectedCrewDetails = "Forventet klar: " + forsinketTime;
                    OpgaveArkiv.Crew    = forsinketTime;
                    break;

                case 4:
                    SelectedFulersDetails = "Forventet klar: " + forsinketTime;
                    OpgaveArkiv.Fuelers   = forsinketTime;
                    break;

                case 5:
                    SelectedBaggersDetails = "Forventet klar: " + forsinketTime;
                    OpgaveArkiv.Baggers    = forsinketTime;
                    break;

                case 6:
                    SelectedCatersDetails = "Forventet klar: " + forsinketTime;
                    OpgaveArkiv.Caters    = forsinketTime;
                    break;

                case 7:
                    SelectedRedcapDetails = "Forventet klar: " + forsinketTime;
                    OpgaveArkiv.Redcap    = forsinketTime;
                    break;

                case 9:
                    SelectedRengøringDetails = "Forventet klar: " + forsinketTime;
                    OpgaveArkiv.Rengøring    = forsinketTime;
                    break;
                }
                OpgaveAdapter = new OpgaveAdapter(OpgaveArkiv, Flyopgave);
                OnPropertyChanged();
                _dtoOpgaveArkiv.UpdateOpgaveArkiv(OpgaveArkiv, OpgaveArkiv.Id);

                _dtoOpgaveArkiv.LoadOpgaveArkiv();
            });
        }
Ejemplo n.º 3
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            //#FFFF3333 - red
            //#FF51EC24 - green
            //#FFFFE43A - yellow
            //#FFFFFFFF - white
            SolidColorBrush green  = new SolidColorBrush(Colors.Green);
            SolidColorBrush red    = new SolidColorBrush(Colors.Red);
            SolidColorBrush yellow = new SolidColorBrush(Colors.Yellow);
            SolidColorBrush white  = new SolidColorBrush(Colors.GhostWhite);

            OpgaveAdapter opg = (OpgaveAdapter)value;


            if (opg != null)
            {
                OpgaveArkiv arkiv = opg.OpgaveArkiv;
                Flyopgave   rute  = opg.Flyopgave;

                if (arkiv.Mekanikker == DateTime.Parse("01-01-1995") && rute.Ankomst > DateTime.Now)
                {
                    return(white);
                }
                if (arkiv.Mekanikker == DateTime.Parse("01-01-1995"))
                {
                    return(red);
                }
                if (rute.Ankomst > DateTime.Now)
                {
                    return(white);
                }
                if (arkiv.Mekanikker > rute.Afgang)
                {
                    return(yellow);
                }
                if (arkiv.Mekanikker < rute.Afgang)
                {
                    return(green);
                }
                if (arkiv.Mekanikker == null)
                {
                    return(white);
                }
            }

            return(null);
        }
Ejemplo n.º 4
0
        public void InitData()
        {
            _dtoHangar      = DtoHangarSingleton.GetInstance;
            _dtoFly         = DtoFlySingleton.GetInstance;
            _dtoOpgaveArkiv = DtoOpgaveArkivSingleton.GetInstance;
            _dataMessenger  = DataMessengerSingleton.GetInstance;
            _dtoRoles       = DtoRolesSingleton.GetInstance;
            LogInBrugernavn = _dataMessenger.BrugerLogIn.BrugerNavn;

            LogInRole = _dtoRoles.RolesListe.First(x => x.Id.Equals(_dataMessenger.BrugerLogIn.RoleId)).ToString();
            var s = DataMessengerSingleton.GetInstance;

            Flyopgave     = s.Flyopgave;
            OpgaveArkiv   = _dtoOpgaveArkiv.OpgaveArkivListe.Single(x => x.FlyopgaveId.Equals(Flyopgave.Id));
            FlyopgaveNr   = Flyopgave.FlyopgaveNummer;
            Afgang        = Flyopgave.AfgangSomText;
            FlyId         = Flyopgave.FlyId;
            HangarId      = Flyopgave.HangarId;
            FlyType       = GetFlyObject();
            Hangar        = GetHangarObject();
            OpgaveAdapter = new OpgaveAdapter(OpgaveArkiv, Flyopgave);
            OpgaveArkivinit();
            CountdownToDeadline();
        }