/// <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; } } }
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; }
/// <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; }
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; }