public string UpdateSampleStatus(NotificationDCRequest nData) { try { string stProc = UpdateStatusDCNotificationSamples; var pList = new List <SqlParameter> { new SqlParameter("@BarcodeNo", nData.barcodeNo ?? nData.barcodeNo), new SqlParameter("@UserId", nData.userId), }; UtilityDL.ExecuteNonQuery(stProc, pList); return("Positive subject status updated successfully"); } catch (Exception e) { throw e; } }
public ActionResult <ServiceResponse> UpdateSampleStatus(NotificationDCRequest nData) { try { _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}"); _logger.LogDebug($"Updating sample status data - {JsonConvert.SerializeObject(nData)}"); var sampleStatus = _dcService.UpdateSampleStatus(nData); _logger.LogInformation($"Sample status updated successfully - {nData}"); return(new ServiceResponse { Status = sampleStatus.Status, Message = sampleStatus.Message, Result = null }); } catch (Exception ex) { _logger.LogError($"Failed to update the sample status - {ex.StackTrace}"); return(new ServiceResponse { Status = "false", Message = ex.Message, Result = null }); } }
public ServiceResponse UpdateSampleStatus(NotificationDCRequest nData) { var response = new ServiceResponse(); try { if (nData.userId <= 0) { response.Status = "false"; response.Message = "Invalid user id"; } else if (string.IsNullOrEmpty(nData.barcodeNo)) { response.Status = "false"; response.Message = "Barcode is missing"; } else { var result = _dcData.UpdateSampleStatus(nData); if (string.IsNullOrEmpty(result)) { response.Status = "false"; response.Message = "Unable to update sample status data"; } else { response.Status = "true"; response.Message = result; } } } catch (Exception e) { response.Status = "false"; response.Message = e.Message; } return(response); }