private void saveButton_Click(object sender, EventArgs e) { PIMSController.MedProcedure proc = new PIMSController.MedProcedure(); proc.who = whoBox.Text; proc.when = Convert.ToDateTime(whenBox.Text); proc.where = whereBox.Text; proc.what = whatBox.Text; patient.treatment.procedures.Add(proc); PIMSController.SQLcommands.updatePatient(patient); SchedProcForm procedure = new SchedProcForm(); procedure.Visible = true; this.Hide(); }
// Default Constructor public ScheduledProcedureForm(PIMSController.MedProcedure proc) { tempProc = proc; InitializeComponent(); // If the text == "Update Procedure" // Do not allow Doctor to see the cancelButton if (saveUpdateButton.Text == "Update Procedure") { this.cancelButton.Visible = false; } // The text == "Save New Procedure" // The Docotor might not want to enter in a new procedure // Allow them to see the cancelButton if (saveUpdateButton.Text == "Save New Procedure") { this.cancelButton.Visible = true; } // If we have procdures to add // Add them if (proc.id != 0) { this.dateTimePicker1.Value = proc.when; this.dateTimePicker2.Value = proc.when; this.procdureTextBox.Text = proc.what; this.perforedByTextBox.Text = proc.who; this.locationTextBox.Text = proc.where; // Makes the patient's procdure text box's not editable makeReadOnly(); } // This is a new procdure else { // Set the physicianTextBox // Makes the patient's prescription text box's editable makeReadable(); saveUpdateButton.Text = "Save New Procedure"; } }