private void BtnEditDemo_Click(object sender, EventArgs e) { forEdit = true; btn_update.Show(); BtnEditDemo.Hide(); enableFields(); }
private void btn_update_Click(object sender, EventArgs e) { dictionary = new Dictionary <string, string>(); dictionary.Add("@allergyId", dtAllergy.Rows[0][0].ToString()); dictionary.Add("@patientId", patientId.ToString()); dictionary.Add("@name", txtAlergyName.Text); dictionary.Add("@category", txtAlergyCategory.Text); dc.getData("auspUpdateAllergy", dictionary); dictionary = new Dictionary <string, string>(); dictionary.Add("@referenceId", dtReferenceDoctor.Rows[0][0].ToString()); dictionary.Add("@patientId", patientId.ToString()); dictionary.Add("@referenceDoctor", txtRefDoctor.Text); dictionary.Add("@doctorBillingCode", txtBillingCode.Text); dc.getData("auspUpdateReferenceDoctor", dictionary); dictionary = new Dictionary <string, string>(); dictionary.Add("@patientId", patientId.ToString()); dictionary.Add("@firstName", txtFname.Text); dictionary.Add("@lastName", txtLname.Text); dictionary.Add("@dob", patDob.Text); dictionary.Add("@gender", cmbGender.SelectedIndex.ToString()); dc.getData("auspUpdatePatient", dictionary); dictionary = new Dictionary <string, string>(); dictionary.Add("@insuranceId", dtInsurance.Rows[0][0].ToString()); dictionary.Add("@patientId", patientId.ToString()); dictionary.Add("@type", cmbInsType.SelectedIndex.ToString()); dictionary.Add("@insNumber", txtInsNum.Text); dictionary.Add("@expDate", txtExpDate.Text); dc.getData("auspUpdateInsurance", dictionary); dictionary = new Dictionary <string, string>(); dictionary.Add("@patientId", patientId.ToString()); dictionary.Add("@phoneNo", txtPhone.Text); dictionary.Add("@phoneType", cmbPhoneType.SelectedIndex.ToString()); dictionary.Add("@email", txtEmail.Text); dictionary.Add("@emailType", cmbEmailType.SelectedIndex.ToString()); dictionary.Add("@address", txtAdd.Text); dictionary.Add("@addressType", cmbAddType.SelectedIndex.ToString()); dc.getData("auspUpdatePatientContact", dictionary); MessageBox.Show("Patient Update Successful!!"); forEdit = false; BtnEditDemo.Show(); enableFields(); btn_update.Hide(); }
private void btn_update_Click(object sender, EventArgs e) { String errors = checkErrors(txtFname.Text, txtLname.Text, txtInsNum.Text, txtInsVersion.Text); if (errors != null) { MessageBox.Show(errors); } else { dictionary = createUpdatePatientDictionary(patientId.ToString(), txtFname.Text, txtLname.Text, patDob.Text, cmbGender.Text); dc.getData("UpdatePatient", dictionary); dictionary = createUpdateInsuranceDictionary(patientId.ToString(), txtInsNum.Text, txtInsVersion.Text, txtExpDate.Text); dc.getData("UpdateInsurance", dictionary); dictionary = createUpdatePatientAllergyDictionary(patientId.ToString(), "0", txtAlergyName.Text, txtAlergyCategory.Text); dc.getData("updatePatientAllergy", dictionary); dictionary = createUpdatePatientReferalDoctorDictionary(patientId.ToString(), "0", txtRefDoctor.Text, txtBillingCode.Text); dc.getData("updatePatientDoctor", dictionary); dictionary = createUpdatePatientPhoneDictionary(patientId.ToString(), txtPhone.Text, cmbPhoneType.Text); dc.getData("UpdatePatientPhone", dictionary); dictionary = createUpdatePatientEmailDictionary(patientId.ToString(), txtEmail.Text, cmbEmailType.Text); dc.getData("UpdatePatientEmail", dictionary); dictionary = createUpdatePatientAddressDictionary(patientId.ToString(), cmbAddType.Text, txtAdd.Text, txtCity.Text, txtProvince.Text, txtPostalCode.Text, txtCountry.Text); dc.getData("UpdatePatientAddress", dictionary); MessageBox.Show("Patient Update Successful!!"); forEdit = false; BtnEditDemo.Show(); enableFields(); btn_update.Hide(); } }