示例#1
0
        private void Validation(object sender, RoutedEventArgs e)
        {
            Jour j = new Jour();

            //DateTime UpdatedTime = laDate.SelectedDate ?? j.date;
            //this.date = DateTime.Parse(this.date.ToString("YYYY/MM/DD"));
            //var uneDate = laDate.SelectedDate.ToString();
            //DateTime convertDate = Convert.ToDateTime(uneDate);

            if (unIntitule.Text == "" || laDate.Text == "" || nbFragments.Text == "0" || unIntitule.Text == "Intitulé")
            {
                PhraseValidation.Visibility = Visibility.Visible;
            }
            else
            {
                PhraseValidation.Visibility = Visibility.Hidden;
                InitBDD bdd = new InitBDD();
                var     con = bdd.ConnectionBDD();
                j.Date     = laDate.SelectedDate.ToString(); //convertDate
                j.Intitule = unIntitule.Text;
                j.Fragment = Int32.Parse(nbFragments.Text);
                j.Insert();

                RemplissageFragments rf = new RemplissageFragments(j);
                this.NavigationService.Navigate(rf);
            }
        }