Exemplo n.º 1
0
        public static string AddRemovePerson(string listid, string personid, bool remove = false)
        {
            SessionManagement sm = new SessionManagement();

            Profiles.Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            using (SqlConnection sqlconnection = new SqlConnection(dataio.GetConnectionString()))
            {
                SqlCommand cmd = new SqlCommand("[Profile.Data].[List.AddRemove.Person]", sqlconnection);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlParameter parm = new SqlParameter("@UserID", SqlDbType.Int);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = listid;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@PersonID", SqlDbType.Int);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = Convert.ToInt32(personid);
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@Remove", SqlDbType.Bit);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = remove;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@Size", SqlDbType.Int);
                parm.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parm);

                sqlconnection.Open();
                cmd.ExecuteNonQuery();
                sqlconnection.Close();

                sm.Session().ListSize = cmd.Parameters["@Size"].Value.ToString();
            }

            return(sm.Session().ListSize);
        }
Exemplo n.º 2
0
        public static void DeleteSelected(string ListID, string personids, bool remove = true)
        {
            if (personids.Trim() != "")
            {
                Profiles.Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
                SessionManagement sm = new SessionManagement();
                using (SqlConnection sqlconnection = new SqlConnection(dataio.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("[Profile.Data].[List.AddRemove.SelectedPeople]", sqlconnection);
                    cmd.CommandTimeout = dataio.GetCommandTimeout();
                    cmd.CommandType    = CommandType.StoredProcedure;
                    SqlParameter parm = new SqlParameter("@UserID", SqlDbType.Int);
                    parm.Direction = ParameterDirection.Input;
                    parm.Value     = ListID;
                    cmd.Parameters.Add(parm);
                    parm           = new SqlParameter("@SelectedPeople", SqlDbType.NVarChar);
                    parm.Direction = ParameterDirection.Input;
                    parm.Value     = personids;
                    cmd.Parameters.Add(parm);
                    parm           = new SqlParameter("@Remove", SqlDbType.Bit);
                    parm.Direction = ParameterDirection.Input;
                    parm.Value     = remove;
                    cmd.Parameters.Add(parm);
                    parm           = new SqlParameter("@Size", SqlDbType.Int);
                    parm.Direction = ParameterDirection.Output;
                    cmd.Parameters.Add(parm);

                    sqlconnection.Open();
                    cmd.ExecuteNonQuery();
                    sqlconnection.Close();

                    sm.Session().ListSize = cmd.Parameters["@Size"].Value.ToString();
                }
            }
        }
Exemplo n.º 3
0
        public static SqlDataReader GetGMapList(string listid, string which, string sessionid)
        {
            SqlDataReader dbreader = null;

            try
            {
                Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
                string        connstr             = dataio.GetConnectionString();
                SqlConnection dbconnection        = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = string.Format("exec [Profile.Module].[NetworkMap.GetList] @UserID = {0}, @which ={1},@sessionid = '{2}'", listid, which, sessionid);
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();
                dbcommand.Connection     = dbconnection;
                dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }

            return(dbreader);
        }
Exemplo n.º 4
0
        public static string GetSummary(string listid, string type)
        {
            SummaryChart sc = new SummaryChart();

            List <SummaryItem> rawitems = new List <SummaryItem>();
            List <SummaryItem> rtnitems = new List <SummaryItem>();

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = string.Format("exec [Profile.Data].[List.GetSummary]  @UserID = {0}", listid);
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();

                dbcommand.Connection = dbconnection;
                using (SqlDataReader dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dbreader.Read())
                    {
                        rawitems.Add(new SummaryItem {
                            Variable = dbreader["Variable"].ToString(), Value = dbreader["Value"].ToString().Replace("'", "\\'"), n = Convert.ToInt32(dbreader["n"]), color = ""
                        });
                    }

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }

            rtnitems = rawitems.FindAll(o => o.Variable.ToLower() == type.ToLower()).ToList();

            sc.cols = "{\"cols\": [{\"id\":\"\",\"label\": \"" + type + "\",\"pattern\":\"\",\"type\":\"string\"},{\"id\":\"\",\"label\":\"Count\",\"pattern\":\"\",\"type\":\"number\"}],";
            sc.rows = "\"rows\":[";
            foreach (SummaryItem si in rtnitems)
            {
                sc.rows += "{ \"c\":[{\"v\":\"" + si.Value + "\"},{\"v\":" + si.n.ToString() + "}]},";
            }
            sc.rows   = sc.rows.Substring(0, sc.rows.Length - 1);
            sc.colors = "],\"colors\":\"[#4E79A7,#F28E2B,#E15759,#76B7B2,#59A14F,#EDC948,#B07AA1,#FF9DA7,#9C755F,#BAB0AC]\"}";

            return(sc.cols + sc.rows + sc.colors);
        }
        public PropertyList(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            XmlDocument presentationxml = base.PresentationXML;
            SessionManagement sm = new SessionManagement();

            Framework.Utilities.DataIO data = new Framework.Utilities.DataIO();

            this.PropertyListXML = data.GetPropertyList(pagedata, presentationxml,"",false,false,true);

            mp = new ModulesProcessing();
        }
