public override void ExecuteSaveCommand() {
			var errors = new List<string>();

			if (this.CheckFormValidity(errors)) {
				this.CurrentInfosClub.ID = Guid.NewGuid();
				this._repoInfosClub.Add(this.CurrentInfosClub);
				this._repoInfosClub.Save();

				// on créé aussi la saison courante
				var saison = new Saison()
				{
					ID = Guid.NewGuid(),
					AnneeDebut = DateTime.Now.Year,
					AnneeFin = DateTime.Now.Year + 1,
					EstSaisonCourante = true
				};
				this._repoSaisons.Add(saison);
				this._repoSaisons.Save();

				Messenger.Default.Send(new NMMainMenuState(true));
			
				base.ExecuteSaveCommand();
			}
			else {
				this.ShowUserNotifications(errors);
			}
		}
示例#2
0
		public FormulaireSaisonVM() {
			this.repoSaison = new Repository<Saison>(this._context);

			this.CurrentSaison = new Saison()
			{
				AnneeDebut = DateTime.Now.Year,
				EstSaisonCourante = false
			};

			this.UCParentCode = CodesUC.ConsultationSaisons;
		}
示例#3
0
		private void UpdateInfosSaisonCourante(Saison saison) {
			this.InfosSaisonCourante = saison.ToShortString();
		}