Пример #1
0
 public static (Bilet, bool) Add(Bilet b)
 {
     using (TrenEntities t = new TrenEntities())
     {
         t.Bilet.Add(b);
         if (t.SaveChanges() > 0)
         {
             return(b, true);
         }
         else
         {
             return(b, false);
         }
     }
 }
Пример #2
0
        public static (Kullanici, bool) SignIn(string userName, string password)
        {
            using (TrenEntities t = new TrenEntities())
            {
                Kullanici kullanici = new Kullanici();

                kullanici = t.Kullanici.FirstOrDefault(x => x.kullaniciAdi == userName && x.kullaniciSifre == password);

                if (kullanici != null)
                {
                    return(kullanici, true);
                }
                else
                {
                    return(kullanici, false);
                }
            }
        }