Exemplo n.º 6
0
        public static string GetNetworkRadialCoAuthors(string listid)
        {
            string str = string.Empty;


            if (Framework.Utilities.Cache.FetchObject(listid + "LISTGetNetworkRadialCoAuthors") == null)
            {
                Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
                try
                {
                    string        connstr      = dataio.GetConnectionString();
                    SqlConnection dbconnection = new SqlConnection(connstr);
                    SqlCommand    dbcommand    = new SqlCommand("[Profile.Module].[NetworkRadial.List.GetCoAuthors]");

                    SqlDataReader dbreader;
                    dbconnection.Open();
                    dbcommand.CommandType    = CommandType.StoredProcedure;
                    dbcommand.CommandTimeout = dataio.GetCommandTimeout();
                    dbcommand.Parameters.Add(new SqlParameter("@OutputFormat", "JSON"));
                    dbcommand.Parameters.Add(new SqlParameter("@UserID", listid));

                    dbcommand.Connection = dbconnection;
                    dbreader             = dbcommand.ExecuteReader(CommandBehavior.CloseConnection);

                    while (dbreader.Read())
                    {
                        str += dbreader[0].ToString();
                    }

                    Framework.Utilities.DebugLogging.Log(str);

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }

                    Framework.Utilities.Cache.Set(listid + "LISTGetNetworkRadialCoAuthors", str);
                }
                catch (Exception ex)
                {
                    Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace);
                }
            }
            else
            {
                str = (string)Framework.Utilities.Cache.FetchObject(listid + "LISTGetNetworkRadialCoAuthors");
            }

            return(str);
        }
Exemplo n.º 7
0
        public static List <SummaryItem> GetSummaryRaw(string listid, string type)
        {
            SummaryChart sc = new SummaryChart();

            List <SummaryItem> rawitems = new List <SummaryItem>();
            List <SummaryItem> rtnitems = new List <SummaryItem>();

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = string.Format("exec [Profile.Data].[List.GetSummary]  @UserID = {0}", listid);
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();

                dbcommand.Connection = dbconnection;
                using (SqlDataReader dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dbreader.Read())
                    {
                        rawitems.Add(new SummaryItem {
                            Variable = dbreader["Variable"].ToString(), Value = dbreader["Value"].ToString().Replace("'", "\\'"), n = Convert.ToInt32(dbreader["n"]), color = ""
                        });
                    }

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }

            rtnitems = rawitems.FindAll(o => o.Variable.ToLower() == type.ToLower()).ToList();



            return(rtnitems);
        }
Exemplo n.º 8
0
        public static string PersonExists(string listid, string personid)
        {
            string data = string.Empty;

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();
                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = string.Format("select count(*) as count from [Profile.Data].[List.Member]  where UserID = {0} and personid = {1}", listid, personid);
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();

                dbcommand.Connection = dbconnection;
                using (SqlDataReader dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dbreader.Read())
                    {
                        data = dbreader[0].ToString();
                    }

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }
                }


                if (dbcommand.Connection.State != ConnectionState.Closed)
                {
                    dbcommand.Connection.Close();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            return(data);
        }
Exemplo n.º 9
0
        public static void GetCoauthorConnections(string listid)
        {
            StringBuilder data = new StringBuilder();

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();


                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = string.Format("exec [Profile.Data].[List.ExportCoAuthorConnections] @UserID={0}", listid);
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();

                dbcommand.Connection = dbconnection;
                using (SqlDataReader dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dbreader.Read())
                    {
                        data.AppendLine(dbreader[0].ToString());
                    }

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }


                    GetCSV(data.ToString(), "Connections");
                }
            }
            catch (Exception e)
            {
                //donothingbecause of the end();;;; calllllllll
            }
        }
