public void display()
        {
            SQLiteConnection sqlite_conn;
            SQLiteCommand    sqlite_cmd;
            //SQLiteDataReader sqlite_datareader;

            Receptionists A2 = new Receptionists();


            sqlite_conn = new SQLiteConnection("Data Source=ReceptionistLogin.db;Version=3;Compress=True;");
            sqlite_conn.Open();

            sqlite_cmd = sqlite_conn.CreateCommand();

            sqlite_cmd.CommandText = "SELECT Username FROM Login where Username='******' and Password='******'";
            sqlite_cmd.ExecuteNonQuery();

            DataTable         dt = new DataTable();
            SQLiteDataAdapter da = new SQLiteDataAdapter(sqlite_cmd);

            da.Fill(dt);
            dataGridView1.DataSource = dt;

            sqlite_conn.Close();
        }
        private void button4_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Do you want to delete your account ? After pressing yes you will be logout from account and your account will be remove!", "Delete Account", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                Receptionists A1 = new Receptionists();

                SQLiteConnection sqlite_conn;
                SQLiteCommand    sqlite_cmd;
                SQLiteDataReader sqlite_dataread;

                SQLiteConnection sqlite_conn1;
                SQLiteCommand    sqlite_cmd1;

                sqlite_conn = new SQLiteConnection("Data Source=ReceptionistLogin.db;Version=3;Compress=True;");
                sqlite_conn.Open();
                sqlite_cmd = sqlite_conn.CreateCommand();

                sqlite_cmd.CommandText = "Select * from Login where Username='******' and Password='******'";
                sqlite_dataread        = sqlite_cmd.ExecuteReader();

                if (sqlite_dataread.Read())
                {
                    sqlite_conn.Close();
                    sqlite_conn1 = new SQLiteConnection("Data Source=ReceptionistLogin.db;Version=3;Compress=True;");
                    sqlite_conn1.Open();

                    sqlite_cmd1 = sqlite_conn1.CreateCommand();

                    sqlite_cmd1.CommandText = "Delete from Login where Username='******' and Password='******'";
                    sqlite_cmd1.ExecuteNonQuery();

                    sqlite_conn1.Close();

                    i = 1;

                    this.Hide();
                    this.Close();
                }

                else
                {
                    i = 0;
                    sqlite_conn.Close();
                    MessageBox.Show("Username and Password is incorrect!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Receptionists A1 = new Receptionists();


            if (string.IsNullOrWhiteSpace(textBox2.Text) || string.IsNullOrWhiteSpace(textBox5.Text))
            {
                MessageBox.Show("Please fill the missing field !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            else
            {
                SQLiteConnection sqlite_conn;
                SQLiteCommand    sqlite_cmd;
                SQLiteDataReader sqlite_dataread;

                SQLiteConnection sqlite_conn1;
                SQLiteCommand    sqlite_cmd1;
                SQLiteDataReader sqlite_dataread1;

                SQLiteConnection sqlite_conn2;
                SQLiteCommand    sqlite_cmd2;


                sqlite_conn = new SQLiteConnection("Data Source=ReceptionistLogin.db;Version=3;Compress=True;");
                sqlite_conn.Open();

                sqlite_cmd = sqlite_conn.CreateCommand();

                sqlite_cmd.CommandText = "Select * from Login where Username='******' and Password='******'";
                sqlite_dataread        = sqlite_cmd.ExecuteReader();

                if (sqlite_dataread.Read())
                {
                    sqlite_conn.Close();
                    sqlite_conn1 = new SQLiteConnection("Data Source=ReceptionistLogin.db;Version=3;Compress=True;");
                    sqlite_conn1.Open();

                    sqlite_cmd1 = sqlite_conn1.CreateCommand();

                    sqlite_cmd1.CommandText = "select * from Login where Username='******'"; //UserName Verification
                    sqlite_dataread1        = sqlite_cmd1.ExecuteReader();

                    if (!sqlite_dataread1.Read())
                    {
                        sqlite_conn1.Close();

                        sqlite_conn2 = new SQLiteConnection("Data Source=ReceptionistLogin.db;Version=3;Compress=True;");
                        sqlite_conn2.Open();

                        sqlite_cmd2 = sqlite_conn2.CreateCommand();

                        sqlite_cmd2.CommandText = "Update Login set Username='******' where Username='******' and Password='******'";
                        sqlite_cmd2.ExecuteNonQuery();

                        sqlite_conn2.Close();

                        A1.SetData(textBox2.Text, textBox5.Text);
                        display();

                        MessageBox.Show("Username Update", "UPDATE", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        textBox2.Clear();
                        textBox5.Clear();
                    }

                    else
                    {
                        MessageBox.Show("Username can not be Update", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        textBox2.Clear();
                        textBox5.Clear();

                        sqlite_conn1.Close();
                    }

                    /*sqlite_cmd1.CommandText = "Update Login set Username='******' where Username='******' and Password='******'";
                     * sqlite_cmd1.ExecuteNonQuery();
                     * sqlite_conn1.Close();
                     */
                }


                else
                {
                    sqlite_conn.Close();
                    MessageBox.Show("Invalid Password ! Username can not be update", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    textBox2.Clear();
                    textBox5.Clear();
                }
            }
        }