Beispiel #1
0
        }     //counting goals and setting message in textblock

        private void Btn_Click(object sender, EventArgs e)
        {
            if (sender == rbtn1)
            {
                //redirect to todolist
                ToDoListPage toDoListPage = new ToDoListPage();
                NavigationService.Navigate(toDoListPage);
            }
            else if (sender == rbtn2)
            {
                //redirect to appointment page
                AppointmentPage appointmentPage = new AppointmentPage();
                NavigationService.Navigate(appointmentPage);
            }
            else if (sender == rbtn3)
            {
                //add goal
                ProgressGoal progressgoal = new ProgressGoal();

                progressgoal.Goal = addGoalTextbox.Text;

                db.ProgressGoals.InsertOnSubmit(progressgoal);
                db.SubmitChanges();

                goalListbox.Items.Add(this.addGoalTextbox.Text);

                this.addGoalTextbox.Focus();
                this.addGoalTextbox.Clear();
            }
            else if (sender == rbtn4)
            {
                ProgressGoal progressgoal = new ProgressGoal();

                progressgoal.Goal = chosenGoal;

                //db.ProgressGoals.DeleteOnSubmit(progressgoal);
                //db.SubmitChanges();

                //goalListbox.Items.Remove(this.addGoalTextbox.Text);

                this.addGoalTextbox.Focus();
                this.addGoalTextbox.Clear();
            }
        }
 partial void DeleteProgressGoal(ProgressGoal instance);
 partial void UpdateProgressGoal(ProgressGoal instance);
 partial void InsertProgressGoal(ProgressGoal instance);