Exemplo n.º 10
0
        public static string GetNetworkRadialCoAuthors(string listid)
        {
            StringBuilder data = new StringBuilder();

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();


                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = string.Format("exec [Profile.Module].[NetworkRadial.List.GetCoAuthors] @OutputFormat='JSON', @UserID={0}", listid);
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();

                dbcommand.Connection = dbconnection;
                using (SqlDataReader dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dbreader.Read())
                    {
                        data.AppendLine(dbreader[0].ToString());
                    }

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }


            return(data.ToString());
        }
Exemplo n.º 11
0
        public static void AddRemoveSearchResults(bool remove = false)
        {
            SessionManagement sm     = new SessionManagement();
            string            listid = sm.Session().ListID;


            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            using (SqlConnection sqlconnection = new SqlConnection(dataio.GetConnectionString()))
            {
                SqlCommand cmd = new SqlCommand("[Profile.Data].[List.AddRemove.Search]", sqlconnection);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlParameter parm = new SqlParameter("@SessionID", SqlDbType.UniqueIdentifier);
                parm.Value     = Guid.Parse(sm.Session().SessionID);
                parm.Direction = ParameterDirection.Input;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@UserID", SqlDbType.Int);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = listid;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@SearchXML", SqlDbType.Xml);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = HttpContext.Current.Session["SEARCHREQUEST"].ToString();
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@Remove", SqlDbType.Bit);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = remove;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@Size", SqlDbType.Int);
                parm.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parm);

                sqlconnection.Open();
                cmd.ExecuteNonQuery();
                sqlconnection.Close();

                sm.Session().ListSize = cmd.Parameters["@Size"].Value.ToString();
            }
        }
Exemplo n.º 12
0
        public static string GetList()
        {
            SessionManagement sm = new SessionManagement();

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                using (SqlConnection sqlconnection = new SqlConnection(dataio.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("[Profile.Data].[List.GetList]", sqlconnection);
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlParameter parm = new SqlParameter("@SessionID", SqlDbType.UniqueIdentifier);
                    parm.Value     = Guid.Parse(sm.Session().SessionID);
                    parm.Direction = ParameterDirection.Input;
                    cmd.Parameters.Add(parm);
                    parm           = new SqlParameter("@ListID", SqlDbType.Int);
                    parm.Direction = ParameterDirection.Output;
                    cmd.Parameters.Add(parm);
                    parm           = new SqlParameter("@Size", SqlDbType.Int);
                    parm.Direction = ParameterDirection.Output;
                    cmd.Parameters.Add(parm);
                    sqlconnection.Open();
                    cmd.ExecuteNonQuery();
                    sqlconnection.Close();


                    sm.Session().ListID   = cmd.Parameters["@ListID"].Value.ToString();
                    sm.Session().ListSize = cmd.Parameters["@Size"].Value.ToString();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }


            return(sm.Session().ListID);
        }
Exemplo n.º 13
0
        public static void DeleteFildered(string listid, string institution, string facultyrank)
        {
            Profiles.Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            SessionManagement sm = new SessionManagement();

            using (SqlConnection sqlconnection = new SqlConnection(dataio.GetConnectionString()))
            {
                SqlCommand cmd = new SqlCommand("[Profile.Data].[List.AddRemove.Filter]", sqlconnection);
                cmd.CommandTimeout = dataio.GetCommandTimeout();
                cmd.CommandType    = CommandType.StoredProcedure;
                SqlParameter parm = new SqlParameter("@UserID", SqlDbType.Int);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = listid;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@Institution", SqlDbType.NVarChar);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = institution;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@FacultyRank", SqlDbType.NVarChar);
                parm.Direction = ParameterDirection.Input;

                parm.Value = facultyrank;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@Remove", SqlDbType.Bit);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = true;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@Size", SqlDbType.Int);
                parm.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parm);

                sqlconnection.Open();
                cmd.ExecuteNonQuery();
                sqlconnection.Close();

                sm.Session().ListSize = cmd.Parameters["@Size"].Value.ToString();
            }
        }
Exemplo n.º 14
0
        public static string GetSocialMediaPlugInData(Int64 subject, string name)
        {
            string data = string.Empty;

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();


                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = "exec [Profile.Module].[GenericRDF.GetPluginData]  @Name = '" + name + "', @NodeID = " + subject.ToString();
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();

                dbcommand.Connection = dbconnection;
                using (SqlDataReader dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dbreader.Read())
                    {
                        data = dbreader["Data"].ToString();
                    }

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            return(data.Trim());
        }
