Esempio n. 1
0
        protected void btn_Register_Click(object sender, EventArgs e)
        {
            if (TextBoxEmail.Text == "" || TextBoxName.Text == "" || TextBoxPassagain.Text == "" || TextBoxPassword.Text == "" ||
                TextBoxSurname.Text == "" || TextBoxUsername.Text == "" || Calendar1.SelectedDate == null)
            {
                lbl_intro.Text = "Please fill empty places!";
                return;
            }

            if (isThereUsername())
            {
                lbl_intro.Text = "This username has already registered!";
                return;
            }

            if (TextBoxUsername.Text.Length < 8 || TextBoxUsername.Text.Length > 15)
            {
                lbl_intro.Text = "The length of password should be 8-15 !";
                return;
            }

            if (!isCorrectPassword())
            {
                return;
            }

            if (TextBoxEmail.Text.IndexOf('@') == -1 || TextBoxEmail.Text.IndexOf('.', TextBoxEmail.Text.IndexOf('@')) == -1)
            {
                lbl_intro.Text = "Please enter correct E-mail adress!";
                return;
            }

            if (Calendar1.SelectedDate.Year == 1)
            {
                lbl_intro.Text = "Please choose your birthday!";
                return;
            }

            tbl_user newUser = new tbl_user();

            newUser.UserName = TextBoxUsername.Text;
            newUser.Password = TextBoxPassword.Text;
            newUser.Name     = TextBoxName.Text;
            newUser.Surname  = TextBoxSurname.Text;
            newUser.Email    = TextBoxEmail.Text;
            newUser.Birthday = Calendar1.SelectedDate;
            newUser.Type     = 1;

            db.tbl_users.InsertOnSubmit(newUser);
            db.SubmitChanges();

            Response.Redirect("Login.aspx");
        }
Esempio n. 2
0
 partial void Deletetbl_user(tbl_user instance);
Esempio n. 3
0
 partial void Updatetbl_user(tbl_user instance);
Esempio n. 4
0
 partial void Inserttbl_user(tbl_user instance);