Пример #1
0
        public static AccionResponse ObtenerPaginado(AccionLogic Logic)
        {
            AccionResponse Response = new AccionResponse();

            Response.CodigoAccion = Logic.CodigoAccion;
            Response.Nombre       = Logic.Nombre;
            Response.Descripcion  = Logic.Descripcion;

            Response.CantTotalRegistros = Logic.CantTotalRegistros;

            //Obligatorios
            Response.EstadoRegistroDescripcion = Logic.EstadoRegistroDescripcion;
            Response.EstadoRegistro            = Logic.EstadoRegistro;
            Response.NumeroFila = Logic.NumeroRegistro;
            Response.FilasTotal = Logic.TotalRegistro;

            return(Response);
        }
Пример #2
0
        public ProcessResult <AccionResponse> Obtener(float codigo)
        {
            ProcessResult <AccionResponse> resultado = new ProcessResult <AccionResponse>();

            try
            {
                AccionLogic lista = LogicRepository.Obtener(codigo);

                resultado.Result = new AccionResponse();

                if (resultado.Result != null)
                {
                    resultado.Result = AccionAdapter.ObtenerPaginado(lista);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <AccionService>(ex);
            }

            return(resultado);
        }
Пример #3
0
        public AccionLogic Obtener(float codigo)
        {
            AccionLogic entidadLogic = new AccionLogic();

            try
            {
                SQLServer.OpenConection();
                SQLServer.CreateCommand("SEG.USP_SEL_ACCION_OBTENER", CommandType.StoredProcedure,
                                        SQLServer.CreateParameter("CODIGO_ACCION", SqlDbType.BigInt, codigo));
                using (IDataReader oReader = SQLServer.GetDataReader(CommandBehavior.CloseConnection))
                {
                    entidadLogic = new GenericInstance <AccionLogic>().readDataReader(oReader);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                SQLServer.CloseConection();
            }
            return(entidadLogic);
        }