private void ConfirmBtn_Click(object sender, EventArgs e)
        {
            connection.Open();
            SqlCommand com = new SqlCommand("Update ContactInformationTable set Address = '" + Address.Text + "' where PatientNo =" + Pnum.ToString(), connection);

            com.ExecuteNonQuery();

            connection.Close();
            connection.Open();
            SqlCommand com0 = new SqlCommand("Update  ContactInformationTable set EmailAdd= '" + EmailAdd.Text + "' where PatientNo =" + Pnum.ToString(), connection);

            com0.ExecuteNonQuery();

            connection.Close();
            connection.Open();
            SqlCommand com1 = new SqlCommand("Update ContactInformationTable set ContactNo = '" + ContactNo.Text + "' where PatientNo =" + Pnum.ToString(), connection);

            com1.ExecuteNonQuery();

            connection.Close();
            MessageBox.Show("Contact Info Successfully Edited!");
            View_Detailed_Patient back2 = new View_Detailed_Patient(Pnum);

            back2.Show();
            this.Hide();
        }
        private void CancelBTN_Click(object sender, EventArgs e)
        {
            View_Detailed_Patient back = new View_Detailed_Patient(Pnum);

            back.Show();
            this.Hide();
        }
예제 #3
0
        private void ConfirmBtn_Click(object sender, EventArgs e)
        {
            connection.Open();
            SqlCommand    checker = new SqlCommand("Select * from TreatmentHistoryTable where Date='" + Month.Text + "/" + Day.Text + "/" + Year.Text + "'", connection);
            SqlDataReader read    = checker.ExecuteReader();

            if (read.HasRows)
            {
                MessageBox.Show("There is already a treatment for that day");
                Condition.Text     = "";
                status.Text        = "";
                treatment.Text     = "";
                Day.SelectedItem   = null;
                Month.SelectedItem = null;
                Year.SelectedItem  = null;
            }
            else
            {
                connection.Close();
                connection.Open();
                SqlCommand com = new SqlCommand("Insert into TreatmentHistoryTable values (" + pnum.ToString() + ",'" + Condition.Text + "','" + treatment.Text + "','" + status.Text + "','" + Month.Text + "/" + Day.Text + "/" + Year.Text + "')", connection);
                com.ExecuteNonQuery();

                connection.Close();
                MessageBox.Show("Treatment Successfuly Inserted!");
                View_Detailed_Patient back = new View_Detailed_Patient(pnum);
                back.Show();
                this.Hide();
            }
        }
예제 #4
0
        private void UpdatePatientBtn_Click(object sender, EventArgs e)
        {
            View_Detailed_Patient view = new View_Detailed_Patient();

            view.Show();
            this.Hide();
        }
        private void ConfirmBtn_Click(object sender, EventArgs e)
        {
            connection.Open();
            SqlCommand com = new SqlCommand("Update TreatmentHistoryTable set status = '" + status.Text + "' where PatientNo =" + Pnum.ToString() + "and Date = '" + Date.Text + "'", connection);

            com.ExecuteNonQuery();
            connection.Close();
            MessageBox.Show("Treatment Successfuly Updated!");
            View_Detailed_Patient back = new View_Detailed_Patient(Pnum);

            back.Show();
            this.Hide();
        }