daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Jul 18th, 2018 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using KetNoiCSDL.EF;
  7.  
  8. namespace KetNoiCSDL.Dao
  9. {
  10.     class UserDao
  11.     {
  12.         private BanhangOnlineDbContext db = null;
  13.         public UserDao()
  14.         {
  15.             db = new BanhangOnlineDbContext();
  16.         }
  17.  
  18.         // insert User
  19.         public long Insert(User entity)
  20.         {
  21.             db.Users.Add(entity);
  22.             db.SaveChanges();
  23.             return entity.ID;
  24.         }
  25.  
  26.         // Kiem tra login
  27.         public bool Login(string UserName, string PassWord)
  28.         {
  29.             var res = db.Users.Count(m => m.UserName == UserName && m.Password == PassWord);
  30.  
  31.             if (res > 0)
  32.             {
  33.                 return true;
  34.             } else
  35.                 return false;
  36.         }
  37.     }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top