private void btn_Add_Click(object sender, EventArgs e) { try { string temp_type = "", bp_type = ""; int i = 0; if (!String.IsNullOrWhiteSpace(text_Temp.Text)) { temp_type = combo_Te.Text; } if (!String.IsNullOrWhiteSpace(text_Bp_Syst.Text) || !String.IsNullOrWhiteSpace(text_Bp_Dias.Text)) { bp_type = combo_Bp.Text; } if (!String.IsNullOrWhiteSpace(text_Pulse.Text) || !String.IsNullOrWhiteSpace(text_Temp.Text) || !String.IsNullOrWhiteSpace(Txtheight.Text) || !String.IsNullOrWhiteSpace(text_Bp_Syst.Text) || !String.IsNullOrWhiteSpace(text_Bp_Dias.Text) || !String.IsNullOrWhiteSpace(text_Resp.Text) || !String.IsNullOrWhiteSpace(text_Weight.Text)) { string doctor = ""; string dr_id = doctor_id; if (doctor_id != "0") { doctor = Cmb_doctor.Text; dr_id = Cmb_doctor.SelectedValue.ToString(); } i = this.cntrl.submit(patient_id, dr_id, doctor, temp_type, bp_type, text_Pulse.Text, text_Temp.Text, text_Bp_Syst.Text, text_Bp_Dias.Text, text_Weight.Text, text_Resp.Text, dtp_date.Text, Txtheight.Text); if (i > 0) { var form2 = new PappyjoeMVC.View.Vital_Signs(); if (doctor_id == "0" || doctor_id == "") { form2.staff_id = staff_id; } else { form2.doctor_id = doctor_id; } form2.patient_id = patient_id; form2.Closed += (sender1, args) => this.Close(); this.Hide(); form2.Show(); } else { MessageBox.Show("Inseration Failed!..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { label7.Show(); label7.Text = "Data not found..."; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error !...", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_Close_Click(object sender, EventArgs e) { var form2 = new PappyjoeMVC.View.Vital_Signs(); if (doctor_id == "0" || doctor_id == "") { form2.staff_id = staff_id; } else { form2.doctor_id = doctor_id; } //Vital_Signs_controller controller = new Vital_Signs_controller(form2); form2.patient_id = patient_id; form2.Closed += (sender1, args) => this.Close(); this.Hide(); form2.Show(); }