private void btn_RefreshEntryList_Click(object sender, RoutedEventArgs e) { var entrySource = Entry_Form.RefreshEntries(); datagrid_Entries.Items.Clear(); AddDataToGrid(entrySource); }
private void btn_DeleteEntry_Click(object sender, RoutedEventArgs e) { String entryString = (combobox_EntryStatus.Text.ToString() + "," + datepicker_Date.Text + "," + txtbox_Account.Text.ToString() + "," + txtbox_Amount.Text.ToString() + "," + txtbox_Description.Text.ToString()); int entrySelected = datagrid_Entries.SelectedIndex; String allEntriesWithEdit = ""; datagrid_Entries.SelectedItem = -1; // clear entry slection so that it doesnt cause errorfergfff for (int i = 0; i < datagrid_Entries.Items.Count; i++) { if (i == entrySelected) { MessageBoxResult result = MessageBox.Show("Are You Sure?", "", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { allEntriesWithEdit += ""; } else { allEntriesWithEdit += GetEntrySelectedAsString(i); } } else { allEntriesWithEdit += GetEntrySelectedAsString(i); } allEntriesWithEdit += "\n"; } Entry_Form.EditEntry(allEntriesWithEdit); AutoRefresh(); }
public void AutoRefresh() { var entrySource = Entry_Form.RefreshEntries(); datagrid_Entries.Items.Clear(); AddDataToGrid(entrySource); }
private void btn_SubmitEntry_Click(object sender, RoutedEventArgs e) { Entry_Form.SubmitEntry(combobox_EntryStatus.Text.ToString() + "," + datepicker_Date.Text + "," + txtbox_Account.Text.ToString() + "," + txtbox_Amount.Text.ToString() + "," + txtbox_Description.Text.ToString()); AutoRefresh(); }