コード例 #1
0
        private void AddingRedresseur(AddingNewItemEventArgs arg)
        {
            foreach (Redresseur redresseur in ListRedresseur)
            {
                SimpleIoc.Default.GetInstance <IRedresseurService>().Update(redresseur);
            }

            SimpleIoc.Default.GetInstance <IRedresseurService>().Insert();
            ListAutomate = AutomateService.GetAllData();
        }
コード例 #2
0
        public MainViewModel(IProcessService _processService)
        {
            ListAutomate   = AutomateService.GetAllData();
            ListProcess    = SimpleIoc.Default.GetInstance <IProcessService>().GetAllData();
            ListHistorique = SimpleIoc.Default.GetInstance <IHistoriqueService>().GetAllData();
            ListRedresseur = new ObservableCollection <Redresseur>();

            pulseVisibilityParam = new Visibility();
            PulseVisibilityParam = Visibility.Visible;

            tempoVisibilityParam = new Visibility();
            TempoVisibilityParam = Visibility.Visible;
            imageSource          = "../Resources/log_in1.png";

            foreach (DataService.Automate automate in ListAutomate)
            {
                foreach (Redresseur redresseur in ListAutomate[ListAutomate.IndexOf(automate)].Redresseurs)
                {
                    ListRedresseur.Add(redresseur);
                }
            }


            ListEtats = new ObservableCollection <AcoreApplication.Model.Constantes.MODES>();
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "LocalRecette"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "LocalManuel"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "RemoteManuel"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "Supervision"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "RemoteRecette"));


            RedresseurSelected        = null;
            ProcessSelected           = ListProcess[0];
            RecetteSelected           = ProcessSelected.Recettes[0];
            historiqueSelectedSegment = null;

            AddingProcessCommand             = new RelayCommand <Object>(AddingProcess);
            AddingRecetteCommand             = new RelayCommand <AddingNewItemEventArgs>(AddingRecette);
            AddingSegmentCommand             = new RelayCommand <AddingNewItemEventArgs>(AddingSegment);
            AddingRedresseurCommand          = new RelayCommand <AddingNewItemEventArgs>(AddingRedresseur);
            LoadingSegmentCommand            = new RelayCommand <DataGridRowEventArgs>(LoadingSegment);
            EditingSegmentCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingSegment);
            EditingRecetteCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingRecette);
            EditingProcessCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingProcess);
            RegistreLoadingRowCommand        = new RelayCommand <DataGridRowEventArgs>(RegistreLoadingRow);
            SelectedProcessChangedCommand    = new RelayCommand <SelectionChangedEventArgs>(SelectedProcessChanged);
            SelectedRecetteChangedCommand    = new RelayCommand <SelectionChangedEventArgs>(SelectedRecetteChanged);
            SelectedHistoriqueChangedCommand = new RelayCommand <SelectionChangedEventArgs>(SelectedHistoriqueChanged);
            ValideButton = new RelayCommand <Object>(valideButton);
        }