public override ACUser LoadUserInfo(int pUserId) { ACUser result = null; using (ConnectionWrapper cnn = ((DBManager)_dbManager).GetConnection()) { using (SqlCommand cmd = cnn.CreateCommand()) { cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "mlac_sp_usr_LoadUserInfo"; cmd.Parameters.Add(new SqlParameter("@pUserId", pUserId)); cnn.Open(); using (SqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) { result = new ACUser() { Id = pUserId, LoginName = reader.GetString(0), FirstName = reader.GetString(1), LastName = reader.GetString(2), Email = reader.GetString(3) }; } } } } return result; }
public override ACUser LoadUserInfo(int pUserId) { ACUser result = null; using (ConnectionWrapper cnn = ((DBManager)_dbManager).GetConnection()) { using (SQLiteCommand cmd = cnn.CreateCommand()) { cmd.CommandText = "SELECT [login_name],[first_name],[last_name],[email] FROM [mlac_tbl_users] WHERE [id]=@pUserId;"; cmd.Parameters.Add(new SQLiteParameter("@pUserId", pUserId)); cnn.Open(); using (SQLiteDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) { result = new ACUser() { Id = pUserId, LoginName = reader.GetString(0), FirstName = reader.GetString(1), LastName = reader.GetString(2), Email = reader.GetString(3) }; } } } } return result; }