예제 #1
0
        public CustomEditAuthorInAuthorship(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();
            propdata = new Profiles.Profile.Utilities.DataIO();

            this._subject      = Convert.ToInt64(Request.QueryString["subject"]);
            this._predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this._personId     = data.GetPersonID(_subject);

            Session["NodeID"]    = this._subject;
            Session["SessionID"] = sm.Session().SessionID;

            this.PropertyListXML = propdata.GetPropertyList(pagedata, base.PresentationXML, this._predicateuri, false, true, false);

            securityOptions.Subject        = this._subject;
            securityOptions.PredicateURI   = this._predicateuri;
            securityOptions.PrivacyCode    = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);


            securityOptions.BubbleClick += SecurityDisplayed;
        }
예제 #2
0
        public System.IO.Stream GetUserPhotoList(Int64 NodeID, bool harvarddefault)
        {
            Object result = null;
            Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();
            //Use the editor method to resize the photo to 150.
            Edit.Utilities.DataIO resize = new Profiles.Edit.Utilities.DataIO();

            try
            {
                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;

                SqlConnection dbconnection = new SqlConnection(connstr);
                dbconnection.Open();

                SqlCommand dbcommand;
                if (harvarddefault)
                {
                    dbcommand = new SqlCommand("select photo from [Catalyst.].[Person.Photo] where personid = " + data.GetPersonID(NodeID).ToString());
                    dbcommand.CommandType = CommandType.Text;
                    dbcommand.CommandTimeout = base.GetCommandTimeout();
                }
                else
                {
                    dbcommand = new SqlCommand("[Profile.Data].[Person.GetPhotos]");
                    dbcommand.CommandType = CommandType.StoredProcedure;
                    dbcommand.CommandTimeout = base.GetCommandTimeout();
                    dbcommand.Parameters.Add(new SqlParameter("@NodeID", NodeID));
                }
                dbcommand.Connection = dbconnection;

                result = resize.ResizeImageFile((byte[])dbcommand.ExecuteScalar(), 150);

                if (result == null)
                {
                    result = (byte[])System.Text.Encoding.ASCII.GetBytes("null");
                }

                dbconnection.Close();

            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }

            return new System.IO.MemoryStream((byte[])result);
        }
예제 #3
0
        public System.IO.Stream GetUserPhotoList(Int64 NodeID, bool harvarddefault)
        {
            Object result = null;

            Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();
            //Use the editor method to resize the photo to 150.
            Edit.Utilities.DataIO resize = new Profiles.Edit.Utilities.DataIO();

            try
            {
                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;


                SqlConnection dbconnection = new SqlConnection(connstr);
                dbconnection.Open();

                SqlCommand dbcommand;
                if (harvarddefault)
                {
                    dbcommand                = new SqlCommand("select photo from [Catalyst.].[Person.Photo] where personid = " + data.GetPersonID(NodeID).ToString());
                    dbcommand.CommandType    = CommandType.Text;
                    dbcommand.CommandTimeout = base.GetCommandTimeout();
                }
                else
                {
                    dbcommand                = new SqlCommand("[Profile.Data].[Person.GetPhotos]");
                    dbcommand.CommandType    = CommandType.StoredProcedure;
                    dbcommand.CommandTimeout = base.GetCommandTimeout();
                    dbcommand.Parameters.Add(new SqlParameter("@NodeID", NodeID));
                }
                dbcommand.Connection = dbconnection;

                result = resize.ResizeImageFile((byte[])dbcommand.ExecuteScalar(), 150);

                if (result == null)
                {
                    result = (byte[])System.Text.Encoding.ASCII.GetBytes("null");
                }

                dbconnection.Close();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }

            return(new System.IO.MemoryStream((byte[])result));
        }