public System.Data.DataSet _getProfileFavorites(string e_mail, string Passwd, int cantEnLista) { try { Perfil perfil = new Perfil(); int IdPerfil = perfil.Identificar(e_mail, Passwd, true); if(IdPerfil>0) { return perfil.getFavoritos(IdPerfil, cantEnLista); } else { throw new SoapException("Error al validar las credenciales del usuario.", SoapException.ClientFaultCode); //throw new System.Exception("Error al validar las credenciales del usuario."); } } catch(System.Exception Ex) { string errorMessage = ProcessError.getMessageToUser(Ex) + " " + System.Environment.NewLine; try { ProcessError processError = new ProcessError(); if(processError.GuardarError(Ex, "AzuPass", "_getProfileFavorites")) { errorMessage = errorMessage + processError.ErrorRecordedNotification; } processError = null; } catch(System.Exception) { ; // No hacer nada si falla el mecanismo de guardar los errores. } throw new SoapException(errorMessage, SoapException.ClientFaultCode); //throw new System.Exception(errorMessage); } }
public System.Data.DataSet _LogOnPlus(string e_mail, string Passwd, string clientAppName, string clientAppURL, ServicedApplication.enuApplicationState appState) { int IdPerfil = 0; IdPerfil = this.LogOn(e_mail, Passwd, clientAppName, clientAppURL, appState); if(IdPerfil==0) { throw new SoapException("Acceso denegado. Verifique que sus credenciales sean las correctas, " + "si está seguro de ello, verifique que su cuenta no esté deshabilitada.",SoapException.ClientFaultCode); } try { Perfil perfil = new Perfil(); perfil.ID = IdPerfil; // Registrar el usuario y la aplicación en tabla tbl_RegistroUso no es necesario // porque el propio procedimiento almacenado "pa_tbl_Perfil_GvIDxEmailPasswd_Plus" // valida las credenciales y agrega un nuevo registro a la tabla "tbl_RegistroUso". System.Data.DataSet ds = new System.Data.DataSet("dsPerfil"); ds.Tables.Add(perfil.dsEntidad.Tables[0].Copy()); ds.Tables[0].TableName = "Perfil"; /* Eliminar el código para agregar el Role como campo, porque no se considera necesario. System.Data.DataColumn dtRole = new DataColumn("Role", System.Type.GetType("System.String")); ds.Tables[0].Columns.Add(dtRole); ds.Tables[0].Rows[0]["Role"] = "Usuario"; for(int i=0; i<=(wsSettings.wsAdmins.Length-1); i++) { if(e_mail == wsSettings.wsAdmins[i]) { ds.Tables[0].Rows[0]["Role"] = "Administrador"; } } */ //ds.Tables[0].Columns.Remove("ID"); ds.Tables[0].Columns.Remove("Passwd"); ds.Tables[0].Columns.Remove("IdCatOcupacional"); ds.Tables[0].Columns.Remove("Habilitado"); ds.Tables[0].Columns.Remove("DescripIntereses"); ds.Tables.Add(perfil.getFavoritos(perfil.ID, 5).Tables[0].Copy()); ds.Tables[1].TableName = "Favoritos"; perfil = null; return ds; } catch(System.Exception Ex) { string errorMessage = ProcessError.getMessageToUser(Ex) + " " + System.Environment.NewLine; try { ProcessError processError = new ProcessError(); if(processError.GuardarError(Ex, "AzuPass", "_LogOnPlus", clientAppName, clientAppURL, IdPerfil)) { errorMessage = errorMessage + processError.ErrorRecordedNotification; } processError = null; } catch(System.Exception) { ; // No hacer nada si falla el mecanismo de guardar los errores. } throw new SoapException(errorMessage, SoapException.ClientFaultCode); } }