Exemple #1
0
        public Calisanlar idAl(string username)
        {
            using (var context = new CarRentalAppContext())
            {
                // context.Database.Connection.Open();
                var result = context.Calisanlar.FirstOrDefault(x => x.KullaniciAdi == username);

                if (result == null)
                {
                    throw new AuthenticationException("Kullanıcı Girişi Başarısız !");
                }
                return(result);
            }
        }
Exemple #2
0
 public bool sifreKontrol(string username, string pass)
 {
     using (var context = new CarRentalAppContext())
     {
         var isUserValid = context.Calisanlar.FirstOrDefault(x => x.KullaniciAdi == username && x.Sifre == pass);
         if (isUserValid != null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Exemple #3
0
 public static Musteriler UserMusteriLogin(Musteriler modelUser)
 {
     if (string.IsNullOrEmpty(Convert.ToString(modelUser.KullaniciAdi)) && string.IsNullOrEmpty(modelUser.Sifre))
     {
         throw new AuthenticationException("Kullanici Verileri Boş Geçilemez !");
     }
     using (var context = new CarRentalAppContext())
     {
         var result = context.Musteriler.FirstOrDefault(x => x.KullaniciAdi == modelUser.KullaniciAdi && x.Sifre == modelUser.Sifre);
         if (result == null)
         {
             throw new AuthenticationException("Kullanıcı Girişi Başarısız !");
         }
         return(result);
     }
 }
        public static Calisanlar UserAdminLogin(Calisanlar modelUser)
        {
            if (string.IsNullOrEmpty(Convert.ToString(modelUser.KullaniciAdi)) && string.IsNullOrEmpty(modelUser.Sifre))
            {
                throw new AuthenticationException("Kullanici Verileri Boş Geçilemez !");
            }
            using (var context = new CarRentalAppContext())
            {
                // context.Database.Connection.Open();
                var result = context.Calisanlar.FirstOrDefault(x => x.KullaniciAdi == modelUser.KullaniciAdi && x.Sifre == modelUser.Sifre);

                if (result == null)
                {
                    throw new AuthenticationException("Kullanıcı Girişi Başarısız !");
                }
                return(result);
            }
        }
Exemple #5
0
 public CarService(CarRentalAppContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
 public ClassificationRepository(CarRentalAppContext context) : base(context)
 {
 }
 public RoleRepository(CarRentalAppContext context) : base(context)
 {
 }
 public BillRepository(CarRentalAppContext context) : base(context)
 {
 }
Exemple #9
0
 public ClientRepository(CarRentalAppContext context) : base(context)
 {
 }