Beispiel #1
0
        public SalitaCunaAdminBenQueryResult Retrieve(SalitaCunaAdminBenQuery query)
        {
            var queryResult = new SalitaCunaAdminBenQueryResult();

            if (GlobalVars.MockedMode)
            {
                SalitaCunaDtoMocked salasMocked = SalitaCunaDtoMocked.GetInstance();
                queryResult.SalitasCunaDto = salasMocked.GetMocked();
            }
            else
            {
                var querySession = _repositryLocalScheme.Session.CallFunction <SalitasCunaDto>("PR_OBTENER_SALITAS_BENEF(?,?,?,?)")
                                   .SetParameter(0, query.SalaCunaId)
                                   .SetParameter(1, query.SeleccionBaja)
                                   .SetParameter(2, -1)
                                   .SetParameter(3, -1)
                ;
                queryResult.SalitasCunaDto = (List <SalitasCunaDto>)querySession.List <SalitasCunaDto>();
            }
            return(queryResult);
        }
Beispiel #2
0
        public SalitaCunaByFiltersQueryResults Retrieve(SalitaCunaByFiltersQuery query)
        {
            var queryResult = new SalitaCunaByFiltersQueryResults();

            if (GlobalVars.MockedMode)
            {
                SalitaCunaDtoMocked salasMocked = SalitaCunaDtoMocked.GetInstance();
                queryResult.listSalitas = salasMocked.GetMocked();
            }
            else
            {
                var querySession = _repositryLocalScheme.Session.CallFunction <SalitasCunaDto>("PR_OBTENER_SALITAS_BENEF(?,?,?,?) ")
                                   .SetParameter(0, query.SalaCunaId)
                                   .SetParameter(1, query.SeleccionBaja ? 1 : 0)
                                   .SetParameter(2, query.PaginationFrom)
                                   .SetParameter(3, query.PaginationTo);
                queryResult.listSalitas = (List <SalitasCunaDto>)querySession.List <SalitasCunaDto>();
            }

            return(queryResult);
        }