Ejemplo n.º 1
0
        public JsonResult GenInvestigations([FromBody] InvestigationFilter filter)
        {
            if (ModelState.IsValid && filter != null)
            {
                var result = _context.InvestigationData
                             .FromSql($"usp_GetInvEntries_sel @countryName={filter.countryName}, @categoryName={filter.categoryName}, @aging={filter.aging}, @appuser={filter.appUserID}")
                             .Select(pg => new InvestigationData
                {
                    InvestigationID         = pg.InvestigationID,
                    Due                     = pg.Due,
                    Priority                = pg.Priority,
                    InvestigationStatusName = pg.InvestigationStatusName,
                    FullName                = pg.FullName,
                    DateCreatedUTC          = pg.DateCreatedUTC,
                    LastActivityBy          = pg.LastActivityBy,
                    LastActivityDate        = pg.LastActivityDate,
                    LockedBy                = pg.LockedBy,
                    LockedAt                = pg.LockedAt,
                    CountryName             = pg.CountryName,
                    Category                = pg.Category
                }
                                     );

                return(Json(result.ToList()));
            }
            return(Json(""));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Displays the navigation information on the right panel for Investigations
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public IEnumerable <InvestigationData> GetFilteredInvestigations(InvestigationFilter filter)
        {
            var result = _context.InvestigationData.AsNoTracking()
                         .FromSql("usp_GetInvEntries_sel @countryName={0}, @categoryName={1}, @aging={2}, @appuser={3}",
                                  filter.countryName,
                                  filter.categoryName,
                                  filter.aging,
                                  filter.appUserID)
                         .Select(pg => new InvestigationData
            {
                InvestigationID         = pg.InvestigationID,
                Due                     = pg.Due,
                Priority                = pg.Priority,
                InvestigationStatusName = pg.InvestigationStatusName,
                FullName                = pg.FullName,
                DateCreatedUTC          = pg.DateCreatedUTC,
                LastActivityBy          = pg.LastActivityBy,
                LastActivityDate        = pg.LastActivityDate,
                LockedBy                = pg.LockedBy,
                LockedAt                = pg.LockedAt,
                CountryName             = pg.CountryName,
                Category                = pg.Category
            });

            return(result);
        }
Ejemplo n.º 3
0
        public IActionResult GetFilteredInvestigations([FromBody] InvestigationFilter invFilter)
        {
            var result = _repository.GetFilteredInvestigations(invFilter);

            return(Helper.CheckResult(result));
        }