Exemplo n.º 1
0
        public Entity.Models.Kullanici KullaniciGiris(string kullaniciAdi, string kullaniciSifre)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(kullaniciAdi.Trim()) || String.IsNullOrWhiteSpace(kullaniciAdi.Trim()))
                {
                    throw new Exception("Kullanıcı Adı ve Sifre Boş Geçilemez");
                }

                var sifre = new ToPasswordRepository().Md5(kullaniciSifre);
                Entity.Models.Kullanici kullanici = _kullaniciDal.KullaniciGiris(kullaniciAdi, sifre);

                if (kullanici == null)
                {
                    throw new Exception("Kullanıcı Adı veya Şifre Hatalı");
                }
                else
                {
                    return(kullanici);
                }
            }
            catch (Exception e)
            {
                throw new Exception("Kullanıcı giriş Hata : " + e.Message);
            }
        }
        public Kullanici KullaniciGiris(string kullaniciAdi, string parola)
        {
            try
            {
                if (string.IsNullOrEmpty(kullaniciAdi.Trim()) || string.IsNullOrEmpty(parola.Trim()))
                {
                    throw new Exception("Kullanici Adı veya parola Boş geçilemez");
                }

                var sifre     = new ToPasswordRepository().Md5(parola);
                var kullanici = _kullaniciDal.KullaniciGiris(kullaniciAdi, sifre);
                if (kullanici == null)
                {
                    throw new Exception("Kullanici ve Parola hatalı");
                }
                else
                {
                    return(kullanici);
                }
            }
            catch (Exception error)
            {
                throw new Exception("Hata olustu" + error.Message);
            }
        }