/// Metodo que lista udsuarios de perfilameinto aplicando filtros /// </summary> /// <param name="p_Filtro"></param> /// <returns></returns> public static MensajeWCF <FormsFUN> ObtenerForms() { MensajeWCF <FormsFUN> retorno = new MensajeWCF <FormsFUN>(); List <FormsFUN> response = new List <FormsFUN>(); try { List <FormsFUN> listado = new List <FormsFUN>(); List <Forms> listaForms = FormsDOM.ObtenerTodos(); foreach (Forms form in listaForms) { FormsFUN formfun = new FormsFUN(); formfun.name = form.Name; formfun.inputs = new List <InputsFUN>(); foreach (Inputs item in InputsDOM.ObtenerPorIdForms(form.Id.ToString()).OrderByDescending(x => x.Id)) { //implementar metodo aqui formfun.inputs.Add(new InputsFUN { name = item.Name, type = item.Type, required = item.Required }); } listado.Add(formfun); } retorno.Contenido = listado; retorno.CodigoError = "E_00"; retorno.MensajeError = ""; retorno.MensajeHumano = Mensaje.MensajeError.E_00; } catch (DataException ex) { retorno.CodigoError = "E_01"; retorno.MensajeError = ex.Message; retorno.MensajeHumano = Mensaje.MensajeError.E_01; bool err = ExceptionPolicy.HandleException(ex, POLITICA); } catch (Exception ex) { retorno.CodigoError = "E_02"; retorno.MensajeError = ex.Message; retorno.MensajeHumano = Mensaje.MensajeError.E_02; bool err = ExceptionPolicy.HandleException(ex, POLITICA); } return(retorno); }
public FormsResponseFUN ObtenerForms() { FormsResponseFUN response = new FormsResponseFUN(); MensajeWCF <FormsFUN> respuesta = FormsMgr.ObtenerForms(); if (respuesta.CodigoError == "E_00") { response.status = 200; response.error = ""; response.msg = respuesta.Contenido; } else { response.status = 500; response.error = "Internal Error"; response.msg = new List <FormsFUN>(); } return(response); }