Ejemplo n.º 1
0
        /// <summary>
        /// Charge le module spécifié dans la region désirée
        /// </summary>
        protected virtual void LoadModule(SharingData sharingData, string regionName)
        {
            EventAggregator eventAgg = (EventAggregator)ServiceLocator.Current.GetInstance<IEventAggregator>();
            CompositePresentationEvent<SharingData> fileSharingEvent = eventAgg.GetEvent<CompositePresentationEvent<SharingData>>();
            fileSharingEvent.Publish(sharingData);

            var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
            regionManager.RequestNavigate(regionName, new Uri(sharingData.DestinationModuleName, UriKind.Relative));
        }
Ejemplo n.º 2
0
        public void OnCopyDataReceived(SharingData sharingData)
        {
            if (sharingData.DestinationModuleName != NameOfViews.MainView)
                return;

            UserName = sharingData.UserName;

            User user = ServiceUserHelper.GetUser(sharingData.UserName);
            if (user.Role == "Infirmière")
            {
                LevelVisibility = Visibility.Collapsed;
                CreationVisibility = Visibility.Collapsed;
            }
            else
            {
                LevelVisibility = Visibility.Visible;
                CreationVisibility = Visibility.Visible;
            }
        }
Ejemplo n.º 3
0
        private void LoginCommandAction()
        {
            if (string.IsNullOrEmpty(Login) || string.IsNullOrEmpty(Pwd.Password))
            {
                ErrorMsg = "Les champs de connexion sont imcomplets";
                return;
            }

            if (!DataAccess.ServiceUserHelper.Connect(Login, Pwd.Password))
            {
                ErrorMsg = "Les champs de connexion sont incorrects";
                Pwd.Password = string.Empty;
                return;
            }

            SharingData sharingData = new SharingData()
            {
                DestinationModuleName = NameOfViews.MainView,
                UserName = Login
            };

            LoadModule(sharingData, NameOfRegions.MainRegion);
            Pwd.Password = string.Empty;
        }
Ejemplo n.º 4
0
 private void BackCommandAction()
 {
     SharingData sharingData = new SharingData() { DestinationModuleName = NameOfViews.LoginView };
     LoadModule(sharingData, NameOfRegions.MainRegion);
 }