Exemple #1
0
        private void enterBtn_Click(object sender, EventArgs e)
        {
            int id    = int.Parse(IDlbl.Text);
            int doc   = int.Parse(doctorIDTB.Text);
            int staff = int.Parse(staffIDTB.Text);
            int pat   = int.Parse(patientTB.Text);
            var sql   = "UPDATE Room SET Doctor = @docID, Staff = @staffID, Patient = @patID, Occupied = @occ WHERE Room_Id = @roomID";

            string connectionString = Emergancy_Room_Database.Properties.Settings.Default.ERDatabaseConnectionString;

            using (SqlConnection con = new SqlConnection(connectionString))
            {
                con.Open();
                using (var cmd = new SqlCommand(sql, con))
                {
                    cmd.Parameters.AddWithValue("@patID", pat);
                    cmd.Parameters.AddWithValue("@docID", doc);
                    cmd.Parameters.AddWithValue("@staffID", staff);
                    cmd.Parameters.AddWithValue("@occ", occupiedTB.Text);
                    cmd.Parameters.AddWithValue("@roomID", id);
                    cmd.ExecuteNonQuery();
                }
            }
            this.Hide();
            displayRoomsTable displayRoomsTable = new displayRoomsTable();

            displayRoomsTable.ShowDialog();
            this.Close();
        }
Exemple #2
0
        private void displayRoomsBtn_Click(object sender, EventArgs e)
        {
            this.Hide();
            displayRoomsTable displayRoomsTable = new displayRoomsTable();

            displayRoomsTable.ShowDialog();
            this.Close();
        }