当前位置: 首页>>代码示例>>C#>>正文


C# SessionManagement.Session方法代码示例

本文整理汇总了C#中Profiles.Framework.Utilities.SessionManagement.Session方法的典型用法代码示例。如果您正苦于以下问题:C# SessionManagement.Session方法的具体用法?C# SessionManagement.Session怎么用?C# SessionManagement.Session使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profiles.Framework.Utilities.SessionManagement的用法示例。


在下文中一共展示了SessionManagement.Session方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UserLogin

        /// <summary>
        /// For User Authentication 
        /// </summary>
        /// <param name="user"></param>
        /// <param name="session"></param>
        public bool UserLogin(ref User user)
        {
            bool loginsuccess = false;

            try
            {
                SessionManagement sm = new SessionManagement();
                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;

                SqlConnection dbconnection = new SqlConnection(connstr);

                SqlParameter[] param = new SqlParameter[4];

                dbconnection.Open();

                param[0] = new SqlParameter("@UserName", user.UserName);
                param[1] = new SqlParameter("@Password", user.Password);

                param[2] = new SqlParameter("@UserID", null);
                param[2].DbType = DbType.Int32;
                param[2].Direction = ParameterDirection.Output;

                param[3] = new SqlParameter("@PersonID", null);
                param[3].DbType = DbType.Int32;
                param[3].Direction = ParameterDirection.Output;

                //For Output Parameters you need to pass a connection object to the framework so you can close it before reading the output params value.
                ExecuteSQLDataCommand(GetDBCommand(ref dbconnection, "[User.Account].[Authenticate]", CommandType.StoredProcedure, CommandBehavior.CloseConnection, param));

                dbconnection.Close();
                try
                {
                    user.UserID = Convert.ToInt32(param[2].Value.ToString());

                    if (param[3].Value != DBNull.Value)
                        user.PersonID = Convert.ToInt32(param[3].Value.ToString());
                }
                catch { }
                if (user.UserID != 0)
                {
                    loginsuccess = true;
                    sm.Session().UserID = user.UserID;
                    sm.Session().PersonID = user.PersonID;
                    sm.Session().LoginDate = DateTime.Now;
                    Session session = sm.Session();
                    SessionUpdate(ref session);
                    ActivityLog(user.PersonID, null, null);

                }

            }
            catch (Exception ex)
            {

                throw ex;
            }

            return loginsuccess;
        }
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:64,代码来源:DataIO.cs

示例2: Session_Start

        //***************************************************************************************************************************************
        /// <summary>
        /// 
        ///     Starts a Profiles instance of Profiles Session Management and Session State Information used for
        ///     security/data filters, tracking, auditing.
        ///     
        /// </summary>
        /// <param name="sender"> .Net context object</param>
        /// <param name="e"> .Net Event Arguments</param>
        protected void Session_Start(object sender, EventArgs e)
        {
            SessionManagement session = new SessionManagement();
            session.SessionCreate();

            if (session.Session() != null)
                Framework.Utilities.DebugLogging.Log("SESSION CREATED for: " + session.Session().SessionID);
            session = null;
        }
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:18,代码来源:Global.asax.cs

示例3: GetPublications

        /*
        public SqlDataReader GetPublications(RDFTriple request)
        {
            SessionManagement sm = new SessionManagement();

            string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
            SqlConnection dbconnection = new SqlConnection(connstr);
            SqlCommand dbcommand = new SqlCommand("[Profile.Module].[CustomViewAuthorInAuthorshipForORCID.GetList]");

            SqlDataReader dbreader;
            dbconnection.Open();
            dbcommand.CommandType = CommandType.StoredProcedure;
            dbcommand.CommandTimeout = base.GetCommandTimeout();
            dbcommand.Parameters.Add(new SqlParameter("@nodeid", request.Subject));
            dbcommand.Parameters.Add(new SqlParameter("@sessionid", sm.Session().SessionID));
            dbcommand.Connection = dbconnection;
            dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection);

            return dbreader;
        }

         */
        public string GetInternalUserID()
        {
            SessionManagement sm = new SessionManagement();

            string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
            SqlConnection dbconnection = new SqlConnection(connstr);
            SqlCommand dbcommand = new SqlCommand("SELECT UserID, InternalUserName FROM [User.Account].[User] WHERE (UserID = @userid)");

            SqlDataReader dbreader;
            dbconnection.Open();
            dbcommand.CommandType = CommandType.Text;
            dbcommand.CommandTimeout = GetCommandTimeout();
            dbcommand.Parameters.Add(new SqlParameter("@userid", sm.Session().UserID));
            dbcommand.Connection = dbconnection;
            dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection);

            while (dbreader.Read())
            {
                ORCIDPublication pub = new ORCIDPublication();
                if (dbreader["InternalUserName"] != null)
                {
                    return dbreader["InternalUserName"].ToString();
                }
            }
            throw new Exception("Unable to find Internal Username");
        }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:48,代码来源:DataIO.cs

