Beispiel #1
0
 private void btnEkleKullaniciYeni_Click(object sender, EventArgs e)
 {
     if (_kullaniciService.GetKullaniciByName(tbxKullaniciAdi.Text) == null && tbxKullaniciAdi.Text != string.Empty)
     {
         Roles role = Roles.normal;
         if (cbxAdminMi.Checked)
         {
             role = Roles.admin;
         }
         _kullaniciService.Add(new Kullanici
         {
             KullaniciAdi = tbxKullaniciAdi.Text,
             Password     = tbxParola.Text,
             isGecerli    = true,
             Role         = role
         });
         MessageBox.Show("Kullanıcı Eklendi");
     }
     else
     {
         MessageBox.Show("Kullanıcı Ekleme Başarısız");
     }
     LoadDGWKullanici();
 }