public async Task <IEnumerable <dynamic> > GetFailureReportByStatus(FailureReportSearchViewModel frsvm)
        {
            string sql = "dbo.EAppListFailureReport";

            using (var conn = util.MasterCon())
            {
                try
                {
                    return(await(conn.QueryAsync <dynamic>(sql, new { frsvm.ReportType, frsvm.ClientSiteId, frsvm.FailureReportHeaderId, frsvm.LanguageId, frsvm.ReportFromDate, frsvm.ReportToDate }, commandType: CommandType.StoredProcedure)));
                }
                catch (Exception ex)
                {
                    throw new CustomException("Unable to Load Data, Please Contact Support!!!", "Error", true, ex);
                }
            }
        }
        public async Task <IActionResult> GetFailureReportByStatus([FromBody] FailureReportSearchViewModel frsvm)
        {
            try

            {
                return(Ok(await failurereportRepo.GetFailureReportByStatus(frsvm)));
            }
            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)));
            }
        }
Esempio n. 3
0
        public async Task <IActionResult> GetAvoidPlannedMaintenance([FromBody] FailureReportSearchViewModel frsvm)
        {
            try

            {
                CurrentUser cUser  = new CurrentUser(HttpContext, _configuration);
                var         result = await avoidPlannedMaintRepo.GetAvoidPlannedMaintenance(frsvm);

                await auditLogService.LogActivity(cUser.UserId, cUser.HostIP, cUser.SessionId, "Avoided Planned Maintenence", "AvoidPlanned Maintenance 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)));
            }
        }