//Form ekranındaki bilgilerin doğruluğunu test eder //Doğru bilgiler girildiyse AdminIslev formunu açar private void btnGirisYap_Click(object sender, EventArgs e) { try { Kullanicilar user = new Kullanicilar(); user.KullaniciAdi = txtKullaniciAdi.Text; user.Sifre = txtSifre.Text; string md5 = Tools.CreateMD5(user.Sifre); if (string.IsNullOrEmpty(user.KullaniciAdi) || string.IsNullOrEmpty(md5)) { throw new ValidationException("Kullanıcı Adı ve Şifre Boş Geçilemez !"); } user.Sifre = md5; var result = KullaniciController.UserAdminLogin(user); LoginForm._session = eRoller.Admin.ToString(); LoginForm._userIdSession = result.KullaniciId; AdminIslevleri dyif = new AdminIslevleri(); dyif.Show(); this.Hide(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Hata Meydana Geldi !", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnGiris_Click(object sender, EventArgs e) { try { Kullanıcılar kullanici = new Kullanıcılar { kullaniciAdi = txtKullaniciAdi.Text, kullaniciSifre = int.Parse(txtSifre.Text) }; if (string.IsNullOrEmpty(kullanici.kullaniciAdi) || string.IsNullOrEmpty(kullanici.kullaniciSifre.ToString())) { throw new Exception("Kullanıcı Adı ve Şifre Boş Geçilemez !"); } var result = KullaniciController.SatinAlmaYetkilisiGiris(kullanici); FormKullaniciSecim._session = eRoles.SatinAlmaBirimi.ToString(); FormKullaniciSecim._userIdSession = result.kullaniciID; FormSatınAlmaBirimi sab = new FormSatınAlmaBirimi(); sab.Show(); this.Hide(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Hata Meydana Geldi !", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void KullaniciKayitVar() { KullaniciController controller = new KullaniciController(); Kullanicilar k = new Kullanicilar(); k.Ad = "Mehmet"; k.Soyad = "Ceylan"; k.Sifre = "123456"; k.KullaniciAdi = "admin"; var sonuc = controller.Yeni(k) as ViewResult; var urun = (Kullanicilar)sonuc.ViewData.Model; Assert.AreEqual("admin", k.KullaniciAdi); }
public void AdminGirisi() { var kullanici = new Kullanicilar(); KullaniciController.UserAdminLogin(kullanici); }
public static void ComboBoxKullaniciGetir(ComboBox cmb) { cmb.DataSource = KullaniciController.KullanicilariListele(); cmb.DisplayMember = "kullaniciAdi"; cmb.ValueMember = "kullaniciID"; }
public void TestKullaniciEkle() { zimmetdbEntities db = new zimmetdbEntities(); KullaniciController.KullaniciEkle(db, "A", "Admin", "hikmet35", "Hikmet", "Dönmez", "1234"); }
public FormKullaniciTanimla(int kID) { InitializeComponent(); kc = new KullaniciController(); _olusturanPersonelID = kID; }