Пример #1
0
        private void UpdateContact_Click(object sender, RoutedEventArgs e)
        {
            // parse widgets values to data
            m_CurrentExpense.SetDate(w_DateOfExpense.Date.DateTime);
            int valCents = DataConversion.ConvertCurrencyStringToIntegerCents(w_AmountOfExpense.Text);

            // store data
            ExpenseItem spend = new ExpenseItem(m_CurrentExpense.Id, m_CurrentExpense.GetDateOnly(), valCents);

            App.GlobalPersistanceService.GetExpensesStorage().UpdateDetails(spend);//Update selected DB contact Id

            // interface transition
            Frame.Navigate(typeof(HomePage));
        }
Пример #2
0
        private async void AddExpense_Click(object sender, RoutedEventArgs e)
        {
            if (w_AmountOfExpense.Text != "")
            {
                try
                {
                    int valCents = DataConversion.ConvertCurrencyStringToIntegerCents(w_AmountOfExpense.Text);

                    App.GlobalPersistanceService.GetExpensesStorage().Insert(new ExpenseItem(0, w_DateOfExpense.Date.DateTime, valCents));
                    Frame.Navigate(typeof(DailyPage), w_DateOfExpense.Date.DateTime);
                }
                catch
                {
                }
            }
            else
            {
                MessageDialog messageDialog = new MessageDialog("Please fill two fields");
                await messageDialog.ShowAsync();
            }
        }