protected void Page_Load(object sender, EventArgs e)
    {
        string passwordResetSessionValue = "";
        string usernameValue = "";

        try
        {
            HttpCookie passwordResetSessionCookie = new HttpCookie("passwordResetSession");
            passwordResetSessionCookie = Request.Cookies["passwordResetSession"];
            passwordResetSessionValue = passwordResetSessionCookie.Value.ToString();
        }
        catch (Exception)
        {
            passwordResetSessionValue = "cookie exception";
        }

        if (passwordResetSessionValue != "" && passwordResetSessionValue != "cookie exception")
        {
            Response.Cookies["passwordResetSession"].Expires = DateTime.Now.AddMinutes(-2);
        }

        try
        {
            HttpCookie myCookie = new HttpCookie("userSession");
            myCookie = Request.Cookies["userSession"];
            usernameValue = myCookie.Value.ToString();
        }
        catch (Exception)
        {
            usernameValue = "cookie exception";
        }

        if (usernameValue != "" && usernameValue != "cookie exception")
        {
            Controllers.RequestPersonalInformation importRequestPersonalInformation = new Controllers.RequestPersonalInformation();
            Controllers.RequestTransactionMonitor importRequestTransactionMonitor = new Controllers.RequestTransactionMonitor();

            this.webPageBodyLoggedIn.Visible = true;
            this.webPageBodyNotLoggedIn.Visible = false;
            this.welcomeMessage.Text = importRequestPersonalInformation.requestWelcomeMessage(usernameValue);
            this.transactionSummary.Text = importRequestTransactionMonitor.requestMyTransactionSummary(usernameValue);

            if (importRequestPersonalInformation.requestWelcomeMessage(usernameValue) == "<label>Hi, username not found!</label>\n")
            {
                Response.Cookies["userSession"].Expires = DateTime.Now.AddDays(-14);

                Response.Redirect("http://www.timothysdigitalsolutions.somee.com/");
            }
        }
        else
        {
            this.webPageBodyLoggedIn.Visible = false;
            this.webPageBodyNotLoggedIn.Visible = true;
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string passwordResetSessionValue = "";
        string usernameValue = "";
        string randomBackgroundImageValue = "";

        try
        {
            HttpCookie passwordResetSessionCookie = new HttpCookie("passwordResetSession");
            passwordResetSessionCookie = Request.Cookies["passwordResetSession"];
            passwordResetSessionValue = passwordResetSessionCookie.Value.ToString();
        }
        catch (Exception)
        {
            passwordResetSessionValue = "cookie exception";
        }

        if (passwordResetSessionValue != "" && passwordResetSessionValue != "cookie exception")
        {
            Response.Cookies["passwordResetSession"].Expires = DateTime.Now.AddMinutes(-2);
        }

        try
        {
            HttpCookie myCookie = new HttpCookie("userSession");
            myCookie = Request.Cookies["userSession"];
            usernameValue = myCookie.Value.ToString();
        }
        catch (Exception)
        {
            usernameValue = "cookie exception";
        }

        try
        {
            HttpCookie randomBackgroundImageCookie = new HttpCookie("randomBackgroundImage");
            randomBackgroundImageCookie = Request.Cookies["randomBackgroundImage"];
            randomBackgroundImageValue = randomBackgroundImageCookie.Value.ToString();
        }
        catch (Exception)
        {
            randomBackgroundImageValue = "cookie exception";
        }

        if (randomBackgroundImageValue == "" || randomBackgroundImageValue == "cookie exception")
        {
            Controllers.RequestCalorieCounter importRequestCalorieCounter = new Controllers.RequestCalorieCounter();

            Response.Cookies["randomBackgroundImage"].Value = importRequestCalorieCounter.createSiteBackgroundCookie();
            Response.Cookies["randomBackgroundImage"].Expires = DateTime.Now.AddDays(1);

            this.siteBackground.Text = importRequestCalorieCounter.requestSiteBackground(randomBackgroundImageValue);
        }
        else
        {
            Controllers.RequestCalorieCounter importRequestCalorieCounter = new Controllers.RequestCalorieCounter();

            this.siteBackground.Text = importRequestCalorieCounter.requestSiteBackground(randomBackgroundImageValue);
        }

        if (usernameValue != "" && usernameValue != "cookie exception")
        {
            Controllers.RequestPersonalInformation importRequestPersonalInformation = new Controllers.RequestPersonalInformation();
            Controllers.RequestCalorieCounter importRequestCalorieCounter = new Controllers.RequestCalorieCounter();

            string action = Request.QueryString["action"];

            if (action == "add food item")
            {
                this.addFoodItemSection.Visible = true;
                this.addExerciseActivitySection.Visible = false;
                this.instructionsSection.Visible = false;

                this.calorieCounterForm.Action = HttpContext.Current.Request.Url.AbsoluteUri;
            }
            else if (action == "add exercise activity")
            {
                this.addFoodItemSection.Visible = false;
                this.addExerciseActivitySection.Visible = true;
                this.instructionsSection.Visible = false;

                this.calorieCounterForm.Action = HttpContext.Current.Request.Url.AbsoluteUri;
            }
            else
            {
                this.addFoodItemSection.Visible = false;
                this.addExerciseActivitySection.Visible = false;
                this.instructionsSection.Visible = true;

                this.calorieCounterForm.Action = "http://www.timothysdigitalsolutions.somee.com/calorie-counter/";
            }

            this.webPageBodyLoggedIn.Visible = true;
            this.webPageBodyNotLoggedIn.Visible = false;
            this.welcomeMessage.Text = importRequestPersonalInformation.requestWelcomeMessage(usernameValue);
            this.calorieCounterSummary.Text = importRequestCalorieCounter.requestCalorieCounterSummary(usernameValue);

            if (importRequestPersonalInformation.requestWelcomeMessage(usernameValue) == "<label>Hi, username not found!</label>\n")
            {
                Response.Cookies["userSession"].Expires = DateTime.Now.AddDays(-14);

                Response.Redirect("http://www.timothysdigitalsolutions.somee.com/");
            }
        }
        else
        {
            this.webPageBodyLoggedIn.Visible = false;
            this.webPageBodyNotLoggedIn.Visible = true;
        }
    }
Example #3
0
    protected void saveFoodOrDrinkItem_Click(object sender, EventArgs e)
    {
        string passwordResetSessionValue = "";
        string usernameValue = "";

        try
        {
            HttpCookie passwordResetSessionCookie = new HttpCookie("passwordResetSession");
            passwordResetSessionCookie = Request.Cookies["passwordResetSession"];
            passwordResetSessionValue = passwordResetSessionCookie.Value.ToString();
        }
        catch (Exception)
        {
            passwordResetSessionValue = "cookie exception";
        }

        if (passwordResetSessionValue != "" && passwordResetSessionValue != "cookie exception")
        {
            Response.Cookies["passwordResetSession"].Expires = DateTime.Now.AddMinutes(-2);
        }

        try
        {
            HttpCookie myCookie = new HttpCookie("userSession");
            myCookie = Request.Cookies["userSession"];
            usernameValue = myCookie.Value.ToString();
        }
        catch (Exception)
        {
            usernameValue = "cookie exception";
        }

        if (usernameValue != "" && usernameValue != "cookie exception")
        {
            Controllers.RequestPersonalInformation importRequestPersonalInformation = new Controllers.RequestPersonalInformation();
            Controllers.RequestCalorieCounter importRequestCalorieCounter = new Controllers.RequestCalorieCounter();

            string foodOrBeverageItem = this.foodOrBeverageItem.Text;
            string numberOfCaloriesPerServing = this.numberOfCaloriesPerServing.Text;
            string numberOfServings = this.numberOfServings.Text;

            this.webPageBodyLoggedIn.Visible = true;
            this.webPageBodyNotLoggedIn.Visible = false;
            this.welcomeMessage.Text = importRequestPersonalInformation.requestWelcomeMessage(usernameValue);
            this.addFoodItemMessage.Text = importRequestCalorieCounter.requestAddFoodItem(foodOrBeverageItem, numberOfCaloriesPerServing, numberOfServings, usernameValue);
            this.calorieCounterSummary.Text = importRequestCalorieCounter.requestCalorieCounterSummary(usernameValue);

            if (importRequestPersonalInformation.requestWelcomeMessage(usernameValue) == "<label>Hi, username not found!</label>\n")
            {
                Response.Cookies["userSession"].Expires = DateTime.Now.AddDays(-14);

                Response.Redirect("http://www.timothysdigitalsolutions.somee.com/");
            }
        }
    }
Example #4
0
    protected void saveActivity_Click(object sender, EventArgs e)
    {
        string passwordResetSessionValue = "";
        string usernameValue = "";

        try
        {
            HttpCookie passwordResetSessionCookie = new HttpCookie("passwordResetSession");
            passwordResetSessionCookie = Request.Cookies["passwordResetSession"];
            passwordResetSessionValue = passwordResetSessionCookie.Value.ToString();
        }
        catch (Exception)
        {
            passwordResetSessionValue = "cookie exception";
        }

        if (passwordResetSessionValue != "" && passwordResetSessionValue != "cookie exception")
        {
            Response.Cookies["passwordResetSession"].Expires = DateTime.Now.AddMinutes(-2);
        }

        try
        {
            HttpCookie myCookie = new HttpCookie("userSession");
            myCookie = Request.Cookies["userSession"];
            usernameValue = myCookie.Value.ToString();
        }
        catch (Exception)
        {
            usernameValue = "cookie exception";
        }

        if (usernameValue != "" && usernameValue != "cookie exception")
        {
            Controllers.RequestPersonalInformation importRequestPersonalInformation = new Controllers.RequestPersonalInformation();
            Controllers.RequestStopWatch importRequestStopWatch = new Controllers.RequestStopWatch();

            string activityName = this.activityName.Text;
            string activityDescription = this.activityDescription.Text;

            this.webPageBodyLoggedIn.Visible = true;
            this.webPageBodyNotLoggedIn.Visible = false;
            this.welcomeMessage.Text = importRequestPersonalInformation.requestWelcomeMessage(usernameValue);
            this.saveActivityMessage.Text = importRequestStopWatch.requestSaveActivity(activityName, activityDescription, usernameValue);
            this.undoActivityMessage.Text = importRequestStopWatch.requestUndoActivity(usernameValue);

            if (importRequestStopWatch.requestSearchNumberOfRecords(usernameValue, "completely saved") > 0)
            {
                this.totalTimeConsumed.Visible = true;
                this.totalTimeConsumed.Text = importRequestStopWatch.requestTotalTimeConsumed(usernameValue);
            }
            else
            {
                this.totalTimeConsumed.Visible = false;
            }

            if (importRequestPersonalInformation.requestWelcomeMessage(usernameValue) == "<label>Hi, username not found!</label>\n")
            {
                Response.Cookies["userSession"].Expires = DateTime.Now.AddDays(-14);

                Response.Redirect("http://www.timothysdigitalsolutions.somee.com/");
            }
        }
    }
Example #5
0
    protected void saveNote_Click(object sender, EventArgs e)
    {
        string passwordResetSessionValue = "";
        string usernameValue = "";

        try
        {
            HttpCookie passwordResetSessionCookie = new HttpCookie("passwordResetSession");
            passwordResetSessionCookie = Request.Cookies["passwordResetSession"];
            passwordResetSessionValue = passwordResetSessionCookie.Value.ToString();
        }
        catch (Exception)
        {
            passwordResetSessionValue = "cookie exception";
        }

        if (passwordResetSessionValue != "" && passwordResetSessionValue != "cookie exception")
        {
            Response.Cookies["passwordResetSession"].Expires = DateTime.Now.AddMinutes(-2);
        }

        try
        {
            HttpCookie myCookie = new HttpCookie("userSession");
            myCookie = Request.Cookies["userSession"];
            usernameValue = myCookie.Value.ToString();
        }
        catch (Exception)
        {
            usernameValue = "cookie exception";
        }

        if (usernameValue != "" && usernameValue != "cookie exception")
        {
            Controllers.RequestPersonalInformation importRequestPersonalInformation = new Controllers.RequestPersonalInformation();
            Controllers.RequestNoteTaker importRequestNoteTaker = new Controllers.RequestNoteTaker();

            string subject = this.subject.Text;
            string yourNote = this.yourNote.Text;

            this.webPageBodyLoggedIn.Visible = true;
            this.webPageBodyNotLoggedIn.Visible = false;
            this.welcomeMessage.Text = importRequestPersonalInformation.requestWelcomeMessage(usernameValue);
            this.saveNoteMessage.Text = importRequestNoteTaker.requestAddNote(subject, yourNote, usernameValue);

            if (importRequestNoteTaker.requestSearchNumberOfRecords(usernameValue) < 1)
            {
                this.searchSection.Visible = false;
            }
            else
            {
                this.searchSection.Visible = true;
            }

            if (importRequestPersonalInformation.requestWelcomeMessage(usernameValue) == "<label>Hi, username not found!</label>\n")
            {
                Response.Cookies["userSession"].Expires = DateTime.Now.AddDays(-14);

                Response.Redirect("http://www.timothysdigitalsolutions.somee.com/");
            }
        }
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string passwordResetSessionValue = "";
        string usernameValue = "";

        try
        {
            HttpCookie passwordResetSessionCookie = new HttpCookie("passwordResetSession");
            passwordResetSessionCookie = Request.Cookies["passwordResetSession"];
            passwordResetSessionValue = passwordResetSessionCookie.Value.ToString();
        }
        catch (Exception)
        {
            passwordResetSessionValue = "cookie exception";
        }

        if (passwordResetSessionValue != "" && passwordResetSessionValue != "cookie exception")
        {
            Response.Cookies["passwordResetSession"].Expires = DateTime.Now.AddMinutes(-2);
        }

        try
        {
            HttpCookie myCookie = new HttpCookie("userSession");
            myCookie = Request.Cookies["userSession"];
            usernameValue = myCookie.Value.ToString();
        }
        catch (Exception)
        {
            usernameValue = "cookie exception";
        }

        if (usernameValue != "" && usernameValue != "cookie exception")
        {
            Controllers.RequestPersonalInformation importRequestPersonalInformation = new Controllers.RequestPersonalInformation();
            Controllers.RequestNoteTaker importRequestNoteTaker = new Controllers.RequestNoteTaker();

            string requestId = Request.QueryString["id"];
            int numberReturned = 0;

            this.webPageBodyLoggedIn.Visible = true;
            this.webPageBodyNotLoggedIn.Visible = false;
            this.welcomeMessage.Text = importRequestPersonalInformation.requestWelcomeMessage(usernameValue);

            if (!(String.IsNullOrWhiteSpace(requestId)))
            {
                numberReturned = importRequestNoteTaker.requestSearchNumberOfRecords(usernameValue, requestId);
            }

            if (importRequestNoteTaker.requestSearchNumberOfRecords(usernameValue) < 1)
            {
                this.searchSection.Visible = false;
            }
            else
            {
                if (numberReturned != 1)
                {
                    this.searchSection.Visible = true;
                }
                else
                {
                    this.searchSection.Visible = false;
                }
            }

            if (numberReturned != 1)
            {
                this.addNotesSection.Visible = true;
                this.yourNoteFocus.Visible = false;

                this.noteTakerForm.Action = "http://www.timothysdigitalsolutions.somee.com/note-taker/";
            }
            else
            {
                this.addNotesSection.Visible = false;
                this.yourNoteFocus.Visible = true;

                this.noteTakerForm.Action = HttpContext.Current.Request.Url.AbsoluteUri;
            }

            if (importRequestPersonalInformation.requestWelcomeMessage(usernameValue) == "<label>Hi, username not found!</label>\n")
            {
                Response.Cookies["userSession"].Expires = DateTime.Now.AddDays(-14);

                Response.Redirect("http://www.timothysdigitalsolutions.somee.com/");
            }
        }
        else
        {
            this.webPageBodyLoggedIn.Visible = false;
            this.webPageBodyNotLoggedIn.Visible = true;
        }
    }