Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Configuration config = new Configuration();

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

            if (!correctSession)
            {
                clearSession();
            }
            if (!IsPostBack)
            {
                if (Request.UrlReferrer != null)
                {
                    previousPage = Request.UrlReferrer.ToString();
                }
                else
                {
                    previousPage = "Home.aspx";
                }
            }
        }
Example #2
0
        protected void initialAccess()
        {
            Configuration config = new Configuration();

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

            if (HttpContext.Current.Request.Url.AbsoluteUri != null)
            {
                currentPage = HttpContext.Current.Request.Url.AbsoluteUri;
            }
            if (Request.UrlReferrer != null)
            {
                previousPage = Request.UrlReferrer.ToString();
            }
            //Get current time:
            DateTime currentTime = DateTime.Now;
            //Get user's IP:
            string userIP = GetIPAddress();

            Accounts.Physician.CheckPhysicianSession session = new Accounts.Physician.CheckPhysicianSession();
            bool correctSession = session.sessionIsCorrect(username, roleId, token, currentPage, previousPage, currentTime, userIP);

            if (!correctSession)
            {
                clearSession();
            }
            lblAlerts.Text = "Alerts (" + countTotalAlerts() + ")";
            lblName.Text   = getName();
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Configuration config = new Configuration();

            conn    = config.getConnectionString();
            connect = new SqlConnection(conn);
            getSession();
            //addSession();
            //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();
            CheckPhysicianSession session = new CheckPhysicianSession();
            bool correctSession           = session.sessionIsCorrect(username, roleId, token, current_page, previous_page, currentTime, userIP);

            if (!correctSession)
            {
                clearSession();
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Configuration config = new Configuration();

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

            if (!correctSession)
            {
                clearSession();
            }
        }
Example #5
0
        protected void initialPageAccess()
        {
            Configuration config = new Configuration();

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

            if (!correctSession)
            {
                clearSession();
            }
        }
        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();
            CheckPhysicianSession session = new CheckPhysicianSession();
            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;
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!requestedRemoveTopic && !requestedRemoveMessage)
                {
                    if (HttpContext.Current.Request.Url.AbsoluteUri != null)
                    {
                        currentPage = HttpContext.Current.Request.Url.AbsoluteUri;
                    }
                    else
                    {
                        currentPage = "Home.aspx";
                    }
                    if (Request.UrlReferrer != null)
                    {
                        previousPage = Request.UrlReferrer.ToString();
                    }
                    else
                    {
                        previousPage = "Home.aspx";
                    }
                    if (currentPage.Equals(previousPage))
                    {
                        previousPage = "Home.aspx";
                    }
                }
            }
            Configuration config = new Configuration();

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

            if (!correctSession)
            {
                clearSession();
            }
            topicId = Request.QueryString["id"];
            CheckErrors check = new CheckErrors();

            if (!check.isDigit(topicId))
            {
                goBack();
            }
            int  pageNum       = Convert.ToInt32(Request.QueryString["page"]);
            bool topicApproved = isTopicApproved();

            if (!topicApproved)
            {
                topicNotApproved();
            }
            bool authorized = isUserAuthorizedToView();

            if (!authorized)
            {
                unauthorized();
            }
            showInformation(pageNum);
            checkIfTerminated();
            checkIfDeleted();
        }