public SingleResponse <bool> GuardarTicket(TicketModel ticketModel)
        {
            SingleResponse <bool> response = new SingleResponse <bool>();

            try
            {
                if (ticketModel == null)
                {
                    throw new DomainException(Codes.ERR_00_06);
                }
                IList <Validation> validations = ValidatorZero.Validate(ticketModel, new OptionsValidation
                {
                    ValidateIntCero = true
                });
                if (validations.Count > 0)
                {
                    throw new DomainValidationsException(validations);
                }

                ticketModel.FechaRecepcion = CalculoFechaRecepcion();
                TicketModel registroCorrecto = iGestionDataAccess.GuardarTicket(ticketModel);
                try
                {
                    if (ticketModel.IdEstatusTicket == ESTATUS_REGISTRADO)
                    {
                        EnviarMail(registroCorrecto);
                    }
                }
                catch (Exception)
                {
                    response.Done(true, string.Empty);
                }

                response.Done(true, string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesCalendario.ERR_07_03, e));
            }
            return(response);
        }
        public SingleResponse <ArchivoTicketsModel> GuardarArchivo(ArchivoTicketsModel archivoTicketsModel)
        {
            SingleResponse <ArchivoTicketsModel> response = new SingleResponse <ArchivoTicketsModel>();

            try
            {
                ArchivoTicketsModel archivoModel = iGestionDataAccess.GuardarArchivo(archivoTicketsModel);
                response.Done(archivoModel, string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesCalendario.ERR_07_03, e));
            }
            return(response);
        }
        public SingleResponse <IList <MenuModel> > ConsultaMenus(MenuModel menu)
        {
            SingleResponse <IList <MenuModel> > response = new SingleResponse <IList <MenuModel> >();

            try
            {
                menu.PerfilId  = menu.GetIdPerfilUsuarioSesion();
                menu.PersonaId = menu.GetIdUsuarioSesion();
                menu.ManejaUDI = null; /* INDRA FJQP ManejaUDI */
                IList <MenuModel> listaMenus = iSeguridadDataAccess.ConsultaMenus(menu);
                response.Done(listaMenus, Codes.INF_00_00);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_00, e));
            }
            return(response);
        }
        public SingleResponse <IList <PersonaResponsableModel> > BuscarUsuarioResponsable(PersonaResponsableModel personaResponsableModel)
        {
            SingleResponse <IList <PersonaResponsableModel> > response = new SingleResponse <IList <PersonaResponsableModel> >();

            try
            {
                IList <PersonaResponsableModel> listaPersonas = iConfigurarParametrosTicketsDataAccess.BuscarUsuarioResponsable(personaResponsableModel);
                response.Done(listaPersonas, string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesConfigParamTickets.ERR_08_02, e));
            }
            return(response);
        }
Exemple #5
0
        public SingleResponse <bool> EliminarCalendario(CalendarioModel calendarioModel)
        {
            SingleResponse <bool> response = new SingleResponse <bool>();

            try
            {
                bool ban = iCalendarioTicketsDataAcces.EliminarCalendario(calendarioModel);
                response.Done(ban, string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesCalendario.ERR_07_04, e));
            }
            return(response);
        }
