コード例 #1
0
		public ConsultationAdherentsUC(Adherent adherent) {
			InitializeComponent();

			var vm = this.DataContext as ConsultationAdherentsVM;
			vm.SelectedAdherent = adherent;

			Messenger.Default.Register<NMClearFilter>(this, msg => this.ClearFilter());
		}
コード例 #2
0
		/// <summary>
		/// Constructeur pour le mode création
		/// </summary>
		public FormulaireAdherentVM() {
			this.UCParentCode = CodesUC.ConsultationAdherents;
			this.IsEditMode = false;

			this.CreateRepositories();
			this.PopulateCombos();

			this.CurrentAdherent = new Adherent();
			this.CurrentAdherent.DateNaissance = DateTime.Now;

			this.CreateSaveAndJoinCommand();
			Messenger.Default.Register<NMRefreshDatas>(this, m => this.PopulateCombos());
		}
コード例 #3
0
		public FormulaireInscriptionUC(Adherent adherent) {
			InitializeComponent();
			var vm = this.DataContext as FormulaireInscriptionVM;
			vm.SetAdherent(adherent.ID);
		}
コード例 #4
0
		/// <summary>
		/// Constructeur pour le mode édition. On doit passer par l'id pour récupérer l'adhérent car on a changé de contexte.
		/// </summary>
		/// <param name="idAdherent">ID de l'adhérent à éditer</param>
		public FormulaireAdherentVM(Guid idAdherent) {
			this.UCParentCode = CodesUC.ConsultationAdherents;
			this.IsEditMode = true;

			this.CreateRepositories();
			this.PopulateCombos();

			this.CurrentAdherent = this.repoAdherent.GetByKey(idAdherent);

			this.CreateSaveAndJoinCommand();
			Messenger.Default.Register<NMRefreshDatas>(this, m => this.PopulateCombos());
		}
コード例 #5
0
		public override void ExecuteDeleteCommand() {
			if (this.SelectedAdherent != null) {
				this.repoMain.Delete(this.SelectedAdherent);
				this.repoMain.Save();

				this.PopulateAdherents();
				this.SelectedAdherent = this.Adherents.FirstOrDefault();
				this.ShowUserNotification(ResAdherents.InfosAdherentSupprime);
			}
		}
コード例 #6
0
		public override void ExecuteShowDetailsCommand(object selectedItem) {
			if (selectedItem is Adherent) {
				this.SelectedAdherent = selectedItem as Adherent;
			}
		}
コード例 #7
0
		public FormulaireAdherentUC(Adherent adherent) {
			InitializeComponent();
			this.DataContext = new FormulaireAdherentVM(adherent.ID);
		}