Exemple #1
0
        /*Confirmation page to render if a confirmation that the customer has registered to Travel Experts
         * Lead Programmer: Mo Sagnia
         * Date: 11th February 2018
         */
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlControl loginIcon  = (HtmlControl)Page.FindControl("mainBtnLogin");
            HtmlControl loggedIcon = (HtmlControl)Page.FindControl("custLogged");

            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            if (Session["custEmail"] != null)
            {
                loggedIcon.Visible = true;
                loginIcon.Visible  = false;

                try
                {
                    customerLogged.Text = "Welcome " + CustomersDB.confirmLogin(Session["custEmail"].ToString());
                }
                catch (Exception)
                {
                    Control loginFail = FindControl("LoginFailure");
                    loginFail.Visible = true;
                    string script = @"document.getElementById('" + LoginFailure.ClientID + "').innerHTML='An error occured while attempting to process your information. Please contact travel experts.' ;setTimeout(function(){document.getElementById('" + LoginFailure.ClientID + "').style.display='none';},5000);";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "somekey", script, true);
                }
            }
            else
            {
                loggedIcon.Visible = false;
                loginIcon.Visible  = true;
            }
        }
        /*Confirmation page to render if a confirmation that the customer has registered to Travel Experts
         * Lead Programmer: Mo Sagnia
         * Date: 11th February 2018
         */
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlControl loginIcon  = (HtmlControl)Page.FindControl("mainBtnLogin");
            HtmlControl loggedIcon = (HtmlControl)Page.FindControl("custLogged");

            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            if (Session["custEmail"] != null)
            {
                loggedIcon.Visible = true;
                loginIcon.Visible  = false;

                try
                {
                    customerLogged.Text = "Welcome " + CustomersDB.confirmLogin(Session["custEmail"].ToString());
                }
                catch (Exception)
                {
                    Control loginFail = FindControl("LoginFailure");
                    loginFail.Visible = true;
                    string script = @"document.getElementById('" + LoginFailure.ClientID + "').innerHTML='An error occured while attempting to process your information. Please contact travel experts.' ;setTimeout(function(){document.getElementById('" + LoginFailure.ClientID + "').style.display='none';},5000);";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "somekey", script, true);
                }
            }
            else
            {
                loggedIcon.Visible = false;
                loginIcon.Visible  = true;
            }

            string defaultEmail_Assigned = Application["defaultEmail"].ToString();

            defaultEmail.Text = "Congratulations! You successfully registered to Travel Experts. Please make note of the following email address that has been assigned to you: " + defaultEmail_Assigned + ". Use that email address to login to your account.";
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlControl loginIcon  = (HtmlControl)Page.FindControl("mainBtnLogin");
            HtmlControl loggedIcon = (HtmlControl)Page.FindControl("custLogged");

            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            if (Session["custEmail"] != null)
            {
                loggedIcon.Visible = true;
                loginIcon.Visible  = false;

                try
                {
                    customerLogged.Text = "Welcome " + CustomersDB.confirmLogin(Session["custEmail"].ToString());
                }
                catch (Exception)
                {
                    ExceptionScript();
                }
            }
            else
            {
                loggedIcon.Visible = false;
                loginIcon.Visible  = true;
            }

            if (!this.IsPostBack)
            {
                string activationCode = !string.IsNullOrEmpty(Request.QueryString["ActivationCode"]) ? Request.QueryString["ActivationCode"] : Guid.Empty.ToString();

                string custEmail = CustomersDB.GetEmailbyActivationCode(activationCode);

                try
                {
                    int count = CustomersDB.deleteConfirmation(activationCode);
                    if (count == 1)
                    {
                        activationConfirmation.Text = "Activation successful.";
                        activationMessage.Text      = "You have successfully activated your account. You can now login and book your next vacation!";

                        try
                        {
                            CustomersDB.updateActivationStatus(custEmail);
                        }
                        catch (Exception)
                        {
                            ExceptionScript();
                        }
                    }
                    else
                    {
                        activationConfirmation.Text = "Activation unsuccessful. Please contact an agent at Travel Experts.";
                    }
                }
                catch (Exception)
                {
                    ExceptionScript();
                }
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlControl loginIcon  = (HtmlControl)Page.FindControl("mainBtnLogin");
            HtmlControl loggedIcon = (HtmlControl)Page.FindControl("custLogged");

            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            if (Session["custEmail"] != null)
            {
                loggedIcon.Visible = true;
                loginIcon.Visible  = false;

                try
                {
                    customerLogged.Text = "Welcome " + CustomersDB.confirmLogin(Session["custEmail"].ToString());
                }
                catch (Exception)
                {
                    ExceptionScript();
                }
            }
            else
            {
                loggedIcon.Visible = false;
                loginIcon.Visible  = true;
            }

            if (!IsPostBack)
            {
                try
                {
                    Customers loggedCustomer = CustomersDB.GetCustomerbyEmail(Session["custEmail"].ToString());
                    txtCustFirstName.Text    = loggedCustomer.CustFirstName;
                    txtCustLastName.Text     = loggedCustomer.CustLastName;
                    txtCustAddress.Text      = loggedCustomer.CustAddress;
                    txtCustCity.Text         = loggedCustomer.CustCity;
                    ddlCustProv.Text         = loggedCustomer.CustProv;
                    txtCustPostal.Text       = loggedCustomer.CustPostal;
                    txtCustHomePhone.Text    = loggedCustomer.CustHomePhone;
                    txtCustBusPhone.Text     = loggedCustomer.CustBusPhone;
                    txtUnconfirmedEmail.Text = loggedCustomer.CustEmail;
                    txtCustEmail.Text        = loggedCustomer.CustEmail;
                    customerLogged.Text      = "Welcome " + txtCustFirstName.Text;
                }
                catch
                {
                    ExceptionScript();
                }
            }
        }