private void WasteSubmit_Click(object sender, RoutedEventArgs e) { if (AmountTextBox.Text != "") { if (CategoriesCombobox.SelectedIndex > -1) { int Amount = Convert.ToInt32(AmountTextBox.Text); Amount *= -1; string category = CategoriesCombobox.SelectedValue.ToString(); string desc = DescriptionVar.Text.ToString(); Classes.Posts post = new Classes.Posts(); bool result = post.AddNewPost(Amount, category, "no", desc, user.email, user.userId); if (result) { UpdateBalance(Amount); var info = new Info(); MaterialDesignThemes.Wpf.DialogHost.Show(info); } else { MessageBox.Show("An error occured."); } } } }
private void ProfitSubmit_Click(object sender, RoutedEventArgs e) { if (AmountTextBox.Text != "") { int Amount = Convert.ToInt32(AmountTextBox.Text); string desc = DescriptionVar.Text.ToString(); Classes.Posts post = new Classes.Posts(); bool result = post.AddNewPost(Amount, "profit", "yes", desc, user.email, user.userId); if (result) { UpdateBalance(Amount); var info = new Info(); MaterialDesignThemes.Wpf.DialogHost.Show(info); } else { MessageBox.Show("An error occured."); } } }