private void button2_Click(object sender, EventArgs e) { var form2 = new PappyjoeMVC.View.LabWorks(); form2.doctor_id = doctor_id; form2.patient_id = patient_id; LabWorks_controller controller = new LabWorks_controller(form2); form2.FormClosed += (sender1, args) => this.Close(); //this.Hide(); form2.ShowDialog(); }
private void button3_Click(object sender, EventArgs e) { try { if (radioButton1.Checked == true) { if (dataGridView3.Rows.Count > 0) { this.ctrlr.selectid(labelmaintest.Text); this.ctrlr.inslabmain(patient_id, comboBox6.SelectedValue.ToString(), labelmaintest.Text, ID, Convert.ToDateTime(dateTimePicker1.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(dateTimePicker1.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(dateTimePicker1.Text).ToString("yyyy-MM-dd")); this.ctrlr.maxid(); var form2 = new PappyjoeMVC.View.LabWorks(); form2.doctor_id = doctor_id; form2.patient_id = patient_id; LabWorks_controller controller = new LabWorks_controller(form2); form2.FormClosed += (sender1, args) => this.Close(); //this.Hide(); form2.ShowDialog(); } else { MessageBox.Show(" Please Add Lab Work", "Data Missing", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { if (txtworkname.Text.Trim() != "" && txtwork_id.Text.Trim() != "") { this.ctrlr.inslabmain2(patient_id, doctor_id, txtworkname.Text, txtwork_id.Text, Convert.ToDateTime(dateTimePicker1.Text).ToString("yyyy-MM-dd")); this.ctrlr.insdentlab(ID, txtworkname.Text, txtWorktype.Text, cmbAlloytype.Text, cmbShade.Text, patient_id, label15.Text); var form2 = new PappyjoeMVC.View.LabWorks(); form2.doctor_id = doctor_id; form2.patient_id = patient_id; LabWorks_controller controller = new LabWorks_controller(form2); form2.FormClosed += (sender1, args) => this.Close(); //this.Hide(); form2.ShowDialog(); } else { MessageBox.Show(" Please Add Lab Work Or select work name in left side..", "Data Missing", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error !..", MessageBoxButtons.OK, MessageBoxIcon.Error); } }