Пример #1
0
        private void backButton_MouseClick(object sender, MouseEventArgs e)
        {
            this.Hide();
            ClientUI special = new ClientUI();

            special.ShowDialog();
            this.Close();
        }
Пример #2
0
        private void metroButton1_MouseClick(object sender, MouseEventArgs e)
        {
            string User  = metroTextBox1.Text;
            string passw = metroTextBox2.Text;

            try
            {
                DataTable DT  = new DataTable();
                String    sql = "select u_type from login where u_id='" + User + "' and pass='******'";
                DT = con.GetResult(sql);

                int count = DT.Rows.Count;
                if (count == 1)
                {
                    if (DT.Rows[0]["u_type"].ToString() == "admin")
                    {
                        this.Hide();
                        AdminUI special = new AdminUI();
                        special.ShowDialog();
                        this.Close();
                    }

                    if (DT.Rows[0]["u_type"].ToString() == "customer")
                    {
                        this.Hide();
                        ClientUI special = new ClientUI();
                        special.ShowDialog();
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("INVALID LOGIN CREDENTIALS");
                }
            }
            catch (Exception er) { MessageBox.Show(er.ToString()); }
        }