Exemple #6
0
        public SingleResponse <CalendarioModel> GuardarCalendario(CalendarioModel calendarioModel)
        {
            SingleResponse <CalendarioModel> response = new SingleResponse <CalendarioModel>();

            try
            {
                CalendarioModel calModel = iCalendarioTicketsDataAcces.GuardarCalendario(calendarioModel);
                response.Done(calModel, string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesCalendario.ERR_07_03, e));
            }
            return(response);
        }
        public SingleResponse <TextoAuxiliarUsoVehiculoModel> GuardaTextoAuxiliarUso(ConfiguradorModel configuradorModel)
        {
            var response = new SingleResponse <TextoAuxiliarUsoVehiculoModel>();

            try
            {
                var guardaTextoAux = iConfiguradorDataAcess.GuardaTextoAuxiliarUso(configuradorModel);
                response.IsOk.Equals(true);
                TextoAuxiliarUsoVehiculoModel empty = new TextoAuxiliarUsoVehiculoModel();
                response.Done(empty, string.Empty);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <CoberModel> ActualizaRangosDeducibles(ConfiguradorModel configuradorModel)
        {
            var response = new SingleResponse <CoberModel>();

            try
            {
                var actualizaDeducibles = iConfiguradorDataAcess.ActualizaRangosDeducibles(configuradorModel);
                response.IsOk.Equals(true);
                CoberModel empty = new CoberModel();
                response.Done(empty, string.Empty);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <IList <PerfilesUsuarioModel> > ConsultaPerfilesSistema()
        {
            SingleResponse <IList <PerfilesUsuarioModel> > response = new SingleResponse <IList <PerfilesUsuarioModel> >();

            try
            {
                IList <PerfilesUsuarioModel> perfiles = iConfiguradorDataAcess.ConsultaPerfilesSistema();
                response.Done(perfiles, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }
            return(response);
        }
        public SingleResponse <IList <nePersonasModel> > ConsultarClientesConfigurador()
        {
            SingleResponse <IList <nePersonasModel> > response = new SingleResponse <IList <nePersonasModel> >();

            try
            {
                IList <nePersonasModel> cotizantes = iConfiguradorDataAcess.ConsultarClientesConfigurador();
                response.Done(cotizantes, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <IList <ElementoModel> > CargoEnLinea()
        {
            SingleResponse <IList <ElementoModel> > response = new SingleResponse <IList <ElementoModel> >();

            try
            {
                IList <ElementoModel> cargoLinea = iConfiguradorDataAcess.CargoEnLinea();
                response.Done(cargoLinea, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }
            return(response);
        }
        public SingleResponse <IList <DocumentosCoberModel> > ConsultaDocumentosTodos()
        {
            var response = new SingleResponse <IList <DocumentosCoberModel> >();

            try
            {
                var selDocumentos = iConfiguradorDataAcess.ConsultaDocumentosTodos();
                response.Done(selDocumentos, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
Exemple #13
0
        public SingleResponse <IList <ReporteModel> > ConsultarTicketsReporte(ReporteModel reporteModel)
        {
            SingleResponse <IList <ReporteModel> > response = new SingleResponse <IList <ReporteModel> >();

            try
            {
                IList <ReporteModel> reporte = iReporteDataAccess.ConsultarTicketsReporte(reporteModel);
                response.Done(reporte, string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesReportesTickets.ERR_05_02, e));
            }
            return(response);
        }
        public SingleResponse <IList <AsegModel> > ConsultaAseguradoras(ClienteAsegModel clienteAseg)
        {
            SingleResponse <IList <AsegModel> > response = new SingleResponse <IList <AsegModel> >();

            try
            {
                IList <AsegModel> listAseg = iGestionDataAccess.ConsultaAseguradoras(clienteAseg);
                response.Done(listAseg, string.Empty);
                response.ThrowIfNotOk();
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesTickets.ERR_00_17, e));
            }
            return(response);
        }
        public SingleResponse <bool> EliminarArchivo(ArchivoTicketsModel archivoTicketsModel)
        {
            SingleResponse <bool> response = new SingleResponse <bool>();

            try
            {
                bool archivoEliminado = iGestionDataAccess.EliminarArchivo(archivoTicketsModel);
                response.Done(archivoEliminado, "Archivo Eliminado Correctamente");
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesCalendario.ERR_07_03, e));
            }
            return(response);
        }
        public SingleResponse <IList <ElementoModel> > ConsultaTipoAuto()
        {
            SingleResponse <IList <ElementoModel> > response = new SingleResponse <IList <ElementoModel> >();

            try
            {
                IList <ElementoModel> tiposAuto = iConfiguradorDataAcess.ConsultaTipoAuto();
                response.Done(tiposAuto, string.Empty);
            }

            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }
            return(response);
        }
        public SingleResponse <RangosModel> ConsultaRangosSumasAseguradas(ConfiguradorModel configuradorModel)
        {
            var response = new SingleResponse <RangosModel>();

            try
            {
                var rangos = iConfiguradorDataAcess.ConsultaRangosSumasAseguradas(configuradorModel);
                response.Done(rangos, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <IList <UsuariosPerfil> > ConsultaUsuarioPorPerfil(ConfiguradorModel usuarioPerfilModel)
        {
            var response = new SingleResponse <IList <UsuariosPerfil> >();

            try
            {
                IList <UsuariosPerfil> usuarios = iConfiguradorDataAcess.ConsultaUsuarioPorPerfil(usuarioPerfilModel);
                response.Done(usuarios, string.Empty);
            }

            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }
            return(response);
        }
        public SingleResponse <DocumentosPorCoberturaModel> GuardarDocumentoCobertura(ConfiguradorModel configuradorModel)
        {
            var response = new SingleResponse <DocumentosPorCoberturaModel>();

            try
            {
                var guardaDocumentoCobertura = iConfiguradorDataAcess.GuardarDocumentoCobertura(configuradorModel);
                response.IsOk.Equals(true);
                DocumentosPorCoberturaModel empty = new DocumentosPorCoberturaModel();
                response.Done(empty, string.Empty);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <IList <PerfilesFlexModel> > ConsultarUsuariosFlexibles()
        {
            var response = new SingleResponse <IList <PerfilesFlexModel> >();

            try
            {
                IList <PerfilesFlexModel> usuariosFlex = iConfiguradorDataAcess.ConsultarUsuariosFlexibles();
                response.Done(usuariosFlex, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }
            return(response);
        }
        public SingleResponse <ConfiguradorModel> ConsultarEnmascaradoDeducibles(ConfiguradorModel configuradorModel)
        {
            var response = new SingleResponse <ConfiguradorModel>();

            try
            {
                ConfiguradorModel conf = new ConfiguradorModel
                {
                    CoberturaEnmascaramientoDeducible = iConfiguradorDataAcess.ConsultarEnmascaradoDeducibles(configuradorModel)
                };

                response.Done(conf, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <IList <FormasPagoProductoAseguradoraModel> > ConsultarFormasPagoAseguradoraLista()
        {
            var response = new SingleResponse <IList <FormasPagoProductoAseguradoraModel> >();

            try
            {
                IList <FormasPagoProductoAseguradoraModel> formasPagoAseguradora = iConfiguradorDataAcess.ConsultarFormasPagoAseguradoraLista();
                response.Done(formasPagoAseguradora, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }
            return(response);
        }
Exemple #23
0
        public SingleResponse <IList <CalendarioModel> > ConsultarCalendario()
        {
            SingleResponse <IList <CalendarioModel> > response = new SingleResponse <IList <CalendarioModel> >();

            try
            {
                IList <CalendarioModel> lista = iCalendarioTicketsDataAcces.ConsultarCalendario();
                response.Done(lista, string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesCalendario.ERR_07_03, e));
            }
            return(response);
        }
        public SingleResponse <PerfilesFlexibleModel> GuardaUsuarioFlexible(ConfiguradorModel perfilesFlexibleModel)
        {
            var    response  = new SingleResponse <PerfilesFlexibleModel>();
            string respuesta = string.Empty;

            try
            {
                var perfilFlex = iConfiguradorDataAcess.GuardaUsuarioFlexible(perfilesFlexibleModel);
                response.IsOk.Equals(true);
                PerfilesFlexibleModel perfilesEmpty = new PerfilesFlexibleModel();
                response.Done(perfilesEmpty, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(e);
            }
            catch (DalException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(e);
            }
            catch (Exception e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <CondicionesGralesModel> ConsultaCondicionesGrales(VersionesModel versiones)
        {
            SingleResponse <CondicionesGralesModel> response = new SingleResponse <CondicionesGralesModel>();

            try
            {
                #region ModelValidations

                if (null == versiones)
                {
                    throw new DomainException(Codes.ERR_00_06);
                }

                #endregion

                CondicionesGralesModel condicionesGralesModel = new CondicionesGralesModel()
                {
                    CondicionesGralesQlt          = ConfigurationManager.AppSettings["CondicionesGralesQlt"],
                    CondicionesGralesAutos        = ConfigurationManager.AppSettings["CondicionesGralesAutos"],
                    CondicionesGralesCamiones     = ConfigurationManager.AppSettings["CondicionesGralesCamiones"],
                    MuestraCondicionesGralesAutos = versiones.VehiculoId == 757,
                };

                response.Done(condicionesGralesModel, string.Empty);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesImprimir.ERR_00_03, e));
            }
            return(response);
        }
        public SingleResponse <IList <ProductoModel> > ConsultaProductosFlexibles()
        {
            SingleResponse <IList <ProductoModel> > response = new SingleResponse <IList <ProductoModel> >();

            try
            {
                IList <ProductoModel> productos = iConfiguradorDataAcess.ConsultaProductosFlexibles();
                response.Done(productos, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <bool> EliminarTipoTicketsCliente(TiposTicketModel tiposTicket)
        {
            SingleResponse <bool> response = new SingleResponse <bool>();

            try
            {
                response.Done(iConfigurarParametrosTicketsDataAccess.EliminarTipoTicketsCliente(tiposTicket), string.Empty);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(CodesConfigParamTickets.ERR_08_03, e));
            }
            return(response);
        }
        public SingleResponse <CoberModel> ActualizarHomologacionTooltip(ConfiguradorModel configuradorModel)
        {
            var    response  = new SingleResponse <CoberModel>();
            string respuesta = string.Empty;

            try
            {
                var actualizaHomoTooltip = iConfiguradorDataAcess.ActualizarHomologacionTooltip(configuradorModel);
                response.IsOk.Equals(true);
                CoberModel empty = new CoberModel();
                response.Done(empty, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(e);
            }
            catch (DalException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(e);
            }
            catch (Exception e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }
        public SingleResponse <AmVersionSistemaModel> ConsultaVesionSistema()
        {
            SingleResponse <AmVersionSistemaModel> response = new SingleResponse <AmVersionSistemaModel>();

            try
            {
                AmVersionSistemaModel version = iSeguridadDataAccess.ConsultaVesionSistema();
                response.Done(version, Codes.INF_00_00);
            }
            catch (DomainValidationsException e)
            {
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                response.Error(e);
            }
            catch (DalException e)
            {
                response.Error(e);
            }
            catch (Exception e)
            {
                response.Error(new DomainException(Codes.ERR_00_00, e));
            }
            return(response);
        }
        public SingleResponse <FormasPagoProductoAseguradora> EliminarFormaPagoProductoAseguradora(ConfiguradorModel formasPagoProductoAseguradora)
        {
            var    response  = new SingleResponse <FormasPagoProductoAseguradora>();
            string respuesta = string.Empty;

            try
            {
                var eliminarFormaPagoAseguradora = iConfiguradorDataAcess.EliminarFormaPagoProductoAseguradora(formasPagoProductoAseguradora);
                response.IsOk.Equals(true);
                FormasPagoProductoAseguradora empty = new FormasPagoProductoAseguradora();
                response.Done(empty, string.Empty);
            }
            catch (DomainValidationsException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.SetValidations(e.Validations);
            }
            catch (DomainException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(e);
            }
            catch (DalException e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(e);
            }
            catch (Exception e)
            {
                respuesta = "No se agrego el producto de forma correcta";
                response.Error(new DomainException(Codes.ERR_00_01, e));
            }

            return(response);
        }