Example #1
0
        //Ajout d'une nouvelle tache dans la list du jour
        public void AddItem(object sender, RoutedEventArgs e)
        {
            if (tbx_libellePomodoro.Text != "")
            {
                try
                {
                    TagsDataAccess tagData = new TagsDataAccess();
                    Tag            tag     = tagData.GetTagByLibelle(tbx_libellePomodoro.Text);
                    if (tag == null)
                    {
                        tag = new Tag
                        {
                            Libelle = tbx_libellePomodoro.Text
                        };
                        tagData.SaveTag(tag);
                        lbx_pomodoro.Items.Add(tag);
                        GetTags();
                    }
                    else
                    {
                        lbx_pomodoro.Items.Add(tag);
                    }
                }
                catch
                {
                    MessageBox.Show("Sauvegarde du Tag " + tbx_libellePomodoro.Text + " impossible.");
                }

                tbx_libellePomodoro.Text = "";
            }
        }
Example #2
0
        public void GetTags()
        {
            TagsDataAccess tagData = new TagsDataAccess();

            lbx_pomodoro_bdd.ItemsSource = tagData.getTags();
        }