/// <summary> /// Crea el usuario directamente. Este metodo sera llamado por una interfaz con autorizacion de desarrollador-super-admin del sistema /// dado que: Marca como aprovada la solicitud de registro y crea el usuario en el sistema /// Luego el usuario debera cambiar su clave /// /// No se crea aqui el profecional /// </summary> /// <param name="registrationRequestId"></param> /// <param name="passwordQuestion"></param> /// <param name="passwordAnswer"></param> /// <param name="status"></param> /// <returns></returns> public MembershipUser CreateUser(int registrationRequestId, string passwordQuestion, string passwordAnswer, out MembershipCreateStatus status) { RegistrationRequest registrationRequest = WebRegistrationDAC.Get_RegistrationRequest_Id(registrationRequestId); if (registrationRequest == null) { throw new Fwk.Exceptions.TechnicalException("Solicitud de registro no vĂ¡lida .-"); } WebRegistrationDAC.Approve(registrationRequest.Id); // Crea el usuario User usr = Fwk.Security.FwkMembership.CreateUser(registrationRequest.UserName, registrationRequest.RegistrationCode, registrationRequest.mail, passwordQuestion, passwordAnswer, true, out status, _SQLMembershipProvider); MembershipUser membershipUser = null; if (status == MembershipCreateStatus.Success || status == MembershipCreateStatus.DuplicateUserName) { membershipUser = GetUser(registrationRequest.UserName, true); //profesionalBE.Persona.UserId = (Guid)membershipUser.ProviderUserKey; //Generar el profesional //ProfesionalesDAC.Create(profesionalBE); } return(membershipUser); }
/// <summary> /// Metodo que solo genera una solicitud de registro .- Esta solicitud debe ser aprovada despues .- /// </summary> /// <param name="username"></param> /// <param name="nombre"></param> /// <param name="apellido"></param> /// <param name="nroDocumento"></param> /// <param name="matricula"></param> /// <param name="password"></param> /// <param name="email"></param> /// <param name="passwordQuestion"></param> /// <param name="passwordAnswer"></param> public void RegistrationRequest(RegistrationRequest registrationRequest) { var Profesional_FullView = ProfesionalesDAC.Get_ByParams(registrationRequest.NroDocumento, registrationRequest.Matricula); if (Profesional_FullView != null) { throw new Fwk.Exceptions.TechnicalException( string.Format("Ya existe registrado un profecional con Nro Documento: {0} .-", registrationRequest.NroDocumento)); } string registrationCode = Common.getMd5Hash(string.Concat(registrationRequest.UserName, registrationRequest.mail)); //RegistrationRequest registrationRequest = new RegistrationRequest(); //registrationRequest.Nombre = txtNombre.Text.Trim(); //registrationRequest.Apellido = txtApellido.Text.Trim(); //registrationRequest.UserName = txtUserName.Text; //registrationRequest.NroDocumento = txtNrodocumento.Text.Trim(); //registrationRequest.Matricula = txtMatricula.Text.Trim(); //registrationRequest.mail = txtEmail.Text.Trim(); registrationRequest.RegistrationCode = registrationCode; WebRegistrationDAC.CreateRegistrationRequest(registrationRequest); }