예제 #1
0
        public PageSaisieObjet()
        {
            InitializeComponent();
            Mail m = NavigateMail.GetNavigationData(this.NavigationService);

            if (m != null && m.Objet != null && m.Objet.Length > 0)
            {
                textBox_Objet.Text = m.Objet;
            }
        }
예제 #2
0
        private void button_Suivant_Etape_Click(object sender, RoutedEventArgs e)
        {
            Mail mail = NavigateMail.GetNavigationData(this.NavigationService);

            if (textBox_Objet.Text.Length > 0)
            {
                mail.Objet = textBox_Objet.Text;

                NavigateMail.Navigate(this.NavigationService, new Uri("./EnvoyerMail/PageSaisieMessage.xaml", UriKind.Relative), mail);
            }
            else
            {
                label_Erreur.Content = "Veuillez saisir un objet";
            }
        }
        //TO DO : Verifier format adresse mail saisie

        public PageSaisieDestinataire()
        {
            InitializeComponent();

            listViewContacts.ItemsSource = NavigateContact.getContacts();
            int count = listViewContacts.Items.Count;

            if (count == 0)
            {
                listViewContacts.Visibility = Visibility.Hidden;
                button_Suivant.Visibility   = Visibility.Hidden;
                button_Precedent.Visibility = Visibility.Hidden;
                label_listevide.Visibility  = Visibility.Visible;
                label_listevide.Content     = "Aucun contact enregistré trouvé";
            }
            else
            {
                listViewContacts.Visibility = Visibility.Visible;
                button_Suivant.Visibility   = Visibility.Visible;
                button_Precedent.Visibility = Visibility.Visible;
                label_listevide.Visibility  = Visibility.Hidden;


                //Selection du premier contact de liste
                listViewContacts.SelectedIndex = 0;
                listViewContacts.Focus();
            }

            Mail   m    = NavigateMail.GetNavigationData(this.NavigationService);
            string dest = "";

            if (m != null && m.Destinataires != null && m.Destinataires.Count > 0)
            {
                foreach (string des in m.Destinataires)
                {
                    if (dest != "")
                    {
                        dest = string.Concat(dest, ",", des);
                    }
                    else
                    {
                        dest = des;
                    }
                }
            }

            textBox_Destinataire.Text = dest;
        }
        public PageConfirmation()
        {
            InitializeComponent();
            Mail mail = NavigateMail.GetNavigationData(this.NavigationService);

            if (mail.estEnvoye)
            {
                label_Fin.Foreground = System.Windows.Media.Brushes.Green;
                label_Fin.Content    = "Message bien envoyé";
            }
            else
            {
                label_Fin.Foreground = System.Windows.Media.Brushes.Red;
                label_Fin.Content    = "Mail non envoyé, une erreur s'est produite ! Merci de reessayer plus tard.";
            }
        }
예제 #5
0
        private void button_Envoyer_Click(object sender, RoutedEventArgs e)
        {
            Mail mail = NavigateMail.GetNavigationData(this.NavigationService);

            if (textBox_Message.Text.Length > 0)
            {
                mail.Message = textBox_Message.Text;

                bool res = EnvoiMailHelper.Instance.EnvoyerMail(mail);

                mail.estEnvoye = res;

                NavigateMail.Navigate(this.NavigationService, new Uri("./EnvoyerMail/PageConfirmation.xaml", UriKind.Relative), mail);
            }
            else
            {
                label_Erreur.Content = "Veuillez saisir un message";
            }
        }
        private void button_Suivant_Etape_Click(object sender, RoutedEventArgs e)
        {
            if (textBox_Destinataire.Text.Length > 0)
            {
                string[]      tokens = textBox_Destinataire.Text.Split(',');
                Mail          mail   = new Mail();
                List <string> liste_destinataires = new List <string>();
                for (int i = 0; i < tokens.Length; i++)
                {
                    liste_destinataires.Add(tokens[i]);
                }
                mail.Destinataires = liste_destinataires;

                NavigateMail.Navigate(this.NavigationService, new Uri("./EnvoyerMail/PageSaisieObjet.xaml", UriKind.Relative), mail);
            }
            else
            {
                label_Erreur.Content = "Veuillez saisir l'adresse mail du destinataire !";
            }
        }