Exemplo n.º 1
0
 /// <summary>
 /// Check Login Account
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public List<Account> CheckLoginAccount(string userName, string password)
 {
     List<Account> list = new List<Account>();
     using (SqlCommand cmd = GetCommand("checkLoginAccount", CommandType.StoredProcedure))
     {
         AddParameter(cmd, "@UserName", userName);
         AddParameter(cmd, "@Password", password);
         Account account = new Account();
         using (SqlDataReader dr = ExeDataReader(cmd))
         {
             if (dr.HasRows)
             {
                 while (dr.Read())
                 {
                     list.Add(account.AccountIDatareader(dr));
                 }
                 account = null;
                 return list;
             }
             else
                 return null;
         }
     }
 }
Exemplo n.º 2
0
 public List<Account> GetAccountByBranchID(string id)
 {
     List<Account> list = new List<Account>();
     using (SqlCommand cmd = GetCommand("getAccountByBranchID", CommandType.StoredProcedure))
     {
         AddParameter(cmd, "@BranchID", Convert.ToInt32(id));
         Account account = new Account();
         using (SqlDataReader dr = ExeDataReader(cmd))
         {
             if (dr.HasRows)
             {
                 while (dr.Read())
                 {
                     list.Add(account.AccountIDatareader(dr));
                 }
             }
         }
         account = null;
     }
     return list;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Search Account by UserName
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public List<Account> SearchAccountByUserName(string userName)
 {
     List<Account> list = new List<Account>();
     using (SqlCommand cmd = GetCommand("searchAccountByUserName", CommandType.StoredProcedure))
     {
         AddParameter(cmd, "@UserName", userName);
         Account account = new Account();
         using (SqlDataReader dr = ExeDataReader(cmd))
         {
             if (dr.HasRows)
             {
                 while (dr.Read())
                 {
                     list.Add(account.AccountIDatareader(dr));
                 }
             }
         }
         account = null;
     }
     return list;
 }
Exemplo n.º 4
0
 public List<Account> GetAllAccount()
 {
     List<Account> list = new List<Account>();
     using (SqlCommand cmd = GetCommand("getAllAccount", CommandType.StoredProcedure))
     {
         Account account = new Account();
         using (SqlDataReader dr = ExeDataReader(cmd))
         {
             if (dr.HasRows)
             {
                 while (dr.Read())
                 {
                     list.Add(account.AccountIDatareader(dr));
                 }
             }
         }
         account = null;
     }
     return list;
 }