Example #1
0
        private void EditSaveGoals_Click(object sender, RoutedEventArgs e)
        {
            var goals = repo.GetGoalsById(goalInput.GoalsId);

            goals.GoalCost  = Convert.ToDecimal(goalCost.Text);
            goals.GoalDate  = goalDate.SelectedDate;
            goals.GoalType  = goalType.SelectedValue.ToString();
            goals.GoalTitle = goalTitle.Text;
            repo.Save();
            MainWindow.goalslist.Items.Refresh();
            this.Close();
        }
Example #2
0
        public void Save_Click(object sender, RoutedEventArgs e)
        {
            string moneyin = Salary.Text;
            int    salary  = Int32.Parse(moneyin);

            string moneyout = Expenses.Text;
            int    expenses = Int32.Parse(moneyout);

            MoneyInfo moneyinfo = repo.GetorCreate();

            moneyinfo.Expenses   = expenses;
            moneyinfo.Salary     = salary;
            moneyinfo.Difference = salary - expenses;
            repo.Save();
            MoneyInfoList.Items.Refresh();
        }