private void button1_Click(object sender, EventArgs e)
        {
            DoctorPage ob = new DoctorPage();

            ob.Show();
            this.Hide();
        }
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            connection sv = new connection();

            sv.thisConnection.Open();


            OracleDataAdapter thisAdapter = new OracleDataAdapter("SELECT * FROM attendance", sv.thisConnection);

            OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter);

            DataSet thisDataSet = new DataSet();

            thisAdapter.Fill(thisDataSet, "attendance");

            DataRow thisRow = thisDataSet.Tables["attendance"].NewRow();

            try
            {
                thisRow["id"]         = id_doc;
                thisRow["name"]       = name_doc;
                thisRow["position"]   = "doctor";
                thisRow["attendance"] = "Y";
                thisRow["date_today"] = da;

                thisDataSet.Tables["attendance"].Rows.Add(thisRow);

                thisAdapter.Update(thisDataSet, "attendance");
                MessageBox.Show("Checked");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

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

            ob.Show();
        }
示例#3
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!!!!");
            }
        }