예제 #1
0
        protected void initialPageAccess()
        {
            Configuration config = new Configuration();

            conn    = config.getConnectionString();
            connect = new SqlConnection(conn);
            getSession();
            CheckPatientSession session = new CheckPatientSession();
            bool correctSession         = session.sessionIsCorrect(username, roleId, token);

            if (!correctSession)
            {
                clearSession();
            }

            if (session.countTotalAlerts() == 0)
            {
                lblError.Visible = true;
                lblError.Text    = "There are no new alerts!";
            }
            else
            {
                lblError.Visible = false;
            }
        }
예제 #2
0
        protected void initialPageAccess()
        {
            Configuration config = new Configuration();

            conn    = config.getConnectionString();
            connect = new SqlConnection(conn);
            getSession();
            //Get from and to pages:
            string current_page = "", previous_page = "";

            if (HttpContext.Current.Request.Url.AbsoluteUri != null)
            {
                current_page = HttpContext.Current.Request.Url.AbsoluteUri;
            }
            if (Request.UrlReferrer != null)
            {
                previous_page = Request.UrlReferrer.ToString();
            }
            //Get current time:
            DateTime currentTime = DateTime.Now;
            //Get user's IP:
            string userIP = GetIPAddress();
            CheckPatientSession session = new CheckPatientSession();
            bool correctSession         = session.sessionIsCorrect(username, roleId, token, current_page, previous_page, currentTime, userIP);

            if (!correctSession)
            {
                clearSession();
            }

            if (session.countTotalAlerts() == 0)
            {
                lblError.Visible = true;
                lblError.Text    = "There are no new alerts!";
            }
            else
            {
                lblError.Visible = false;
            }
        }