Beispiel #1
0
        public DMSoapLocal.User addUserMN(string MN)
        {
            DMSoapLocal.User newUser = new DMSoapLocal.User();
            newUser.mobileNumber = MN;

            return(newUser);
        }
Beispiel #2
0
 //Function for adding new users
 public DMSoapLocal.User addUser(string FN, string LN, string mobileNum, long SSN, int PIN)
 {
     DMSoapLocal.User newUser = new DMSoapLocal.User();
     newUser.firstName    = FN;
     newUser.lastName     = LN;
     newUser.mobileNumber = mobileNum;
     newUser.SSN          = SSN;
     newUser.PIN          = PIN;
     return(newUser);
 }
Beispiel #3
0
 private void logoutButton_Click(object sender, EventArgs e)
 {
     currentUser = new DMSoapLocal.User();
     registerFirstName.Clear();
     registerLastName.Clear();
     registerMobileNum.Clear();
     registerSocialSecurityNumber.Clear();
     registerPIN.Clear();
     loginMobileNumber.Clear();
     MessageBox.Show("You have been logged out");
 }
Beispiel #4
0
 //Check Loyalty Button:
 private void checkLoyaltyValue_Click(object sender, EventArgs e)
 {
     if (currentUser.ID == 0)
     {
         MessageBox.Show("You must register/login first!\nPlease try again!");
     }
     else
     {
         currentUser = service.getLoyaltyBalance(currentUser);
         MessageBox.Show("You have " + currentUser.loyaltyVal + " points!", "Sucessfully Checked Points");
     }
 }
Beispiel #5
0
 //UpdateLoyaltyButton:
 private void loyaltyUpdate_Click(object sender, EventArgs e)
 {
     if (currentUser.ID == 0)
     {
         MessageBox.Show("Please Login!", "You must register/login first!\nPlease try again!");
     }
     else
     {
         currentUser = service.addLoyalty(currentUser);
         MessageBox.Show("You have " + currentUser.loyaltyVal + " points!", "Sucessfully Updated Points");
     }
 }
Beispiel #6
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            currentUser = addUserMN(loginMobileNumber.Text.ToString());


            currentUser = service.loginUser(currentUser);
            int returnState = currentUser.option;

            if (returnState == 1)
            {
                MessageBox.Show("You are not registered. Check your mobile number or register.", "Not Registered");
            }

            else if (returnState == 2)
            {
                MessageBox.Show("You are logged in " + currentUser.firstName + "!", "Logged In");
            }
        }
Beispiel #7
0
        //RegisterButton:
        private void register_Click(object sender, EventArgs e)
        {
            convertInput(registerFirstName, registerLastName, registerSocialSecurityNumber, registerMobileNum, registerPIN, ref convFN, ref convLN, ref convSSN, ref convMN, ref convPIN);
            currentUser = addUser(convFN, convLN, convMN, convSSN, convPIN);

            currentUser = service.RegisterUserWeb(currentUser);
            int returnState = currentUser.option;

            //DEBUG OUTPUT            MessageBox.Show("FN: " + currentUser.firstName + "\nLN: " + currentUser.lastName + "\nMN: " + currentUser.mobileNumber + "\nSSN " + currentUser.SSN + "\nPIN " + currentUser.PIN + "\nDEBUG OUTPUT");
            if (returnState == 1)
            {
                MessageBox.Show("Welcome " + currentUser.firstName + "! you are officially registered in our sytem!", "Welcome");
            }
            //if existing user state:
            else if (returnState == 2)
            {
                MessageBox.Show("Welcome " + currentUser.firstName + ",\nyou are logged in to our sytem!", "Logged In");
            }
        }