public UserControlInsertInputPoint() { InitializeComponent(); dbInputExam = new DBInputExam(); dbStudying = new DBStudying(); dbRegister = new DBRegister(); dbClass = new DBClass(); dbBlackList = new DBBlackList(); }
public UserControlArrange() { InitializeComponent(); dbRegister = new DBRegister(); dbClassType = new DBClassType(); dbClassLevel = new DBClassLevel(); dbClass = new DBClass(); dbInputExam = new DBInputExam(); }
public void insertRegisterInfo(Register r) { dalregister = new DBRegister(); string regmail = r.Email; string regvoornaam = r.Voornaam; string regachternaam = r.Achternaam; string regpwd = r.Password; dalregister.Insert(regmail, regpwd, regvoornaam, regachternaam); }
protected void btnCreateAcct_Click(object sender, EventArgs e) { string user, pass, first, last, email; int age = Convert.ToInt16(tbAge.Text); bool admin = cbAdmin.Checked; user = tbUser.Text; pass = tbPass.Text; first = tbFirst.Text; last = tbLast.Text; email = tbEmail.Text; Profile p = new global::Profile(user, pass, first, last, email, age, admin); // Week2 unusable class Profile... replace with SQLdb, week3. //Profile userProfile = new Profile(pass, first, last, email, age, admin); //if (Session["Messina"] == null) //{ // New record in DB. //DBRegister userLogin = new DBRegister(user, p); // Dictionary Week2... replace with SQLdb, week3. //Dictionary<string, Profile> profiles = (Dictionary<string, Profile>)Session["profiles"]; if (Messina.CheckIfUserExists(user) == false) { if (Messina.CheckIfEmailExists(email) == false) { //profiles.Add(user, userProfile); DBRegister userLogin = new DBRegister(p); //Response.Redirect("Home.aspx"); btnCreateAcct.Visible = false; btnLoginRedirect.Visible = true; lblMsg.Text = "Successfully created account"; } else { tbUser.Text = ""; tbEmail.Text = ""; tbFirst.Text = ""; tbLast.Text = ""; tbPass.Text = ""; tbConfirmPass.Text = ""; tbAge.Text = ""; lblMsg.Text = "Account with that email already exists."; } } else { tbUser.Text = ""; lblMsg.Text = "User name in use"; } //} }
protected void add(object sender, EventArgs e) { if (!(Page.IsValid)) { return; } System.Diagnostics.Debug.Write("1111111111"); System.Diagnostics.Debug.Write("0000000000"); String gender = radlgender.SelectedValue; String country = countrylist.SelectedValue; String brand = lstbrand.SelectedValue; String usage = ""; System.Diagnostics.Debug.WriteLine("55555555" + gender); System.Diagnostics.Debug.WriteLine("55555555" + birthday_textbox.Text); if (chkaerial.Checked) { usage = usage + chkaerial.Text; } if (chkphoto.Checked) { if (usage.Length == 0) { usage = chkphoto.Text; } else { usage = usage + "," + chkphoto.Text; } } if (chkentertainment.Checked) { if (usage.Length == 0) { usage = chkentertainment.Text; } else { usage = usage + "," + chkentertainment.Text; } } DBRegister.InsertParameters["Username"].DefaultValue = username_textbox.Text.Trim(' '); DBRegister.InsertParameters["Password"].DefaultValue = password_textbox.Text.Trim(' '); DBRegister.InsertParameters["Email"].DefaultValue = email_textbox.Text.Trim(' '); DBRegister.InsertParameters["Birthday"].DefaultValue = birthday_textbox.Text.Trim(' '); DBRegister.InsertParameters["Phone_number"].DefaultValue = phonenumber_textbox.Text.Trim(' '); DBRegister.InsertParameters["Home_page"].DefaultValue = homepage_textbox.Text.Trim(' '); DBRegister.InsertParameters["Gender"].DefaultValue = gender; DBRegister.InsertParameters["Country"].DefaultValue = country; DBRegister.InsertParameters["UAV_Brand"].DefaultValue = brand; DBRegister.InsertParameters["Usage"].DefaultValue = usage; try { int insert = DBRegister.Insert(); Response.Write("<script>alert('Register successfully');</script>"); //Response.Write("<script>alert('Register successfully');window.location='Default.aspx';</script>"); // System.Diagnostics.Debug.WriteLine("99999999" + insert); DBRegister_1.SelectCommand = "select * from Register where Username='******' ') + "'"; lvUser.DataSource = DBRegister_1; lvUser.DataBind(); } catch (Exception ex) { ex.GetBaseException(); } }