partial void Deletedonwithtable(donwithtable instance);
partial void Updatedonwithtable(donwithtable instance);
private void deposit_Click(object sender, EventArgs e) { int warning = 0; if (d_id.Text == "" || d_amount.Text == "" || re_am.Text == "" || d_date.Text == "" || d_det.Text == "") { MessageBox.Show("One of the field is empty", "Warning Message"); } else if (d_amount.Text == re_am.Text) { if (d_id.Text != "") { string d_id_pattern = @"^[1]{1}[0-9]{1}-[1-3]{1}\d{3}[1-3]{1}-[1-3]{1}$"; string did_input = d_id.Text; Match did_match = Regex.Match(did_input, d_id_pattern); if (did_match.Success) { } else { MessageBox.Show("Enter a Correct Deposit Id!!", "Warning Message"); warning = 1; d_id.Text = ""; } } if (d_amount.Text != "") { string d_am_pattern = @"^[1-9]{1,10}\d{0,8}$"; string dam_input = d_amount.Text; Match dam_match = Regex.Match(dam_input, d_am_pattern); if (dam_match.Success) { } else { MessageBox.Show("Enter a Valid Deposit Amount!!", "Warning Message"); warning = 1; d_amount.Text = ""; re_am.Text = ""; } } if (warning == 0) { dbDataContext db = new dbDataContext(); donwithtable dw = new donwithtable(); dw.donor_id = d_id.Text; dw.donation_amount = d_amount.Text; dw.donation_date = d_date.Text; dw.donation_details = d_det.Text; dw.status = "deposit"; db.donwithtables.InsertOnSubmit(dw); db.SubmitChanges(); MessageBox.Show("Deposit Sucessfull"); // d_id.Text = ""; d_amount.Text = ""; re_am.Text = ""; d_date.Text = ""; d_det.Text = ""; } } else { MessageBox.Show("Amount is not correct"); } }
partial void Insertdonwithtable(donwithtable instance);
private void withdraw_Click(object sender, EventArgs e) { int warning_wd = 0; if (w_id.Text == "" || w_am.Text == "" || re_wam.Text == "" || w_date.Text == "" || w_det.Text == "") { MessageBox.Show("One of the field is empty", "Warning Message"); } else if (w_am.Text == re_wam.Text) { if (w_id.Text != "") { string w_id_pattern = @"^[1]{1}[0-9]{3}-[1-9]{3}-[1-9]{4}$"; string w_input = w_id.Text; Match w_match = Regex.Match(w_input, w_id_pattern); if (w_match.Success) { } else { MessageBox.Show("Enter a Correct Withdrawal Id!!", "Warning Message"); warning_wd = 1; w_id.Text = ""; } } if (w_am.Text != "") { string w_am_pattern = @"^[1-9]{1,10}\d{0,8}$"; string w_am_input = w_am.Text; Match wam_match = Regex.Match(w_am_input, w_am_pattern); if (wam_match.Success) { } else { MessageBox.Show("Enter a Valid Withdrawal Amount!!", "Warning Message"); warning_wd = 1; w_am.Text = ""; re_wam.Text = ""; } } if (warning_wd == 0) { dbDataContext db = new dbDataContext(); donwithtable dw1 = new donwithtable(); dw1.withdrawer_id = w_id.Text; dw1.withdrawal_amount = w_am.Text; dw1.withdrawal_date = w_date.Text; dw1.withdrawal_details = w_det.Text; dw1.status = "withdraw"; db.donwithtables.InsertOnSubmit(dw1); db.SubmitChanges(); MessageBox.Show("Withdraw Sucessfull"); //w_id.Text = ""; w_am.Text = ""; re_wam.Text = ""; w_date.Text = ""; w_det.Text = ""; } } else { MessageBox.Show("Amount is not correct"); } }