Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["User_Id"] != null)
     {
         Response.Redirect("~/AnaSayfa.aspx");
     }
     else
     {
         if (!IsPostBack)
         {
             HttpCookie LoginCookie = Request.Cookies["SecureOdev_Login"];
             if (LoginCookie != null)
             {
                 TxtKullanici.Text = LoginCookie["User"];
             }
         }
         if (TxtKullanici.Text == "")
         {
             TxtKullanici.Focus();
         }
         else
         {
             TxtSifre.Focus();
         }
     }
 }
 private void PctTemizle_Click(object sender, EventArgs e)
 {
     TxtAd.Clear();
     TxtSoyad.Clear();
     MskTelefon.Clear();
     MslTc.Clear();
     TxtMail.Clear();
     CmbBranş.Text        = " ";
     CmbIl.Text           = " ";
     CmbIlce.Text         = " ";
     radioButton1.Checked = false;
     radioButton2.Checked = false;
     TxtSifre.Clear();
 }
Exemple #3
0
        private void BtnGiris_Click(object sender, EventArgs e)
        {
            if (TxtSifre.Text != "")
            {
                SqlParameter[] pCollection = new SqlParameter[]
                {
                    new SqlParameter("@Sifre", SqlDbType.NVarChar, 50),
                    new SqlParameter("@AktifMi", SqlDbType.Bit)
                };
                pCollection[0].Value = TxtSifre.Text;
                pCollection[1].Value = true;

                Cursor.Current = Cursors.WaitCursor;

                // Yedekleme Sistemi ----------
                string Yol   = @"C:\AMBAR\YEDEK\";
                string Dosya = Yol + DateTime.Now.ToString("dd_MM_yyyy") + ".bak";
                if ((!File.Exists(Yol + DateTime.Now.ToString("dd_MM_yyyy") + ".bak")))
                {
                    AKBclass.DBMudahale.SQLIsle("BACKUP DATABASE [AMBAR] TO  DISK = N'" + Dosya + "' WITH NOFORMAT, NOINIT,  NAME = N'AMBAR-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10");
                }
                // ----------------------------

                String[] Res = AKBclass.DBMudahale.TekKayitDondur("Operator_Tbl", "Ad,ID", "WHERE Sifre = @Sifre AND AktifMi = @AktifMi", pCollection);

                Cursor.Current = Cursors.Default;

                if (Res[0] == "Ad")
                {
                    MessageBox.Show("Girilen Şifre Doğru Değil!", "Giriş Başarısız", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    TxtSifre.Focus();
                    TxtSifre.SelectAll();
                }
                else
                {
                    AnaFrm.LoginOldum(int.Parse(Res[1]));
                    this.Close();
                }
            }
            else
            {
                TxtSifre.Focus();
            }
        }
Exemple #4
0
 private void BtnSil_Click(object sender, EventArgs e)
 {
     try
     {
         SqlCommand command = new SqlCommand("delete from Admin where YoneticiId=@p1", conn.connect());
         command.Parameters.AddWithValue("@p1", TxtYoneticiId.Text);
         command.ExecuteNonQuery();
         conn.connect().Close();
         MessageBox.Show("Silme İşlemi Gerçekleştirildi.");
         this.adminTableAdapter.Fill(this.yurtOtomasyonuDataSet5.Admin);
         TxtYoneticiId.Clear();
         TxtKullaniciAdi.Clear();
         TxtSifre.Clear();
     }
     catch (Exception)
     {
         MessageBox.Show("Silme İşlemi Yapılırken Hata Oluştu Lütfen Tekrar Deneyiniz.");
     }
 }
        private void BtnEkle_Click(object sender, EventArgs e)
        {
            SqlCommand komutEkle = new SqlCommand("insert into Tbl_Doktor (DoktorAd,DoktorSoyad,DoktorBrans,DoktorTC,DoktorSifre) values (@dr1,@dr2,@dr3,@dr4,@dr5)", bgl.baglanti());

            komutEkle.Parameters.AddWithValue("@dr1", TxtAd.Text);
            komutEkle.Parameters.AddWithValue("@dr2", TxtSoyad.Text);
            komutEkle.Parameters.AddWithValue("@dr3", CmbBrans.Text);
            komutEkle.Parameters.AddWithValue("@dr4", MskTC.Text);
            komutEkle.Parameters.AddWithValue("@dr5", TxtSifre.Text);
            komutEkle.ExecuteNonQuery();
            bgl.baglanti().Close();
            MessageBox.Show("Successful");

            TxtAd.Clear();
            TxtSoyad.Clear();
            CmbBrans.Items.Clear();
            MskTC.Clear();
            TxtSifre.Clear();
        }
Exemple #6
0
        // GİRİŞ
        private void BtnGiris_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("Select * From Admin where YoneticiAd=@p1 and YoneticiSifre=@p2", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtKullaniciAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();      // Ana Formu göster.
                this.Hide();    // Admin giriş kısmını gizle.
            }
            else
            {
                MessageBox.Show("Hatalı Giriş! Kullanıcı adı veya şifre hatalı!");
                TxtKullaniciAd.Clear(); // Kullanıcı adı kısmını temizler.
                TxtSifre.Clear();       // Şifre kısmını temizler.
                TxtKullaniciAd.Focus(); // İmleci Kullanıcı adı kısmına getirir.
            }
            bgl.baglanti().Close();
        }
        private void BtnGirisYap_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("select * from admin where yoneticiad=@p1 and  yoneticisifre=@p2", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtKullaniciAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı kullanıcı adı ya da şifre");
                TxtKullaniciAd.Clear();
                TxtSifre.Clear();
                TxtKullaniciAd.Focus();
            }
            bgl.baglanti().Close();
        }
Exemple #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlCommand command = new SqlCommand("select * from Admin where YoneticiAd=@p1 and YoneticiSifre=@p2", conn.connect());

            command.Parameters.AddWithValue("@p1", TxtKullaniciAdi.Text);
            command.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader read = command.ExecuteReader();

            if (read.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı veya Şifre Hatalı");
                TxtKullaniciAdi.Clear();
                TxtSifre.Clear();
                TxtKullaniciAdi.Focus();
            }
            conn.connect().Close();
        }
        //Veritabanına eklenen yönetici ad/şifre ile otomasyona giriş yapma

        private void BtnGirisYap_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("Select * from Admin where YöneticiAd=@p1 and  YöneticiŞifre=@p2", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtKullaniciAdi.Text);
            komut.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı Kullancı Adı/Şifre Girişi");
                TxtKullaniciAdi.Clear();
                TxtSifre.Clear();
                TxtKullaniciAdi.Focus();
            }
            bgl.baglanti().Close();
        }
Exemple #10
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand("Select * FROM dbo.Giris WHERE KullaniciAdi=@p1 AND Sifre=@p2", baglanti);

            komut.Parameters.AddWithValue("@p1", TxtKullaniciAdi.Text);
            komut.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaSayfa yeni = new FrmAnaSayfa();
                yeni.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı ya da Şifre yanlış");
                TxtKullaniciAdi.Clear();
                TxtSifre.Clear();
                TxtKullaniciAdi.Focus();
            }
            baglanti.Close();
        }