private void button1_Click(object sender, EventArgs e)
        {
            connection sv = new connection();

            sv.thisConnection.Open();



            OracleCommand thisCommand = sv.thisConnection.CreateCommand();
            string        no          = "No";

            thisCommand.CommandText =
                "update doctor_appointment set weight_kg = '" + wet.Text + "',pulse_min = '" + pulse.Text + "'," +
                "bp = '" + bpp.Text + "',additional_info = '" + add.Text + "', visit_status = '" + no + "' where token_id= '" + token.Text + "'";

            thisCommand.Connection  = sv.thisConnection;
            thisCommand.CommandType = CommandType.Text;
            //For Insert Data Into Oracle//
            try
            {
                thisCommand.ExecuteNonQuery();
                MessageBox.Show("submitted");
                this.Hide();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }



            sv.thisConnection.Close();
            this.Hide();
            compounder ob = new compounder();

            ob.Show();
        }
Example #2
0
        private void logincheck()
        {
            if (!(String.IsNullOrEmpty(textBox1.Text) || String.IsNullOrEmpty(textBox2.Text)))
            {
                try
                {
                    connection CN = new connection();
                    CN.thisConnection.Open();
                    OracleCommand thisCommand = new OracleCommand();
                    thisCommand.Connection  = CN.thisConnection;
                    thisCommand.CommandText = "SELECT * FROM HOSPITAL_LOGIN WHERE username='******' AND password='******'";
                    thisReader = thisCommand.ExecuteReader();



                    if (thisReader.Read())
                    {
                        if (comboBox1.Text == "Administrator" && thisReader["designation"].ToString() == "admin")
                        {
                            AdminPage oform = new AdminPage();
                            oform.Show();
                            this.Hide();
                        }
                        else if (comboBox1.Text == "Doctor" && thisReader["designation"].ToString() == "doctor")
                        {
                            DoctorPage pat = new DoctorPage(textBox1.Text);
                            pat.Show();
                            this.Hide();
                        }
                        else if (comboBox1.Text == "Receptionist" && thisReader["designation"].ToString() == "receptionist")
                        {
                            PatientPage oform = new PatientPage();
                            oform.Show();
                            this.Hide();
                        }
                        else if (comboBox1.Text == "Compounder" && thisReader["designation"].ToString() == "compounder")
                        {
                            compounder oform = new compounder();
                            oform.Show();
                            this.Hide();
                        }
                        else if (comboBox1.Text == "Nurse" && thisReader["designation"].ToString() == "nurse")
                        {
                            nurse_page oform = new nurse_page();
                            oform.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("select your using position");
                        }
                    }
                    else
                    {
                        MessageBox.Show("username or password incorrect");
                    }
                    //this.Close();
                    CN.thisConnection.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }


            else
            {
                MessageBox.Show("Please input username and password!!!!");
            }
        }