Beispiel #1
0
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            this.Hide();
            StockController sc = new StockController();

            sc.Show();
        }
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            string        connectionString;
            SqlConnection cnn;

            connectionString = @"Data Source=DELL-PC;Initial Catalog=abcphonecompany;Integrated Security=True";
            cnn = new SqlConnection(connectionString);
            cnn.Open();
            SqlCommand    command;
            SqlDataReader dataReader;
            String        sql = "";

            sql = "select * from abc_user_detail where user_username='******' and user_password='******'and  user_type='" + comboTypeLogin.Text + "' ;";

            command    = new SqlCommand(sql, cnn);
            dataReader = command.ExecuteReader();
            if (dataReader.Read())
            {
                //MessageBox.Show("connected");
                if ((comboTypeLogin.Text == "Admin"))
                {
                    this.Hide();
                    Admin_Menu am = new Admin_Menu();
                    am.Show();
                }
                else
                {
                    this.Hide();
                    StockController sc = new StockController();
                    sc.Show();
                }
            }


            else
            {
                MessageBox.Show("Notconnected");
            }
            dataReader.Close();
            command.Dispose();
            cnn.Close();
        }