private void UpdateMemberButton_Click(object sender, EventArgs e) { try { MembersData ed = new MembersData(); SqlMemberRepository members = new SqlMemberRepository(connectionString); members.UpdateMember(Convert.ToInt32(MemberIdTextbox.Text), EmailTextBox.Text, FirstNameTextBox.Text, LastNameTextBox.Text, PhoneTextBox.Text, BillingAddressTextBox.Text, Convert.ToInt32(PointsTextBox.Text), Convert.ToDateTime(JoinedOnTextBox.Text), Convert.ToDateTime(BirthDateTextBox.Text), StatusTextBox.Text); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void CreateMemberButton_Click(object sender, EventArgs e) { try { SqlMemberRepository members = new SqlMemberRepository(connectionString); Member createMember = members.CreateMember(EmailTextBox.Text, FirstNameTextBox.Text, LastNameTextBox.Text, PhoneTextBox.Text, BillingAddressTextBox.Text, Convert.ToInt32(PointsTextBox.Text), Convert.ToDateTime(JoinedOnTextBox.Text), Convert.ToDateTime(BirthDateTextBox.Text), StatusTextBox.Text); list.Add(createMember); MembersData md = new MembersData(); md.dataGridView1.DataSource = list; } catch (Exception ex) { MessageBox.Show("There cannot be any empty or incorrectly entered parameters.Check submission."); } }
private void MembersButton_Click(object sender, EventArgs e) { MembersData ed = new MembersData(); ed.ShowDialog(); }