Ejemplo n.º 1
0
        //Login Method
        public void LogIn()
        {
            string        connectionString = @"SERVER=DESKTOP-BDF5EPV; DATABASE=BusinessManagementSystemDb; INTEGRATED SECURITY=true";
            SqlConnection sqlConnection    = new SqlConnection(connectionString);
            string        commandString    = @"SELECT * FROM LogIn WHERE Name = '" + userNameTextBox.Text + "' AND Password = '******'";
            SqlCommand    sqlCommand       = new  SqlCommand(commandString, sqlConnection);

            sqlConnection.Open();

            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
            DataTable      dataTable      = new  DataTable();

            sqlDataAdapter.Fill(dataTable);
            if (dataTable.Rows.Count == 1)
            {
                this.Hide();
                ProductUi productUi = new ProductUi();
                productUi.Show();
            }
            else
            {
                MessageBox.Show("Please Check User Name or Password");
            }

            sqlConnection.Close();
        }
Ejemplo n.º 2
0
        private void productPictureBox_Click(object sender, EventArgs e)
        {
            ProductUi productUi = new ProductUi();

            productUi.Show();
        }