Beispiel #1
0
 public static User Kayit(VMLogin Data)
 {
     using (PCDB db = new PCDB())
     {
         try
         {
             bool kontrol = db.User.Any(p => p.email == Data.email && p.Sifre == Data.Sifre);
             if (kontrol == false)
             {
                 db.User.Add(new User {
                     AdSoyad = Data.AdSoyad, email = Data.email, Sifre = Data.Sifre
                 });
                 db.SaveChanges();
                 return(db.User.FirstOrDefault(p => p.email == Data.email && p.Sifre == Data.Sifre));
             }
             else
             {
                 return(null);
             }
         }
         catch
         {
             return(null);
         }
     }
 }
Beispiel #2
0
 public static User Giris(VMLogin Data)
 {
     using (PCDB db = new PCDB())
     {
         try
         {
             return(db.User.FirstOrDefault(p => p.email == Data.email && p.Sifre == Data.Sifre));
         }
         catch
         {
             return(null);
         }
     }
 }