void KullaniciGetir(int ID)
 {
     KullaniciID = ID;
     try
     {
         Fonksiyonlar.TBL_KULLANICILAR Kullanici = DB.TBL_KULLANICILAR.First(S => S.ID == KullaniciID);
         txtIsim.Text         = Kullanici.ISIM;
         txtSoyIsim.Text      = Kullanici.SOYISIM;
         txtKullanıcıAdı.Text = Kullanici.KULLANICI;
         txtSifre.Text        = Kullanici.SİFRE;
         txtSıfreTekrar.Text  = Kullanici.SİFRE;
         if (Kullanici.AKTİF == "Normal")
         {
             txtKullanıcıKodu.SelectedIndex = 1;
         }
         if (Kullanici.AKTİF == "Yönetici")
         {
             txtKullanıcıKodu.SelectedIndex = 0;
         }
         if (Kullanici.KODU.Value)
         {
             rBtnAktif.Checked = true;
         }
         if (!Kullanici.KODU.Value)
         {
             rBtnPasif.Checked = true;
         }
     }
     catch (Exception EX)
     {
         Mesajlar.Hata(EX);
     }
 }
예제 #2
0
 void KullaniciGetir(int ID)
 {
     KullaniciID = ID;
     try
     {
         Fonksiyonlar.TBL_KULLANICILAR Kullanici = DB.TBL_KULLANICILARs.First(s => s.ID == KullaniciID);
         txtIsim.Text         = Kullanici.ISIM;
         txtKullaniciAdi.Text = Kullanici.KULLANICI;
         txtSoyisim.Text      = Kullanici.SOYISIM;
         txtSifre.Text        = Kullanici.SIFRE;
         txtSifreTekrar.Text  = Kullanici.SIFRE;
         if (Kullanici.KODU == "Normal")
         {
             txtKullaniciKodu.SelectedIndex = 1;
         }
         if (Kullanici.KODU == "Yonetici")
         {
             txtKullaniciKodu.SelectedIndex = 0;
         }
         if (Kullanici.AKTIF.Value)
         {
             rbtnAktif.Checked = true;
         }
         if (!Kullanici.AKTIF.Value)
         {
             rbtnPasif.Checked = true;
         }
     }
     catch (Exception ex)
     {
         Mesajlar.Hata(ex);
     }
 }
