Пример #1
0
 public static User LoginKontrol(int tip, string sirketKod, string userName, string password)
 {
     using (UserRoleDBDataContext Context = new UserRoleDBDataContext(ConStr))
     {
         Context.DeferredLoadingEnabled = false;
         if (Context.Users.Any(x => x.Kod == userName))
         {
             User user = Context.Users.Where(x => x.Kod == userName && x.Tip == tip && x.Sirket == sirketKod).FirstOrDefault();
             if (user.IsNotNull())
             {
                 if (Sifreleme.Cozumle(user.Sifre) == password)
                 {
                     return(user);
                 }
                 else
                 {
                     return(null);
                 }
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
Пример #2
0
 private void formKullaniciEkle_Load(object sender, EventArgs e)
 {
     if (Kullanici.IsNotNullEmpty())
     {
         txtKullaniciAdi.Text = Kullanici.Kod;
         txtAdiSoyadi.Text    = Kullanici.AdSoyad;
         txtEmail.Text        = Kullanici.Email;
         try
         {
             txtParola.Text = Sifreleme.Cozumle(Kullanici.Sifre);
         }
         catch
         {
             txtParola.Text = Kullanici.Sifre;
         }
         chkAdmin.Checked = Kullanici.Admin;
         chkAktif.Checked = Kullanici.Aktif;
         this.Text        = "  Kullanıcı Güncelleme";
     }
 }