Esempio n. 1
0
        /// <summary>
        ///  CREATED BY HAYDEN BASED ON REGISTER PAGE
        ///  SEE REGISTER PAGE FOR MORE DETAILS
        /// </summary>
        protected void submitButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                UserModel newUser = new UserModel();

                newUser.Email           = inADEmail.Value;
                newUser.Password        = inADPassword.Value;
                newUser.FirstName       = inADFirstName.Value;
                newUser.LastName        = inADLastName.Value;
                newUser.AdminPermission = 0;

                BusinessLayer.UserBL.ProcessAddNewUser(newUser);


                // placeholder for future feature
                string phone = "nope";


                NotifyBL.startAccountNotification(inADEmail.Value, phone, inADFirstName.Value, inADLastName.Value);


                Response.Redirect("AdminHome.aspx");
            }
            else
            {
                Response.Redirect("AdminError.aspx");
            }
        }
Esempio n. 2
0
        protected void submitButton_Click(object sender, EventArgs e)
        {
            //Uses ASP.NET function IsValid() to test user input and the current error state before proceeding
            if (Page.IsValid)
            {
                UserModel newUser = new UserModel();

                //Sets relevant values from user input
                newUser.Email           = inADEmail.Value;
                newUser.Password        = inADPassword.Value;
                newUser.FirstName       = inADFirstName.Value;
                newUser.LastName        = inADLastName.Value;
                newUser.AdminPermission = 0;

                //Adds a new building to the database
                UserBL.ProcessAddNewUser(newUser);

                //Placeholder data for later project exensibility
                string phone = "tempPhoneNumber";
                NotifyBL.startAccountNotification(inADEmail.Value, phone, inADFirstName.Value, inADLastName.Value);

                //Redirects the user to the administrator home panel after processing is completed
                Response.Redirect("AdminHome.aspx");
            }
            else
            {
                //Redirects the user to the administrator home panel after processing is completed
                Response.Redirect("AdminError.aspx");
            }
        }
Esempio n. 3
0
        protected void Initiate(string fEmail)
        {
            if (Page.IsValid)
            {
                UserModel newUser = new UserModel();

                newUser.Email           = fEmail;
                newUser.Password        = inPassword.Value;
                newUser.FirstName       = inFirstName.Value;
                newUser.LastName        = inLastName.Value;
                newUser.AdminPermission = 0;

                BusinessLayer.UserBL.ProcessAddNewUser(newUser);


                // placeholder for future feature
                string phone = "nope";


                NotifyBL.startAccountNotification(fEmail, phone, inFirstName.Value, inLastName.Value);


                Response.Redirect("Home.aspx");
            }
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            string email = inEmail.Value;
            string phone = phonenum.Value;
            string fName = "testfirstname";
            string sName = "testsurname";

            NotifyBL.startAccountNotification(email, phone, fName, sName);
        }
        // Testing Method
        // please avoid testing this method due to it using twilio credit, all methods  have already been tested and are working
        protected void Tester_Click(object sender, EventArgs e)
        {
            // if its here the methods need it for a input
            string email    = "*****@*****.**";
            string phone    = "0434346773";
            string fName    = "Hayden";
            string sName    = "Bartlett";
            string tableID  = "6604";
            string roomName = "testing room";

            NotifyBL.startAccountNotification(email, phone, fName, sName);
            NotifyBL.startbookNotify(email, phone, fName, sName, tableID, roomName);
        }
Esempio n. 6
0
        /// <summary>
        /// Registers the user
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void registerButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                UserModel newUser = new UserModel();

                //Sets relevant values from input data
                newUser.Email           = lblEmail.Text;
                newUser.Password        = inConfirmPassword.Value;
                newUser.FirstName       = inFirstName.Value;
                newUser.LastName        = inLastName.Value;
                newUser.AdminPermission = 0;
                newUser.phoneNum        = inPhone.Value;

                UserBL.ProcessAddNewUser(newUser); //Adds new user
                NotifyBL.startAccountNotification(newUser.Email, inPhone.Value, inFirstName.Value, inLastName.Value);
                Response.Redirect("Home.aspx");    //Redirects the user back home
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Starts registration process
        /// </summary>
        /// <param name="fEmail"></param>
        protected void Initiate(string fEmail)
        {
            if (Page.IsValid)
            {
                UserModel newUser = new UserModel();

                //Stores details as supplied by user
                newUser.Email           = fEmail.ToLower();
                newUser.Password        = inPassword.Value;
                newUser.FirstName       = inFirstName.Value;
                newUser.LastName        = inLastName.Value;
                newUser.AdminPermission = 0;
                newUser.phoneNum        = inPhone.Value;

                //Adds new user to database
                UserBL.ProcessAddNewUser(newUser);

                NotifyBL.startAccountNotification(fEmail, inPhone.Value, inFirstName.Value, inLastName.Value);

                Response.Redirect("Home.aspx");
            }
        }