Пример #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     //// TODO: This line of code loads data into the 'frm1SeansDataSet.tblSeans' table. You can move, or remove it, as needed.
     //this.tblSeansTableAdapter.Fill(this.frm1SeansDataSet.tblSeans);
     //// TODO: This line of code loads data into the 'frm1FilmDataSet.tblFilm' table. You can move, or remove it, as needed.
     //this.tblFilmTableAdapter.Fill(this.frm1FilmDataSet.tblFilm);
     dataGridViewHomeFilm.AllowUserToAddRows = false;
     comboBxHmAraTuru.SelectedIndex          = 0;
     FormAdmin m = new FormAdmin();
     //  m.ShowDialog();
 }
Пример #2
0
        private void btnAdminLogin_Click(object sender, EventArgs e)
        {
            try
            {
                string       sql       = null;
                SqlParameter klcAd     = new SqlParameter("@141", txtBadminAd.Text);
                SqlParameter klcParola = new SqlParameter("@142", txtBadminPass.Text);
                sql = "SELECT * FROM tblAdmin WHERE adminUserName = @141 and adminParola = @142";
                SqlCommand command = new SqlCommand(sql, connect);
                command.Parameters.Add(klcAd);
                command.Parameters.Add(klcParola);
                SqlDataAdapter adapter   = new SqlDataAdapter(command);
                DataTable      dataTable = new DataTable();
                adapter.Fill(dataTable);

                if (txtBadminAd.Text == "" && txtBadminPass.Text == "")
                {
                    MessageBox.Show("Kullanıcı Adı ve Şifre Giriniz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    if (dataTable.Rows.Count > 0)
                    {
                        FormAdmin formAdmin = new FormAdmin();
                        formAdmin.StartPosition = FormStartPosition.CenterScreen;
                        formAdmin.Show();
                        this.Close();
                        formAdmin.TopMost = true;
                    }
                    else
                    {
                        txtBadminAd.Clear();
                        txtBadminPass.Clear();
                        MessageBox.Show("Kullanıcı Adı ve ya Parola Yanlış!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch (Exception mesaj)
            {
                MessageBox.Show(mesaj.Message);
            }
        }