Advertisement
hocle97th

Untitled

Jan 20th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Data;
  7.  
  8. namespace QuanLyDiemHocSinhTHPT.DAO
  9. {
  10.     class AccountDAO
  11.     {
  12.         private static AccountDAO instance;
  13.  
  14.         public static AccountDAO Instance
  15.         {
  16.             get { if (instance == null) instance = new AccountDAO(); return instance; }
  17.             private set { instance = value; }
  18.         }
  19.  
  20.         private AccountDAO() { }
  21.  
  22.         public bool Login(string userName, string passWord)
  23.         {
  24.             string query = "SELECT * FROM dbo.ACCOUNT WHERE UserName = N'" + userName + "' AND PassWord = N'" + passWord + "' ";
  25.  
  26.             DataTable result = DataProvider.Instance.ExecuteQuery(query);
  27.  
  28.             return result.Rows.Count > 0;
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement