Esempio n. 1
0
        private void btn_back_Click(object sender, EventArgs e)
        {
            AddingForm add = new AddingForm();

            this.Hide();
            add.Show();
        }
Esempio n. 2
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            string         connectionStr  = "Data Source=MURAD-PC;Initial Catalog=FromAeAppDb; Integrated Security=SSPI;";
            SqlConnection  sqlConnection  = new SqlConnection(connectionStr);
            string         query          = "SELECT  * FROM Admin WHERE Email = '" + txbx_log_email.Text.Trim() + "' AND Password ='******'";
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(query, sqlConnection);
            DataTable      dataTable      = new DataTable();

            sqlDataAdapter.Fill(dataTable);

            if (dataTable.Rows.Count == 1)
            {
                AddingForm addingForm = new AddingForm();
                this.Hide();
                addingForm.Show();
            }
            else
            {
                MessageBox.Show("Check your email and password");
            }
        }