示例4: InsertProxy

        public void InsertProxy(string userid)
        {
            SessionManagement sm = new SessionManagement();

            try
            {

                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType = CommandType.StoredProcedure;

                dbcommand.CommandText = "[User.Account].[Proxy.AddDesignatedProxy]";
                dbcommand.CommandTimeout = base.GetCommandTimeout();

                dbcommand.Parameters.Add(new SqlParameter("@SessionID", sm.Session().SessionID));
                dbcommand.Parameters.Add(new SqlParameter("@UserID", userid));
                dbcommand.Connection = dbconnection;
                dbcommand.ExecuteNonQuery();

            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:29,代码来源:DataIO.cs

示例5: DrawProfilesModule

        public void DrawProfilesModule()
        {
            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();

            if (Request.QueryString["Subject"] == null)
                return;

            base.RDFTriple = new RDFTriple(Convert.ToInt64(Request.QueryString["Subject"]));

            dlGoogleMapLinks.DataSource = data.GetGoogleMapZoomLinks();
            dlGoogleMapLinks.DataBind();

            SqlDataReader reader = null;
            SqlDataReader reader2 = null;

            Profiles.Framework.Utilities.SessionManagement session = new SessionManagement();

            GoogleMapHelper gmh = new GoogleMapHelper();

            try
            {
                if (base.GetModuleParamString("MapType") == "CoAuthor")
                {

                    reader = data.GetGMapUserCoAuthors(base.RDFTriple.Subject, 0, session.Session().SessionID);
                    reader2 = data.GetGMapUserCoAuthors(base.RDFTriple.Subject, 1, session.Session().SessionID);

                }

                if (base.GetModuleParamString("MapType") == "SimilarTo")
                {
                    reader = data.GetGMapUserSimilarPeople(base.RDFTriple.Subject, false, session.Session().SessionID);
                    reader2 = data.GetGMapUserSimilarPeople(base.RDFTriple.Subject, true, session.Session().SessionID);
                }

                litGoogleCode.Text = gmh.MapPlotPeople(base.RDFTriple.Subject, reader, reader2);
            }
            finally
            {
                if (!reader.IsClosed)
                    reader.Close();

                if (!reader2.IsClosed)
                    reader2.Close();
            }
        }
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:46,代码来源:NetworkMap.ascx.cs

示例6: EditObjectTypeProperty

        public EditObjectTypeProperty(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            Edit.Utilities.DataIO data;
            SessionManagement sm = new SessionManagement();

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

            if (Request.QueryString["subject"] != null)
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            else if (base.GetRawQueryStringItem("subject") != null)
                this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject"));
            else
                Response.Redirect("~/search");

            this.PredicateURI = Request.QueryString["predicateuri"].Replace("!", "#");

            GetSubjectProfile();

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, PredicateURI, false, true, false);
            this.PropertyLabel = PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value;
            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + this.PropertyLabel + "</b>";

            //Quick add for adding a note on the format of grant info when adding manually
            if (PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/@Label").Value == "Research")
            {
                litGrantNote1.Text = "Please use the following format when adding the grant information: ";
                litGrantNote2.Text = "Funding Agency: Agency Name - Title: Grant Title - Award Number: Grant ID Number - Total direct costs: $amount - Start Date: yyyy-mm-dd - End Date: yyyy-mm-dd <br /> Or for subaward:<br /> Subaward: Name of Pass-Through Institution - Funding Agency: Agency Name - Title: Grant Title - Award Number: Grant ID Number - Total direct costs: $amount - Start Date: yyyy-mm-dd - End Date: yyyy-mm-dd";
            }

            //Quick fix to allow only Admin and Curators to edit Visibility privacy
            securityOptions.userRole = propdata.GetUserRole(sm.Session().SessionID);
            if (securityOptions.userRole == -40 || securityOptions.userRole == -50)
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = true;
                securityOptions.FindControl("lbSecurityOptions").Visible = true;
            }
            else
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = false;
                securityOptions.FindControl("lbSecurityOptions").Visible = false;
            }

            securityOptions.Subject = this.SubjectID;
            securityOptions.PredicateURI = PredicateURI;
            this.PredicateID = data.GetStoreNode(this.PredicateURI);
            securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);

            this._subject = Convert.ToInt64(Request.QueryString["subject"]);
            this._personId = data.GetPersonID(_subject);
        }
