Ejemplo n.º 1
0
		private void GenererVCardsGroupeUniqueCallBack(string savePath) {
			if (!string.IsNullOrWhiteSpace(savePath)) {
				var sb = new StringBuilder();

				foreach (Inscription ins in this.SelectedGroupe.Inscriptions.Where(ins => ins.StatutInscription.Ordre != 3)) {
					var gen = new VcardGenerator21(ins.Adherent.Prenom, ins.Adherent.Nom);

					gen.AddEmailInternet(ins.Adherent.Mail1);
					gen.AddTelWork(ins.Adherent.Telephone1);
					gen.AddOrganization(ins.Groupe.ToString());

					sb.AppendLine(gen.GetVCard());
				}

				var fileName = string.Concat(savePath, "/", this.SelectedGroupe.Libelle, ResVCards.ExtensionVcf);

				using (var sw = new StreamWriter(fileName)) {
					sw.Write(sb.ToString());
				}

				this.ShowUserNotification(string.Format(ResGroupes.InfosVCardsUniqueGenerees, this.SelectedGroupe.Inscriptions.Count().ToString()));
			}
		}
		private void GenererVCardCallBack(string filePath) {
			if (!string.IsNullOrWhiteSpace(filePath)) {
				var gen = new VcardGenerator21(this.SelectedInscription.Adherent.Prenom, this.SelectedInscription.Adherent.Nom);
				
				gen.AddEmailInternet(this.SelectedInscription.Adherent.Mail1);
				gen.AddTelWork(this.SelectedInscription.Adherent.Telephone1);
				gen.AddOrganization(this.SelectedInscription.Groupe.ToString());

				using (var sw = new StreamWriter(filePath)) {
					sw.Write(gen.GetVCard());
				}

				this.ShowUserNotification(ResInscriptions.InfosVCardGeneree);
			}
		}