protected void btnRegister_clicked(object sender, System.EventArgs e) { userRepos = new UserRepository(); inviteeRepos = new InviteeRepository(); string regCode = txtRegCode.Text; string redirect_url = string.Format("~/Account/PhysicianRegistration.aspx?{0}={1}", Constants.REGISTARTION_CODE, regCode); if (!userRepos.IsValidRegistrationCode(regCode)) { lblRegResult.Text = "Registration Code is invalid"; return; } if (inviteeRepos.PhysicianLimitReached(regCode)) { //lblRegResult.Text = "Registration Limit Reached"; ScriptManager.RegisterStartupScript ( this, typeof(Page), "POPUP_INVALID_REG", "window.open('userLimitReached.htm', 'userLimitReached', 'width=450, height=450');", true ); return; } if (!inviteeRepos.IsRegistered(regCode)) { Response.Redirect(redirect_url); } else { lblRegResult.Text = "User already registered"; } }
public bool IsRegistered(string regCode) { return(invRepos.IsRegistered(regCode)); }