コード例 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            this.Hide();
            this.Close();

            Feedback F1 = new Feedback();

            F1.ShowDialog();

            Receptionist R1 = new Receptionist();

            R1.ShowDialog();
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            this.Close();

            Billing B1 = new Billing();

            B1.ShowDialog();

            Receptionist R1 = new Receptionist();

            R1.ShowDialog();
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            this.Close();

            EmployeeForm1 E1 = new EmployeeForm1();

            E1.ShowDialog();

            Receptionist R1 = new Receptionist();

            R1.ShowDialog();
        }
コード例 #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            this.Close();
            ReceptionistProfile R1 = new ReceptionistProfile();

            R1.ShowDialog();

            this.Close();

            if (R1.i == 1)
            {
                LoginForm L1 = new LoginForm();
                L1.ShowDialog();
            }

            else
            {
                Receptionist R11 = new Receptionist();
                R11.ShowDialog();
            }
        }
コード例 #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            SQLiteConnection sqlite_conn;
            SQLiteCommand    sqlite_cmd;
            SQLiteDataReader sqlite_datareader;

            if (!File.Exists("ReceptionistLogin.db"))
            {
                sqlite_conn = new SQLiteConnection("Data Source=ReceptionistLogin.db;Version=3;New=True;Compress=True;");

                sqlite_conn.Open();

                sqlite_cmd = sqlite_conn.CreateCommand();


                sqlite_cmd.CommandText = "CREATE TABLE Login (Username varchar2 (100) NOT NULL UNIQUE, Password varchar2 (100));";
                sqlite_cmd.ExecuteNonQuery();


                sqlite_cmd.CommandText = "INSERT INTO Login (Username,Password) VALUES ('aqibahmed60', 'abcabc');";
                sqlite_cmd.ExecuteNonQuery();

                sqlite_cmd.CommandText = "INSERT INTO Login (Username,Password) VALUES ('ossaidahmed', '1234');";
                sqlite_cmd.ExecuteNonQuery();

                sqlite_cmd.CommandText = "INSERT INTO Login (Username,Password) VALUES ('HafizHarisAlam', 'otaku');";
                sqlite_cmd.ExecuteNonQuery();


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

                Receptionists R10 = new Receptionists();
                R10.SetData(textBox1.Text, textBox2.Text);

                if (sqlite_datareader.Read())
                {
                    sqlite_conn.Close();
                    Billing_DB();
                    this.Hide();
                    Receptionist R1 = new Receptionist();
                    R1.ShowDialog();

                    LoginForm L1 = new LoginForm();
                    L1.ShowDialog();
                }

                else
                {
                    MessageBox.Show("Invalid Login", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    textBox1.Clear();
                    textBox2.Clear();
                }

                sqlite_conn.Close();
            }


            else
            {
                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='******'";

                Receptionists R10 = new Receptionists();
                R10.SetData(textBox1.Text, textBox2.Text);


                sqlite_datareader = sqlite_cmd.ExecuteReader();
                if (sqlite_datareader.Read())
                {
                    this.Hide();
                    sqlite_conn.Close();
                    Receptionist R1 = new Receptionist();
                    R1.ShowDialog();

                    LoginForm L1 = new LoginForm();
                    L1.ShowDialog();
                }

                else
                {
                    MessageBox.Show("Invalid Login", "Login Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    textBox1.Clear();
                    textBox2.Clear();
                }


                sqlite_conn.Close();
            }
        }