Esempio n. 1
0
        protected void btn_signup_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("### BTN SIGNUP CLIKCED  ###");
            string username     = txt1.Text;
            string email        = txt2.Text;
            string password     = txt3.Text;
            string phone        = txt4.Text;
            string access_level = ddn_1.SelectedItem.Value;

            System.Diagnostics.Debug.WriteLine("###USERNAME="******"###");
            System.Diagnostics.Debug.WriteLine("###EMAIL=" + email + "###");
            System.Diagnostics.Debug.WriteLine("###PASSWORD" + password + "###");
            System.Diagnostics.Debug.WriteLine("###PHONE=" + phone + "###");
            System.Diagnostics.Debug.WriteLine("###ACCESS_LEVEL=" + access_level + "###");
            signup_PROPS_OBJ              = new SignupProps();
            signup_PROPS_OBJ.Username     = username;
            signup_PROPS_OBJ.Password     = password;
            signup_PROPS_OBJ.Email        = email;
            signup_PROPS_OBJ.Phone        = phone;
            signup_PROPS_OBJ.Access_level = access_level;
            signup_BLL_OBJ = new SignupBLL();
            int status = signup_BLL_OBJ.INSERT_BLL(signup_PROPS_OBJ);

            if (status > 0)
            {
                System.Diagnostics.Debug.WriteLine("### SIGNUP INSERT SUCCESSFULL ###");
                Response.Write("<script>alert('You Have been Successfully Resgistered ')</script>");
                Response.Redirect("Login.aspx");
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("### SIGNUP INSERT FAILED ###");
            }
        }
Esempio n. 2
0
        public void TestAddUsers()
        {
            SignupBLL bll = new SignupBLL();
            bool      actualResult, expectedResult;

            bll._fName     = "admin";
            bll._lName     = "admin";
            bll._password  = "******";
            bll._username  = "******";
            expectedResult = true;
            actualResult   = bll.InsertUsers();
            Assert.AreEqual(actualResult, expectedResult);
        }