public async Task <IEnumerable <dynamic> > GetSegmentiDByFailureCausesDetail([FromBody] ListEMaintSectorByCustomerViewModel lehvm) { string sql = "dbo.OAppDBSegmentByFailureCausesDetail"; using (var conn = util.MasterCon()) { try { return(await(conn.QueryAsync <dynamic>(sql, new { lehvm.SectorId }, commandType: CommandType.StoredProcedure))); } catch (Exception ex) { throw new CustomException("Unable to Load Data, Please Contact Support!!!", "Error", true, ex); } } }
//[SKFAuthorize("PRG12:P1")] public async Task <IActionResult> GetSegmentIDByFailureCauseDetail([FromBody] ListEMaintSectorByCustomerViewModel lehvm) { CurrentUser cUser = new CurrentUser(HttpContext, _configuration); try { lehvm.SectorId = lehvm.SectorId; //lehvm.ClientSiteId var result = await observerDashboardRepo.GetSegmentiDByFailureCausesDetail(lehvm); await auditLogService.LogActivity(cUser.UserId, cUser.HostIP, cUser.SessionId, "Area", "Area list Loaded."); return(Ok(result)); } catch (CustomException cex) { var responseObj = new EmaintenanceMessage(cex.Message, cex.Type, cex.IsException, cex.Exception?.ToString()); return(StatusCode(StatusCodes.Status500InternalServerError, responseObj)); } catch (Exception ex) { return(Ok(new EmaintenanceMessage(ex.Message))); } }