开发者ID:shariqatariq,项目名称:ProfilesProduction,代码行数:54,代码来源:EditObjectTypeProperty.ascx.cs

示例7: EditDataTypeProperty

        public EditDataTypeProperty(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            propdata = new Profiles.Profile.Utilities.DataIO();
            data = new Profiles.Edit.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            PropertyLabel = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value;

            if (Request.QueryString["subject"] != null)
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            else if (base.GetRawQueryStringItem("subject") != null)
                this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject"));
            else
                Response.Redirect("~/search");

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            btnEditProperty.Text = "Add " + PropertyLabel;

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            // Put hack to not insert null MaxCardinality Value
            if (this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MaxCardinality") == null)
            {
                this.MaxCardinality = "1";
            }
            else
            {
                this.MaxCardinality = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MaxCardinality").Value;
            }

            this.MinCardinality = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MinCardinality").Value;

            //Quick fix to allow only Admin and Curators to edit Visibility privacy
            securityOptions.userRole = propdata.GetUserRole(sm.Session().SessionID);
            if (securityOptions.userRole == -40 || securityOptions.userRole == -50)
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = true;
                securityOptions.FindControl("lbSecurityOptions").Visible = true;
            }
            else
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = false;
                securityOptions.FindControl("lbSecurityOptions").Visible = false;
            }

            securityOptions.Subject = this.SubjectID;
            securityOptions.PredicateURI = predicateuri;
            securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
        }
开发者ID:shariqatariq,项目名称:ProfilesProduction,代码行数:53,代码来源:EditDataTypeProperty.ascx.cs

示例8: CustomEditAuthorInAuthorship

        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);

            //Quick fix to allow only Admin and Curators to edit Visibility privacy
            securityOptions.userRole = propdata.GetUserRole(sm.Session().SessionID);
            if (securityOptions.userRole == -40 || securityOptions.userRole == -50)
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = true;
                securityOptions.FindControl("lbSecurityOptions").Visible = true;
            }
            else
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = false;
                securityOptions.FindControl("lbSecurityOptions").Visible = false;
            }

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

            securityOptions.BubbleClick += SecurityDisplayed;
        }
开发者ID:shariqatariq,项目名称:ProfilesProduction,代码行数:37,代码来源:CustomEditAuthorInAuthorship.ascx.cs

示例9: CustomEditEmail

        public CustomEditEmail(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            base.BaseData = pagedata;

            data = new Profiles.Edit.Utilities.DataIO();
            this.Email = base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:email", base.Namespaces).InnerText;

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

            if (Request.QueryString["subject"] != null)
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            else if (base.GetRawQueryStringItem("subject") != null)
                this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject"));
            else
                Response.Redirect("~/search");

            this.PredicateURI = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, this.PredicateURI, false, true, false);
            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            //create a new network triple request.
            base.RDFTriple = new RDFTriple(this.SubjectID, data.GetStoreNode(this.PredicateURI));

            base.RDFTriple.Expand = true;
            base.RDFTriple.ShowDetails = true;
            base.GetDataByURI();//This will reset the data to a Network.

            //Quick fix to allow only Admin and Curators to edit Visibility privacy
            securityOptions.userRole = propdata.GetUserRole(sm.Session().SessionID);
            if (securityOptions.userRole == -40 || securityOptions.userRole == -50)
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = true;
                securityOptions.FindControl("lbSecurityOptions").Visible = true;
            }
            else
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = false;
                securityOptions.FindControl("lbSecurityOptions").Visible = false;
            }

            securityOptions.Subject = this.SubjectID;
            securityOptions.PredicateURI = this.PredicateURI;
            securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
        }
开发者ID:shariqatariq,项目名称:ProfilesProduction,代码行数:48,代码来源:CustomEditEmail.ascx.cs

示例10: CustomEditAuthorInAuthorship

        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();
            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 = data.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 XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
        }
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:20,代码来源:CustomEditAuthorInAuthorship.ascx.cs

