Ejemplo n.º 1
0
        PocoKullanici IKullaniciService.KullaniciGiris(string kullaniciAdi, string sifre)
        {
            if (string.IsNullOrEmpty(kullaniciAdi.Trim()))
            {
                throw new Exception("Kullanıcı Adı Boş Geçilemez.");
            }
            if (string.IsNullOrEmpty(sifre.Trim()))
            {
                throw new Exception("Parola Boş Geçilemez.");
            }
            var parola    = new ToPasswordRepository().Md5(sifre);
            var kullanici = kullaniciRepository.KullaniciGiris(kullaniciAdi, parola);

            if (kullanici == null)
            {
                throw new Exception("Kullanıcı Adınızı veya parolanızı kontrol ediniz.");
            }
            else
            {
                return(new PocoKullanici()
                {
                    KullaniciID = kullanici.KullaniciID,
                    KullaniciAdi = kullanici.KullaniciAdi,
                    KullaniciSoyadi = kullanici.KullaniciSoyadi,
                    YetkiID = kullanici.YetkiID
                });
            }
            //return kullaniciRepository.KullaniciGiris(kullaniciAdi, sifre);
        }
Ejemplo n.º 2
0
        public PocoKullanici KullaniciGiris(string kullaniciAdi, string parola)
        {
            if (string.IsNullOrEmpty(kullaniciAdi.Trim()))
            {
                throw new Exception("Kullanıcı Adı Boş Geçilemez.");
            }

            if (string.IsNullOrEmpty(parola.Trim()))
            {
                throw new Exception("Parola Boş Geçilemez.");
            }

            var sifre     = new ToPasswordRepository().Md5(parola);
            var kullanici = kullaniciRepository.KullaniciGiris(kullaniciAdi, sifre);

            if (kullanici == null)
            {
                throw new Exception("Kullanıcı Adınızı veya Parolanızı Kontrol Ediniz.");
            }
            else
            {
                return(new PocoKullanici()
                {
                    KullaniciID = kullanici.KullaniciID,
                    KullaniciAdi = kullanici.KullaniciAdi,
                    KullaniciSoyadi = kullanici.KullaniciSoyadi,
                    YetkiID = kullanici.YetkiID
                });
            }
        }