public async Task <IActionResult> SaveWorkNoficationFeedBack([FromBody] WnFeedbackViewModel wfvm) { try { CurrentUser cUser = new CurrentUser(HttpContext, _configuration); wfvm.UserId = cUser.UserId; return(Ok(await worknotificationRepo.SaveWorkNoficationFeedBack(wfvm))); } 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))); } }
public async Task <IEnumerable <dynamic> > SaveWorkNoficationFeedBack(WnFeedbackViewModel wfvm) { string sql = "dbo.EAppSaveWorkNotificationComplete"; using (var conn = util.MasterCon()) { try { return(await(conn.QueryAsync <dynamic>(sql, new { wfvm.WNEquipmentId, wfvm.WNCompletionDate, wfvm.Feedback, wfvm.RiAmperage, wfvm.IsAccurate, wfvm.UserId }, commandType: CommandType.StoredProcedure))); } catch (Exception ex) { throw new CustomException("Unable to Load Data, Please Contact Support!!!", "Error", true, ex); } } }