Exemple #1
0
        public BindingCollection <RequestEntity> GetRequstList(RequestListFilterEntity filter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("Filter can not be null.");
            }
            _logger.Debug("Params: Filter = {0};", filter.ToInternalString());

            return(_dbAccessor.GetRequests(filter));
        }
Exemple #2
0
        public BindingCollection <RequestEntity> GetRequests(RequestListFilterEntity filter)
        {
            _logger.Debug("GetRequests.");
            if (filter == null)
            {
                throw new ArgumentNullException("Filter param can not be null.");
            }
            _logger.Debug("Params: filter = {0};", filter.ToInternalString());

            BindingCollection <RequestEntity> result = new BindingCollection <RequestEntity>();

            _commonDbService.SetParam("FROM", filter.StartDateTimeString);
            _commonDbService.SetParam("UNTIL", filter.StopDateTimeString);
            _commonDbService.SetParam("STATUS", filter.StatusIdList);
            _commonDbService.SetParam("ID_ORG", filter.OrganizationIdtString);
            _commonDbService.SetParam("ID_COMP", filter.ApplicationIdtString);
            _commonDbService.SetParam("ID_USER", filter.UserIdtString);
            _commonDbService.SetParam("ID_CREATOR", filter.CreatorIdtString);
            _commonDbService.SetParam("TAGS", filter.TagIdList);

            OraCommand command = new OraCommand("REQ_PKG.SEL_REQ");

            command.CommandType = CommandType.StoredProcedure;
            OraParamRefCursor refCur = new OraParamRefCursor("p_req_cr", ParameterDirection.Output);

            command.AddDBParam(refCur);
            Execute(command);

            if (refCur.ParamValue != null)
            {
                foreach (DataRow reqRow in refCur.ParamValue.Rows)
                {
                    result.Add(ToRequest(reqRow));
                }
            }

            return(result);
        }