private void AddUser() { UsersBL usersBL = new UsersBL(); string username = "******"; string firstname = "firstname"; string lastname = "lastname"; string email = "email"; string password = "******"; DateTime birthdate = Convert.ToDateTime("01/01/1980"); EGender eGender = EGender.Female; usersBL.AddUser(this.Request, firstname, lastname, email, username, password, birthdate, eGender); }
protected void btnLogin_Click(object sender, EventArgs e) { LblLoginError.Text = string.Empty; UsersBL usersBL = new UsersBL(); long lUserId =usersBL.GetUserid(loginUsername.Text, loginPassword.Text); if (lUserId > 0) { Session.Add(USERID, lUserId); LblLoginError.Text = "פרטים נכונים! " + Session[USERID].ToString(); } else { Session.Remove(USERID); LblLoginError.Text = "פרטים שגויים"; } }
protected void Button1_Click(object sender, EventArgs e) { UsersBL usersBL = new UsersBL(); lblError.Text = string.Empty; if (!usersBL.IsUserExists(tbxUsername.Text)) { string sUsername = tbxUsername.Text; string sFirstname = tbxFirstname.Text; string sLastname = tbxLastname.Text; string sEmail = tbxEmail.Text; string sPassword = password1.Text; DateTime dBirthdate = Convert.ToDateTime("03/07/1974"); EGender eGender = EGender.Female; usersBL.AddUser(this.Request, sFirstname, sLastname, sEmail, sUsername, sPassword, dBirthdate, eGender); } else { lblError.Text = "שם משתמש זה אינו זמין."; } }
private void ValidateUser() { UsersBL usersBL = new UsersBL(); usersBL.ValidateUser("username", "password1"); }