public static List <Person_Alias> GetPersonAliasesExceptSSN(string personId)
        {
            DateTime      todayDt = DateTime.Today;
            StringBuilder sb      = new StringBuilder();

            sb.Append("SELECT  person_alias_type_cd, alias_pool_Cd, alias ");
            sb.Append("FROM  BAR_PERSON_ALIAS ");
            sb.Append("WHERE person_id = " + long.Parse(personId) + " ");
            sb.Append("AND person_alias_type_cd  <> '18' ");
            sb.Append("AND active_ind = '1' ");
            sb.Append("AND END_EFFECTIVE_DT_TM > '" + todayDt + "'");

            DataTable dt = new DataTable();

            using (var conn = new SqlConnection(GlobalSettings.SqlConnectionString()))
                using (var cmd = new SqlCommand(sb.ToString(), conn))
                    using (var da = new SqlDataAdapter(cmd))
                    {
                        cmd.CommandType = CommandType.Text;
                        da.Fill(dt);
                    }
            List <Person_Alias> aliases = new List <Person_Alias>();

            foreach (DataRow row in dt.Rows)
            {
                Person_Alias pa = LoadPersonAlias(row);
                aliases.Add(pa);
            }
            dt.Dispose();
            return(aliases);
        }
        public static List <Person_Alias> GetPersonAliasesExceptSSN(string personId)
        {
            if (personId.Contains(".0000") == false)
            {
                personId = personId + ".0000";
            }
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT  person_alias_type_cd, alias_pool_Cd, alias ");
            sb.Append("FROM  PERSON_ALIAS ");
            sb.Append("WHERE person_id = '" + personId + "' ");
            sb.Append("AND person_alias_type_cd  <> '18.0000' ");
            sb.Append("AND active_ind = '1.0000' ");

            DataTable dt = new DataTable();

            using (var conn = new SqlConnection(GlobalSettings.SqlConnectionString()))
                using (var cmd = new SqlCommand(sb.ToString(), conn))
                    using (var da = new SqlDataAdapter(cmd))
                    {
                        cmd.CommandType = CommandType.Text;
                        da.Fill(dt);
                    }
            List <Person_Alias> aliases = new List <Person_Alias>();

            foreach (DataRow row in dt.Rows)
            {
                Person_Alias pa = LoadPersonAlias(row);
                aliases.Add(pa);
            }
            return(aliases);
        }
        private static Person_Alias LoadPersonAlias(DataRow row)
        {
            Person_Alias alias = new Person_Alias();

            alias.Aleas_Pool = CodeValueDAL.GetCodeValueDisplay(row["alias_pool_Cd"].ToString());
            alias.Alias_Type = CodeValueDAL.GetCodeValueDisplay(row["person_alias_type_cd"].ToString());
            alias.Alias      = row["alias"].ToString();

            return(alias);
        }