private void btnSave_Click(object sender, EventArgs e) { string DocID = cmbConsultant.SelectedValue.ToString(); string FeeID = cmbFee.SelectedValue.ToString(); tblvisits = new tblVisitsTableAdapter(); tblvisits.spAddnewVisit(int.Parse(txtPid.Text), int.Parse(DocID), int.Parse(FeeID), txtStatus.Text, txtRemarks.Text, DateTime.Parse(dtVisitsDate.Text)); RefreshGrid(); ClearingFields(); }
private void btnADD_Click(object sender, EventArgs e) { string DocID = cmbConsultant.SelectedValue.ToString(); string FeeID = cmbFee.SelectedValue.ToString(); tblpatient = new tblPatientTableAdapter(); tblvisits = new tblVisitsTableAdapter(); string LastID = tblpatient.spAddNewPatient(txtDname.Text, txtDFname.Text, txtcntct.Text, txtPAddrs.Text, cmbPMstatus.Text, cmbPGender.Text).ToString(); tblvisits.spAddnewVisit(int.Parse(LastID), int.Parse(DocID), int.Parse(FeeID), txtStatus.Text, txtRemarks.Text, DateTime.Parse(dtVisitsDate.Text)); RefreshGrid(); ClearingFields(); }