Exemplo 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");
            }
        }
Exemplo 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");
            }
        }
Exemplo 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);
        }
Exemplo n.º 5
0
 protected void notifyGroup(string email, int tableID, DateTime date, string sHour)
 {
     //The details that are send to the group members
     NotifyBL.startNotifyGroupMember(UserBL.passUserSearch(Session["login"].ToString()).FirstName.ToString(),
                                     email,
                                     TableBL.GetTableByID(tableID).TableID.ToString(),
                                     RoomBL.getRoomByID(TableBL.GetTableByID(tableID).RoomID).RoomName.ToString(),
                                     BuildingBL.getBuildingByID(RoomBL.getRoomByID(TableBL.GetTableByID(tableID).RoomID).BuildingID).BuildingName.ToString(),
                                     date.ToString("dd-MM-yyyy"),
                                     sHour + "00");
 }
        // 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);
        }
Exemplo n.º 7
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
            }
        }
Exemplo n.º 8
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");
            }
        }
Exemplo n.º 9
0
        public static void startEmailWorker()
        {
            // main Email worker, searches for any bookings in the next hour
            // via the booking table, searches user, room and building tables for associated data
            // loops through each booking sending email notifications via NotifyBL



            List <BookingModel> groups = new List <BookingModel>();


            groups = BookingDAL.loadBookingListattime();


            // loops through each booking returned by BookingDAL.loadBookingListattime();
            foreach (BookingModel booking in groups)
            {
                List <string> dataset1 = new List <string>();

                string URL = "https://www.etabletap.com/UL/BookingReceipt.aspx?id=" + booking.bookingID;

                UserModel     user     = new UserModel();
                TableModel    table    = new TableModel();
                RoomModel     room     = new RoomModel();
                BuildingModel building = new BuildingModel();


                table = TableBL.GetTableByID(booking.tableID);

                user = UserBL.passUserSearch(booking.emailAddress);

                room = RoomBL.getRoomByID(table.RoomID);

                building = BuildingBL.getBuildingByID(room.BuildingID);


                // main user
                NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, user.Email, table.TableID.ToString(),
                                            room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL);

                //booking member 1
                try
                {
                    NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail1, table.TableID.ToString(),
                                                room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL);
                }
                catch
                {
                }

                // booking member 2
                try
                {
                    NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail2, table.TableID.ToString(),
                                                room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL);
                }
                catch
                {
                }

                // groupmember 3
                try
                {
                    NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail3, table.TableID.ToString(),
                                                room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL);
                }
                catch
                {
                }

                // booking member 4
                try
                {
                    NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail4, table.TableID.ToString(),
                                                room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL);
                }
                catch
                {
                }

                // groupmember 5
                try
                {
                    NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail5, table.TableID.ToString(),
                                                room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL);
                }
                catch
                {
                }
            }
        }