Exemple #1
0
        public static Tuple <UserModel, bool, string> VerifyUser(string userName, int passWord)
        {
            bool      sonuc;
            string    mesaj = "";
            Kullanici user  = null;

            using (RestaurantEntities db = new RestaurantEntities())
            {
                try
                {
                    user = db.Kullanici.Where(k => k.KullaniciAdi == userName && k.isDeleted == false).First();
                    if (user.Sifre == passWord)
                    {
                        sonuc = true;
                        //user.OnlineMİ = true;
                        //db.SaveChanges();
                    }
                    else
                    {
                        mesaj = "Şifre yanlış girildi.";;
                        sonuc = false;
                    }
                }
                catch (Exception)
                {
                    mesaj = "Böyle bir kullanıcı bulunmamaktadır.";
                    sonuc = false;
                }



                return(new Tuple <UserModel, bool, string>(user.ConvertToUserModel(), sonuc, mesaj));
            }
        }