Exemplo n.º 15
0
        public static string CreateList(string listownerid, string ListName)
        {
            string data = string.Empty;

            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();


                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = string.Format("exec [Profile.Data].[List.CreateList]  @OwnerNodeID = {0}, @ListName = '{1}'", listownerid, ListName);
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();

                dbcommand.Connection = dbconnection;
                using (SqlDataReader dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dbreader.Read())
                    {
                        data = dbreader[0].ToString();
                    }

                    if (!dbreader.IsClosed)
                    {
                        dbreader.Close();
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            return(data.Trim());
        }
Exemplo n.º 16
0
        public static void AddEditPluginData(string name, Int64 subject, string data, string searchableitem)
        {
            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            try
            {
                string        connstr      = dataio.GetConnectionString();
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType    = CommandType.Text;
                dbcommand.CommandText    = "exec [Profile.Module].[GenericRDF.AddEditPluginData] @Name = '" + name + "', @NodeID = " + subject.ToString() + ", @data='" + data + "', @searchabledata ='" + searchableitem + "'";
                dbcommand.CommandTimeout = dataio.GetCommandTimeout();
                Framework.Utilities.Cache.AlterDependency(subject.ToString());
                dbcommand.Connection = dbconnection;
                dbcommand.ExecuteNonQuery();
                dbcommand.Connection.Close();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Exemplo n.º 17
0
        public static ProfilesList GetPeople(string institution = "", string facultyrank = "")
        {
            ProfilesList pl = new ProfilesList();

            SessionManagement sm     = new SessionManagement();
            string            listid = sm.Session().ListID;


            Framework.Utilities.DataIO dataio = new Framework.Utilities.DataIO();
            using (SqlConnection sqlconnection = new SqlConnection(dataio.GetConnectionString()))
            {
                SqlCommand cmd = new SqlCommand("[Profile.Data].[List.GetPeople]", sqlconnection);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlParameter parm = new SqlParameter("@UserID", SqlDbType.Int);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = listid;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@ReturnInstitutions", SqlDbType.Bit);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = true;
                cmd.Parameters.Add(parm);
                parm           = new SqlParameter("@ReturnFacultyRanks", SqlDbType.Bit);
                parm.Direction = ParameterDirection.Input;
                parm.Value     = true;
                cmd.Parameters.Add(parm);

                if (!string.IsNullOrEmpty(institution))
                {
                    parm           = new SqlParameter("@Institution", SqlDbType.VarChar);
                    parm.Direction = ParameterDirection.Input;
                    parm.Value     = institution;
                    cmd.Parameters.Add(parm);
                }
                if (!string.IsNullOrEmpty(facultyrank))
                {
                    parm           = new SqlParameter("@FacultyRank", SqlDbType.VarChar);
                    parm.Direction = ParameterDirection.Input;
                    parm.Value     = facultyrank;
                    cmd.Parameters.Add(parm);
                }

                parm           = new SqlParameter("@NumPeople", SqlDbType.Int);
                parm.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parm);

                sqlconnection.Open();
                using (SqlDataReader dbreader = cmd.ExecuteReader())
                {
                    pl.Institutions = new List <GenericListItem>();
                    while (dbreader.Read())
                    {
                        pl.Institutions.Add(new GenericListItem(dbreader["InstitutionName"].ToString(), dbreader["n"].ToString()));
                    }
                    dbreader.NextResult();
                    pl.FacultyRanks = new List <GenericListItem>();
                    while (dbreader.Read())
                    {
                        pl.FacultyRanks.Add(new GenericListItem(dbreader["FacultyRank"].ToString(), dbreader["n"].ToString()));
                    }

                    dbreader.NextResult();
                    pl.ListItems = new List <ProfilesListItem>();
                    while (dbreader.Read())
                    {
                        pl.ListItems.Add(new ProfilesListItem
                        {
                            PersonID        = dbreader[0].ToString(),
                            DisplayName     = dbreader[1].ToString(),
                            FirstName       = dbreader[2].ToString(),
                            LastName        = dbreader[3].ToString(),
                            InstitutionName = dbreader[4].ToString(),
                            FacultyRank     = dbreader[5].ToString(),
                            DepartmentName  = dbreader[6].ToString()
                        });
                    }
                }
                sqlconnection.Close();
            }



            return(pl);
        }