public async Task <IActionResult> UpdateSST(UpdateSSTRequest rData) { _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}"); _logger.LogDebug($"Updating the SST - {JsonConvert.SerializeObject(rData)}"); var subjectSample = await _supportService.UpdateSST(rData); return(Ok(new ServiceResponse { Status = subjectSample.Status, Message = subjectSample.Message, })); }
public ErrorMsgDetail UpdateErrorSST(UpdateSSTRequest bData) { string stProc = UpdateSSTDetail; var pList = new List <SqlParameter>() { new SqlParameter("@SSTID", bData.sstId), new SqlParameter("@SubjectId", bData.subjectId), new SqlParameter("@Barcode", bData.barcode), new SqlParameter("@OldSST", bData.oldSST), new SqlParameter("@NewSST", bData.newSST), new SqlParameter("@Remarks", bData.remarks), new SqlParameter("@UserId", bData.userId), }; var allData = UtilityDL.FillEntity <ErrorMsgDetail>(stProc, pList); return(allData); }
public async Task <ServiceResponse> UpdateSST(UpdateSSTRequest rData) { ServiceResponse sResponse = new ServiceResponse(); var revisedSST = ""; try { if (string.IsNullOrEmpty(rData.subjectId)) { sResponse.Status = "false"; sResponse.Message = "SubjectID is missing"; return(sResponse); } if (rData.sstId <= 0) { sResponse.Status = "false"; sResponse.Message = "Invalid SST ID"; return(sResponse); } else if (string.IsNullOrEmpty(rData.oldSST)) { sResponse.Status = "false"; sResponse.Message = "Current SST Result is missing"; return(sResponse); } else if (string.IsNullOrEmpty(rData.remarks)) { sResponse.Status = "false"; sResponse.Message = "Remarks is missing"; return(sResponse); } else if (rData.userId <= 0) { sResponse.Status = "false"; sResponse.Message = "Invalid UserId"; return(sResponse); } else { var result = _supportData.UpdateErrorSST(rData); if (rData.newSST == true) { revisedSST = "Positive"; } else { revisedSST = "Negative"; } EmailSSTTrigger(rData.subjectId, rData.oldSST, revisedSST); sResponse.Status = "true"; sResponse.Message = result.msg; return(sResponse); } } catch (Exception e) { sResponse.Status = "false"; sResponse.Message = e.Message; return(sResponse); } }