/* private void Start_SelectedDateChanged(object sender, SelectionChangedEventArgs e) { txtROCEnd.DisplayDateEnd = new DateTime(2200, 1, 1); txtROCEnd.DisplayDateStart = txtROCStart.SelectedDate; } private void End_SelectedDateChanged(object sender, SelectionChangedEventArgs e) { txtROCStart.DisplayDateStart = new DateTime(1900, 1, 1); txtROCStart.DisplayDateEnd = txtROCEnd.SelectedDate; }*/ private void dtgList_CellClick(object sender, EventArgs e) { try { int pos = dtgList.CurrentRow.Index; if (pos < FundAgency.FundingDT.Rows.Count) { String agencyID = dtgList.CurrentRow.Cells[0].Value.ToString(); curFund = new FundAgency(agencyID); //curJour = Journal.JournalDS[pos]; //this was if i was using a list } btnUpdate.Visibility = Visibility.Visible; setDataSource(); } catch (Exception ex) { MessageBox.Show("Oh no!!", "Broken"); } }
private void btnAgAdd_Click(object sender, RoutedEventArgs e) { try { { if (!curFund.isExceptionFree()) throw new Exception("Cannot save to the database while there are errors on the form"); FundAgency NewOne = new FundAgency(); NewOne.Add(txtAgname.Text, txtAgCP.Text, txtAgadres1.Text, txtAgadres2.Text, txtAgemail.Text, txtAgLandl.Text); MessageBox.Show("Funding Agency Added", "~Added~"); InitializeGrid(); txtAgID.Text = ""; txtAgname.Text = ""; txtAgCP.Text = ""; txtAgadres1.Text = ""; txtAgadres2.Text = ""; txtAgemail.Text = ""; txtAgLandl.Text = ""; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnAdd_Click(object sender, RoutedEventArgs e) { if (!curFund.isExceptionFree()) throw new Exception("Cannot save to the database while there are errors on the form"); curFund = new FundAgency(); setAgencyDataSource(); txtAgID.Text = ""; txtAgname.Text = ""; txtAgCP.Text = ""; txtAgadres1.Text = ""; txtAgadres2.Text = ""; txtAgemail.Text = ""; txtAgLandl.Text = ""; btnUpdate.Visibility = Visibility.Hidden; }
private void btnAgDel_Click(object sender, RoutedEventArgs e) { /* if (Checknull(txtAgID) == false) { MessageBox.Show("Please ENTER the AgencyID of the funding agency you wish to remove."); } else*/ { if (!curFund.isExceptionFree()) throw new Exception("Cannot Delete while there are errors on the form"); FundAgency FA = new FundAgency(); FA.Delete(int.Parse(txtAgID.Text)); MessageBox.Show("Funding Agency Removed", "~Removed~"); InitializeGrid(); txtAgID.Text = ""; txtAgname.Text = ""; txtAgCP.Text = ""; txtAgadres1.Text = ""; txtAgadres2.Text = ""; txtAgemail.Text = ""; txtAgLandl.Text = ""; } }
public void getfund(String ID) { agency = new FundAgency(ID); }