示例11: CustomEditMainImage

        public CustomEditMainImage(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();
            SessionManagement sm = new SessionManagement();
            this.XMLData = pagedata;

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

            if (Request.QueryString["subject"] != null)
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            else if (base.GetRawQueryStringItem("subject") != null)
                this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject"));
            else
                Response.Redirect("~/search");

            this.PredicateURI = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, PredicateURI, false, true, false);
            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            //Quick fix to allow only Admin and Curators to edit Visibility privacy
            securityOptions.userRole = propdata.GetUserRole(sm.Session().SessionID);
            if (securityOptions.userRole == -40 || securityOptions.userRole == -50)
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = true;
                securityOptions.FindControl("lbSecurityOptions").Visible = true;
            }
            else
            {
                securityOptions.FindControl("imbSecurityOptions").Visible = false;
                securityOptions.FindControl("lbSecurityOptions").Visible = false;
            }

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

            securityOptions.BubbleClick += SecurityDisplayed;
        }
开发者ID:shariqatariq,项目名称:ProfilesProduction,代码行数:41,代码来源:CustomEditMainImage.ascx.cs

示例12: GetNodeId

        private Int64 GetNodeId(StoreNodeRequest snr)
        {
            System.Web.HttpBrowserCapabilities browser = HttpContext.Current.Request.Browser;

            if (snr.Value.Value.ToString().Contains(Environment.NewLine) && browser.Browser == "IE")
            {
                snr.Value.Value = snr.Value.Value.ToString().Replace(Environment.NewLine, ("\n"));

            }

            SessionManagement sm = new SessionManagement();
            string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;

            SqlConnection dbconnection = new SqlConnection(connstr);

            SqlParameter[] param = new SqlParameter[snr.Length];

            string error = string.Empty;

            dbconnection.Open();

            if (snr.Value != null)
                param[snr.Value.ParamOrdinal] = new SqlParameter("@value", snr.Value.Value);

            if (snr.Langauge != null)
                param[snr.Langauge.ParamOrdinal] = new SqlParameter("@language", null);

            if (snr.DataType != null)
                param[snr.DataType.ParamOrdinal] = new SqlParameter("@DataType", null);

            param[snr.Length - 3] = new SqlParameter("@SessionID", sm.Session().SessionID);

            param[snr.Length - 2] = new SqlParameter("@Error", null);
            param[snr.Length - 2].Size = 1;
            param[snr.Length - 2].DbType = DbType.String;
            param[snr.Length - 2].Direction = ParameterDirection.Output;
            param[snr.Length - 1] = new SqlParameter("@NodeID", null);
            param[snr.Length - 1].DbType = DbType.Int64;
            param[snr.Length - 1].Direction = ParameterDirection.Output;

            using (var cmd = GetDBCommand(dbconnection, "[RDF.].GetStoreNode", CommandType.StoredProcedure, CommandBehavior.CloseConnection, param))
            {
                try
                {
                    //For Output Parameters you need to pass a connection object to the framework so you can close it before reading the output params value.
                    ExecuteSQLDataCommand(cmd);
                }
                finally
                {
                    SqlConnection.ClearPool(dbconnection);
                    cmd.Connection.Close();
                    cmd.Dispose();
                }
            }

            return Convert.ToInt64(param[snr.Length - 1].Value.ToString());
        }
开发者ID:ProfilesRNS,项目名称:ProfilesRNS,代码行数:57,代码来源:DataIO.cs

