private void backBtn_Click(object sender, EventArgs e) { this.Hide(); viewPtRec view = new viewPtRec(); view.ShowDialog(); this.Dispose(); }
private void viewPtRecBtn_Click(object sender, EventArgs e) { this.Hide(); viewPtRec viewRec = new viewPtRec(); viewRec.ShowDialog(); this.Close(); }
private void saveBtn_Click(object sender, EventArgs e) { checker check = new checker(); string fName = fName_box.Text; string mName = mName_box.Text; string lName = lName_box.Text; string gender = gender_cbox.SelectedItem.ToString(); string birthday = birthday_Box.Value.ToShortDateString(); string address = streetAdd_box.Text; string city = city_box.Text; string email = email_box.Text; string contactNo = contactNo_box.Text; string occu = occu_box.Text; if (fName == "" || mName == "" || lName == "" || gender == "" || birthday == "" || address == "" || city == "" || email == "" || contactNo == "" || occu == "") { errorLbl.Text = "Please fill out all fields."; } else if (!check.IsValidEmail(email)) { errorLbl.Text = "Please enter a valid email address"; email_box.Focus(); } else { DialogResult result = MessageBox.Show("Are you sure to update new record?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { Boolean success = sysDB.updatePatient(fName, mName, lName, gender, birthday, address, city, email, contactNo, occu, ptID); if (success) { MessageBox.Show("Record Saved!", "Success"); result = MessageBox.Show("Are there any more changes?\n(Clicking No will redirect you back to records)", "Again?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { resetData(); } else { this.Hide(); viewPtRec view = new viewPtRec(); view.ShowDialog(); this.Dispose(); } } } } }
private void backBtn_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Are you sure to go back to records?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (sensor != null) { sensor.Stop(); } sensor = null; this.Hide(); viewPtRec view = new viewPtRec(); view.ShowDialog(); this.Dispose(); } }