public ConsultationAdherentsUC(Adherent adherent) { InitializeComponent(); var vm = this.DataContext as ConsultationAdherentsVM; vm.SelectedAdherent = adherent; Messenger.Default.Register<NMClearFilter>(this, msg => this.ClearFilter()); }
/// <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()); }
public FormulaireInscriptionUC(Adherent adherent) { InitializeComponent(); var vm = this.DataContext as FormulaireInscriptionVM; vm.SetAdherent(adherent.ID); }
/// <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()); }
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); } }
public override void ExecuteShowDetailsCommand(object selectedItem) { if (selectedItem is Adherent) { this.SelectedAdherent = selectedItem as Adherent; } }
public FormulaireAdherentUC(Adherent adherent) { InitializeComponent(); this.DataContext = new FormulaireAdherentVM(adherent.ID); }