Example #1
0
 public async Task <ActionResult <IFRSRespObj> > GetIFRSSetupData([FromQuery] IFRSSearchObj model)
 {
     try
     {
         var response = _repo.GetIFRSSetupData(model.SetUpId);
         var respList = new List <IFRSSetupDataObj> {
             response
         };
         return(new IFRSRespObj
         {
             SetUpData = respList,
         });
     }
     catch (Exception ex)
     {
         var errorCode = ErrorID.Generate(5);
         _logger.Error($"ErrorID : {errorCode} Ex : {ex?.Message ?? ex?.InnerException?.Message} ErrorStack : {ex?.StackTrace}");
         return(new IFRSRespObj
         {
             Status = new APIResponseStatus {
                 IsSuccessful = false, Message = new APIResponseMessage {
                     FriendlyMessage = "Error Occurred", TechnicalMessage = ex?.Message, MessageId = errorCode
                 }
             }
         });
     }
 }
Example #2
0
 public async Task <ActionResult <IFRSRespObj> > GenerateExportScoreCardHistoryByProduct([FromQuery] IFRSSearchObj model)
 {
     try
     {
         var isDone = _repo.GenerateExportScoreCardHistoryByProduct(model.ProductId, model.CustomerTypeId);
         return(new IFRSRespObj
         {
             Export = isDone,
         });
     }
     catch (Exception ex)
     {
         var errorCode = ErrorID.Generate(5);
         _logger.Error($"ErrorID : {errorCode} Ex : {ex?.Message ?? ex?.InnerException?.Message} ErrorStack : {ex?.StackTrace}");
         return(new IFRSRespObj
         {
             Status = new APIResponseStatus {
                 IsSuccessful = false, Message = new APIResponseMessage {
                     FriendlyMessage = "Error Occurred", TechnicalMessage = ex?.Message, MessageId = errorCode
                 }
             }
         });
     }
 }