public string UpdateMTPReferalStatus(ANMReferalRequest rData) { try { string stProc = UpdateStatusANMNotificationMTPReferal; var pList = new List <SqlParameter> { new SqlParameter("@MTPReferalId", rData.referalId ?? rData.referalId), new SqlParameter("@UserId", rData.userId), }; UtilityDL.ExecuteNonQuery(stProc, pList); return("MTP referal status updated successfully"); } catch (Exception e) { throw e; } }
public ActionResult <ServiceResponse> UpdateMTPReferalStatus(ANMReferalRequest rData) { _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}"); _logger.LogDebug($"Request -Updating mtp referal status data - {JsonConvert.SerializeObject(rData)}"); try { var sampleStatus = _anmNotificationsService.UpdateMTPReferalStatus(rData); _logger.LogInformation($"mtp referal status updated successfully - {sampleStatus}"); _logger.LogDebug($"Response - Updating mtp referal status data - {JsonConvert.SerializeObject(sampleStatus)}"); return(new ServiceResponse { Status = sampleStatus.Status, Message = sampleStatus.Message, Result = null }); } catch (Exception ex) { _logger.LogError($"Failed to update the mtp referal status - {ex.StackTrace}"); return(new ServiceResponse { Status = "false", Message = ex.Message, Result = null }); } }
public ServiceResponse UpdateMTPReferalStatus(ANMReferalRequest rData) { var response = new ServiceResponse(); try { if (rData.userId <= 0) { response.Status = "false"; response.Message = "Invalid user id"; } else if (string.IsNullOrEmpty(rData.referalId)) { response.Status = "false"; response.Message = "referal id is missing"; } else { var result = _anmNotificationsData.UpdateMTPReferalStatus(rData); if (string.IsNullOrEmpty(result)) { response.Status = "false"; response.Message = "Unable to update mtp referal status data"; } else { response.Status = "true"; response.Message = result; } } } catch (Exception e) { response.Status = "false"; response.Message = e.Message; } return(response); }