public async Task <AddHPLCResponse> UpdateProcessedHPLCTestResult(UpdateProcessedResultRequest hplcData) { var hplcResponse = new AddHPLCResponse(); try { if (hplcData.HbA0 == "") { hplcResponse.Status = "false"; hplcResponse.Message = "HbA0 is missing"; } else if (hplcData.HbA2 == "") { hplcResponse.Status = "false"; hplcResponse.Message = "HbA2 is missing"; } else if (hplcData.HbF == "") { hplcResponse.Status = "false"; hplcResponse.Message = "HbF is missing"; } else if (hplcData.HbS == "") { hplcResponse.Status = "false"; hplcResponse.Message = "HbS is missing"; } else if (hplcData.HbD == "") { hplcResponse.Status = "false"; hplcResponse.Message = "HbD is missing"; } else if (hplcData.barcodeNo == "") { hplcResponse.Status = "false"; hplcResponse.Message = "Barcode no is missing"; } else if (hplcData.userId <= 0) { hplcResponse.Status = "false"; hplcResponse.Message = "Invalid user Id"; } else { var msgs = _centralLabReceiptData.UpdateProcessedHPLCTestResult(hplcData); hplcResponse.Status = "true"; hplcResponse.Message = msgs.msg; } } catch (Exception e) { hplcResponse.Status = "false"; hplcResponse.Message = e.Message; } return(hplcResponse); }
public async Task <IActionResult> UpdateProcessedHPLCTestResult(UpdateProcessedResultRequest hplcData) { _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}"); _logger.LogDebug($"Request - Update processed HPLC test results for particular samples - {JsonConvert.SerializeObject(hplcData)}"); var rsResponse = await _centralLabService.UpdateProcessedHPLCTestResult(hplcData); _logger.LogInformation($" Update processed HPLC test results for particular samples {rsResponse}"); _logger.LogDebug($"Response - Update processed HPLC test results for particular samples - {JsonConvert.SerializeObject(rsResponse)}"); return(Ok(new AddHPLCResponse { Status = rsResponse.Status, Message = rsResponse.Message, })); }
public HPLCResultMsg UpdateProcessedHPLCTestResult(UpdateProcessedResultRequest hplcData) { try { var stProc = UpdateProcessedHPLCTestDetails; var pList = new List <SqlParameter>() { new SqlParameter("@HbF", Convert.ToDecimal(hplcData.HbF)), new SqlParameter("@HbA0", Convert.ToDecimal(hplcData.HbA0)), new SqlParameter("@HbA2", Convert.ToDecimal(hplcData.HbA2)), new SqlParameter("@HbS", Convert.ToDecimal(hplcData.HbS)), new SqlParameter("@HbD", Convert.ToDecimal(hplcData.HbD)), new SqlParameter("@BarcodeNo", hplcData.barcodeNo), new SqlParameter("@UserId", Convert.ToInt32(hplcData.userId)), }; var hplcResult = UtilityDL.FillEntity <HPLCResultMsg>(stProc, pList); return(hplcResult); } catch (Exception ex) { throw ex; } }