예제 #3
0
 private void btnGiriş_Click(object sender, EventArgs e)
 {
     if (txtKullanici.Text == "")
     {
         errorProvider1.SetError(txtKullanici, "Bu alan boş geçilemez");
         errorProvider1.BlinkRate = 500;
     }
     else if (txtSifre.Text == "")
     {
         errorProvider1.SetError(txtSifre, "Bu alan boş geçilemez");
         errorProvider1.BlinkRate = 500;
     }
     else
     {
         try
         {
             Fonksiyonlar.TBL_KULLANICILAR Kullanici = DB.TBL_KULLANICILAR.First(s => s.KULLANICI == txtKullanici.Text.Trim() && s.SİFRE == MD5eDonustur(txtSifre.Text));
             Kullanici.LASTLOGİN = DateTime.Now;
             DB.SubmitChanges();
             Hide();
             AnaForm frm = new AnaForm(Kullanici);
             frm.Show();
             MessageBox.Show("Çok Yönlü Otomasyon Programına Hoşgeldiniz", "http://www.yasincoban.com", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         catch (Exception)
         {
             MessageBox.Show("Giriş Yapılamadı. Kullanıcı adı yada şifreniz geçersiz olabilir. Lütfen düzeltip tekrar deneyiniz", "http://www.yasincoban.com", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             return;
         }
     }
 }
예제 #4
0
 void KullaniciGetir(int ID)
 {
     KullaniciID = ID;
     try
     {
         Fonksiyonlar.TBL_KULLANICILAR Kullanici = DB.TBL_KULLANICILARs.First(S => S.ID == KullaniciID);
         txtAdSoyad.Text      = Kullanici.KULLANICIADSOYAD;
         txtKullaniciAdi.Text = Kullanici.KULLANICIADI;
         if (Kullanici.KULLANICIKODU == "Çalışan")
         {
             txtKullaniciTuru.SelectedIndex = 2;
         }
         if (Kullanici.KULLANICIKODU == "Yönetici")
         {
             txtKullaniciTuru.SelectedIndex = 1;
         }
         txtSifre.Text  = Kullanici.KULLANICISIFRE;
         txtSifreT.Text = Kullanici.KULLANICISIFRE;
         if (Kullanici.KULLANICIAKTIF.Value)
         {
             rbtnAktif.Checked = true;
         }
         if (!Kullanici.KULLANICIAKTIF.Value)
         {
             rbtnPasif.Checked = true;
         }
     }
     catch (Exception e)
     {
         Mesajlar.Hata(e);
     }
 }
예제 #5
0
 public AnaForm(Fonksiyonlar.TBL_KULLANICILAR GelenKullanici)
 {
     InitializeComponent();
     Kullanici = GelenKullanici;
     UserID    = Kullanici.ID;
     txtAltKullanici.Caption = Kullanici.KULLANICI;
     if (Kullanici.KODU == "Normal")
     {
         barBtnKullanici.Visibility = BarItemVisibility.Never;
     }
 }
예제 #6
0
 public AnaForm(Fonksiyonlar.TBL_KULLANICILAR GelenKullanici)
 {
     InitializeComponent();
     Kullanici = GelenKullanici;
     UserID    = Kullanici.ID;
     txtKullanicigöster.Caption = Kullanici.KULLANICI;
     if (Kullanici.AKTİF == "Normal")
     {
         barBtnLogin.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     }
 }
예제 #7
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     try
     {
         Fonksiyonlar.TBL_KULLANICILAR Kullanici = DB.TBL_KULLANICILARs.First(s => s.KULLANICI == txtKullanici.Text.Trim() && s.SIFRE == txtSifre.Text.Trim());
         Kullanici.LASTLOGIN = DateTime.Now;
         DB.SubmitChanges();
         this.Hide();
         AnaForm frm = new AnaForm(Kullanici);
         frm.Show();
     }
     catch (Exception)
     {
         MessageBox.Show("Girişi Yapılamadı.\nKullanıcı adı veya şifre hatalı.\n Lütfen kontrol edip tekrar deneyiniz.!\n", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
 }
예제 #8
0
 private void BtnGiris_Click(object sender, EventArgs e)
 {
     try
     {
         Fonksiyonlar.TBL_KULLANICILAR Kullanici = DB.TBL_KULLANICILAR.First(s => s.KULLANICI == txtKullanici.Text.Trim() && s.SIFRE == txtSifre.Text.Trim());
         Kullanici.LASTLOGIN = DateTime.Now;
         DB.SubmitChanges();
         this.Hide();
         AnaForm frm = new AnaForm(Kullanici);
         frm.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Kullancı adı veya şifreniz yanlış!");
         return;
     }
     //this.Hide();
     //AnaForm frm = new AnaForm();
     //frm.Show();
 }
        void YeniKaydet()
        {
            if (MD5eDonustur(txtSifre.Text) == MD5eDonustur(txtSıfreTekrar.Text))
            {
                if (txtIsim.Text == "")
                {
                    MessageBox.Show("Bir isim girişi yapmak zorundasınız.");
                    return;
                }
                else if (txtSoyIsim.Text == "")
                {
                    MessageBox.Show("Bir soyisim girişi yapmak zorundasınız.");
                    return;
                }
                else if (txtKullanıcıAdı.Text == "")
                {
                    MessageBox.Show("Bir kullanıcı adı girişi yapmak zorundasınız.");
                    return;
                }
                else if (txtSifre.Text == "")
                {
                    MessageBox.Show("Bir şifre girişi yapmak zorundasınız.");
                    return;
                }
                DialogResult Dr = MessageBox.Show(txtKullanıcıKodu.Text + "türünde bir kullanıcı açmak üzeresiniz. Emin misiniz?",
                                                  "Kullanıcı kaydı tamamlama", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Dr == DialogResult.Yes)
                {
                    try
                    {
                        if (!Ac)
                        {
                            if (DB.TBL_KULLANICILAR.Where(s => s.KULLANICI == txtKullanıcıAdı.Text).Count() > 0)
                            {
                                MessageBox.Show("Böyle bir kullanıcı zaten açılmış. Aynı kullanıcı adını tekrar kullanamazsınız!");
                                return;
                            }
                        }

                        Fonksiyonlar.TBL_KULLANICILAR Kullanici;
                        if (!Ac)
                        {
                            Kullanici = new Fonksiyonlar.TBL_KULLANICILAR();
                        }
                        else
                        {
                            Kullanici = DB.TBL_KULLANICILAR.First(s => s.ID == KullaniciID);
                        }
                        if (rBtnAktif.Checked)
                        {
                            Kullanici.KODU = true;
                        }
                        if (rBtnPasif.Checked)
                        {
                            Kullanici.KODU = false;
                        }
                        Kullanici.ISIM      = txtIsim.Text;
                        Kullanici.SOYISIM   = txtSoyIsim.Text;
                        Kullanici.KULLANICI = txtKullanıcıAdı.Text;
                        Kullanici.AKTİF     = txtKullanıcıKodu.Text;
                        if (Ac)
                        {
                            Kullanici.EDİTTİME = DateTime.Now;
                        }
                        else
                        {
                            Kullanici.SAVEDATE = DateTime.Now;
                        }
                        Kullanici.SİFRE = MD5eDonustur(txtSifre.Text);
                        if (!Ac)
                        {
                            DB.TBL_KULLANICILAR.InsertOnSubmit(Kullanici);
                        }
                        DB.SubmitChanges();
                        if (Ac)
                        {
                            Mesajlar.Guncelle(true);
                        }
                        else
                        {
                            Mesajlar.YeniKayıt(txtKullanıcıAdı.Text + " Kullanıcı kaydı açılmıştır");
                        }
                        Temizle();
                    }
                    catch (Exception EX)
                    {
                        Mesajlar.Hata(EX);
                    }
                }
            }
        }
예제 #10
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     if (txtSifre.Text.Trim() == txtSifreTekrar.Text.Trim())
     {
         if (txtIsim.Text == "")
         {
             MessageBox.Show("İsim Girilmesi Zorunludur.");
             return;
         }
         else if (txtSoyisim.Text == "")
         {
             MessageBox.Show("Soyisim Girilmesi Zorunludur.");
             return;
         }
         else if (txtKullaniciAdi.Text == "")
         {
             MessageBox.Show("Kullanıcı Adı Girilmesi Zorunludur.");
             return;
         }
         else if (txtSifre.Text == "")
         {
             MessageBox.Show("Şifre Girilmesi Zorunludur.");
             return;
         }
         DialogResult DR = MessageBox.Show(txtKullaniciKodu.Text + " türünde bir kullanıcı açmak üzeresiniz.", "Kullanıcı Kaydı Tamamlama", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (DR == System.Windows.Forms.DialogResult.Yes)
         {
             try
             {
                 if (!Ac)
                 {
                     if (DB.TBL_KULLANICILARs.Where(s => s.KULLANICI == txtKullaniciAdi.Text).Count() > 0)
                     {
                         MessageBox.Show("Böyle bir kullanıcı zaten var.Lütfen farklı bir ad giriniz.");
                         return;
                     }
                 }
                 Fonksiyonlar.TBL_KULLANICILAR Kullanici;
                 if (!Ac)
                 {
                     Kullanici = new Fonksiyonlar.TBL_KULLANICILAR();
                 }
                 else
                 {
                     Kullanici = DB.TBL_KULLANICILARs.First(s => s.ID == KullaniciID);
                 }
                 if (rbtnAktif.Checked)
                 {
                     Kullanici.AKTIF = true;
                 }
                 if (rbtnPasif.Checked)
                 {
                     Kullanici.AKTIF = true;
                 }
                 Kullanici.ISIM      = txtIsim.Text;
                 Kullanici.SOYISIM   = txtSoyisim.Text;
                 Kullanici.KULLANICI = txtKullaniciAdi.Text;
                 Kullanici.KODU      = txtKullaniciKodu.Text;
                 if (Ac)
                 {
                     Kullanici.EDITDATE = DateTime.Now;
                 }
                 else
                 {
                     Kullanici.SAVEDATE = DateTime.Now;
                 }
                 Kullanici.SIFRE = txtSifre.Text;
                 if (!Ac)
                 {
                     DB.TBL_KULLANICILARs.InsertOnSubmit(Kullanici);
                 }
                 DB.SubmitChanges();
                 if (Ac)
                 {
                     Mesajlar.Guncelle(true);
                 }
                 else
                 {
                     Mesajlar.YeniKayit(txtKullaniciAdi.Text + " kullanıcı kaydı açılmıştır.");
                 }
                 Temizle();
             }
             catch (Exception ex)
             {
                 Mesajlar.Hata(ex);
             }
         }
     }
     else
     {
         MessageBox.Show("Şifreler Aynı değil!");
     }
 }
예제 #11
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     if (txtSifre.Text.Trim() == txtSifreT.Text.Trim())
     {
         if (txtAdSoyad.Text == "")
         {
             MessageBox.Show("İsim Girişi Yapın");
             return;
         }
         else if (txtKullaniciAdi.Text == "")
         {
             MessageBox.Show("Kullanıcı Adı Girin");
         }
         else if (txtSifre.Text == "")
         {
             MessageBox.Show("Şifre Girin");
         }
         DialogResult DR = MessageBox.Show(txtKullaniciAdi.Text + " Türünde bir kullanıcı açmak üzeresiniz Eminmisiniz ?", "Kullanıcı Kaydı Tamamlama", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (DR == System.Windows.Forms.DialogResult.Yes)
         {
             try
             {
                 if (!ac)
                 {
                     if (DB.TBL_KULLANICILARs.Where(s => s.KULLANICIADI == txtKullaniciAdi.Text).Count() > 0)
                     {
                         MessageBox.Show("Böyle bir kullanıcı var zaten kullanıcı adını değiş");
                         return;
                     }
                 }
                 Fonksiyonlar.TBL_KULLANICILAR Kullanici;
                 if (!ac)
                 {
                     Kullanici = new Fonksiyonlar.TBL_KULLANICILAR();
                 }
                 else
                 {
                     Kullanici = DB.TBL_KULLANICILARs.First(s => s.ID == KullaniciID);
                 }
                 if (rbtnAktif.Checked)
                 {
                     Kullanici.KULLANICIAKTIF = true;
                 }
                 if (rbtnPasif.Checked)
                 {
                     Kullanici.KULLANICIAKTIF = false;
                 }
                 Kullanici.KULLANICIADSOYAD = txtAdSoyad.Text;
                 Kullanici.KULLANICIADI     = txtKullaniciAdi.Text;
                 Kullanici.KULLANICIKODU    = txtKullaniciTuru.Text;
                 if (ac)
                 {
                     Kullanici.KULLANICIEDITDATE = DateTime.Now;
                 }
                 else
                 {
                     Kullanici.KULLANICISAVEDATE = DateTime.Now;
                 }
                 Kullanici.KULLANICISIFRE = txtSifre.Text;
                 if (!ac)
                 {
                     DB.TBL_KULLANICILARs.InsertOnSubmit(Kullanici);
                 }
                 DB.SubmitChanges();
                 if (ac)
                 {
                     Mesajlar.Guncelle(true);
                 }
                 else
                 {
                     Mesajlar.YeniKayit(txtKullaniciAdi.Text + " Kullanıcı Kaydı Açılmıştır");
                 }
                 Temizle();
             }
             catch (Exception ex)
             {
                 Mesajlar.Hata(ex);
             }
         }
     }
     else
     {
         MessageBox.Show("Şifreler Aynı Değildir");
     }
 }