示例13: ManageProxies

        public SqlDataReader ManageProxies(string operation)
        {
            SqlDataReader dbreader = null;
            SessionManagement sm = new SessionManagement();

            try
            {

                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType = CommandType.StoredProcedure;

                dbcommand.CommandText = "[User.Account].[Proxy.GetProxies]";
                dbcommand.CommandTimeout = base.GetCommandTimeout();

                dbcommand.Parameters.Add(new SqlParameter("@SessionID", sm.Session().SessionID));
                dbcommand.Parameters.Add(new SqlParameter("@Operation", operation));
                dbcommand.Connection = dbconnection;
                dbreader = dbcommand.ExecuteReader(CommandBehavior.CloseConnection);

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

            return dbreader;
        }
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:32,代码来源:DataIO.cs

示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if (Request.QueryString["method"].ToString() == "logout")
                {

                    sm.SessionLogout();
                    sm.SessionDistroy();
                    Response.Redirect(Request.QueryString["redirectto"].ToString());
                }
                else if (Request.QueryString["method"].ToString() == "shibboleth")
                {
                    // added by Eric
                    String employeeID = Request.Headers.Get("employeeNumber"); //"025693078";
                    // new IDP
                    if (employeeID == null || employeeID.Trim().Length == 0)
                    {
                        employeeID = Request.Headers.Get("uid"); //"025693078";
                        if (employeeID != null && employeeID.Trim().Length > 9)
                        {
                            employeeID = employeeID.Substring(0, 9);
                        }
                    }
                    if (employeeID != null && employeeID.Trim().Length > 0)
                    {
                        Profiles.Login.Utilities.DataIO data = new Profiles.Login.Utilities.DataIO();
                        Profiles.Login.Utilities.User user = new Profiles.Login.Utilities.User();

                        user.UserName = employeeID;
                        user.Password = employeeID;
                        if (data.UserLogin(ref user))
                        {
                            RedirectAuthenticatedUser();
                        }
                    }
                }
                else if (Request.QueryString["method"].ToString() == "login")
                {
                    // see if they already have a login session, if so don't send them to shibboleth
                    Profiles.Framework.Utilities.SessionManagement sm = new Profiles.Framework.Utilities.SessionManagement();
                    String viewerId = sm.Session().PersonURI;
                    if (viewerId != null && viewerId.Trim().Length > 0)
                    {
                        RedirectAuthenticatedUser();
                    }
                    else
                    {
                        string redirect = Root.Domain + "/login/default.aspx?method=shibboleth";
                        if (Request.QueryString["redirectto"] == null && Request.QueryString["edit"] == "true")
                            redirect += "&edit=true";
                        else
                            redirect += "&redirectto=" + Request.QueryString["redirectto"].ToString();

                        Response.Redirect(ConfigurationManager.AppSettings["Shibboleth.LoginURL"].ToString().Trim() +
                            HttpUtility.UrlEncode(redirect));
                    }
                }

            }
        }
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:62,代码来源:ShibLogin.ascx.cs

示例15: DrawProfilesModule

        private void DrawProfilesModule()
        {
            Proxy.Utilities.DataIO data = new Proxy.Utilities.DataIO();
            SessionManagement sm = new SessionManagement();
            string subject = sm.Session().SessionID.ToString();

            if (sm.Session().UserID == 0)
                Response.Redirect(Root.Domain + "/search");

            litBackLink.Text = "<b>Search Proxies</b>";

            if (Request.QueryString["fname"] != null)
            {
                txtFirstName.Text = Request.QueryString["fname"];
                this.Fname = Request.QueryString["fname"];
            }

            if (Request.QueryString["lname"] != null)
            {
                txtLastName.Text = Request.QueryString["lname"];
                this.Lname = Request.QueryString["lname"];
            }

            drpInstitution.DataSource = data.GetInstitutions();
            drpInstitution.DataTextField = "Text";
            drpInstitution.DataValueField = "Value";
            drpInstitution.DataBind();
            drpInstitution.Items.Insert(0, new ListItem("--Select--"));

            if (Request.QueryString["institution"] != null)
            {
                drpInstitution.SelectedIndex = drpInstitution.Items.IndexOf(drpInstitution.Items.FindByText(Request.QueryString["institution"]));
                this.Institution = Request.QueryString["institution"];
            }

            drpDepartment.DataSource = data.GetDepartments();
            drpDepartment.DataTextField = "Text";
            drpDepartment.DataValueField = "Value";
            drpDepartment.DataBind();
            drpDepartment.Items.Insert(0, new ListItem("--Select--"));

            if (Request.QueryString["department"] != null)
            {
                drpDepartment.SelectedIndex = drpDepartment.Items.IndexOf(drpDepartment.Items.FindByText(Request.QueryString["department"]));
                this.Department = Request.QueryString["department"];
            }

            drpInstitutionPermissions.DataSource = data.GetInstitutions();
            drpInstitutionPermissions.DataTextField = "Text";
            drpInstitutionPermissions.DataValueField = "Value";
            drpInstitutionPermissions.DataBind();
            drpInstitutionPermissions.Items.Insert(0, new ListItem("All"));

            drpDepartmentPermissions.DataSource = data.GetDepartments();
            drpDepartmentPermissions.DataTextField = "Text";
            drpDepartmentPermissions.DataValueField = "Value";
            drpDepartmentPermissions.DataBind();
            drpDepartmentPermissions.Items.Insert(0, new ListItem("All"));

            this.Subject = Convert.ToInt64(Request.QueryString["subject"]);

            if (Request.QueryString["offset"] != null && Request.QueryString["totalrows"] != null)
            {
                this.ExecuteSearch(false);
            }
        }
开发者ID:shariqatariq,项目名称:profiles-rns,代码行数:66,代码来源:SearchSuperProxies.ascx.cs


注:本文中的Profiles.Framework.Utilities.SessionManagement.Session方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。