public async Task <AddHPLCResponse> UpdateHPLCTestResult(UpdateStagingRequest 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.testId <= 0) { hplcResponse.Status = "false"; hplcResponse.Message = "Invalid tested Id"; } else if (hplcData.userId <= 0) { hplcResponse.Status = "false"; hplcResponse.Message = "Invalid user Id"; } else { var msgs = _centralLabReceiptData.UpdateHPLCTestResult(hplcData); hplcResponse.Status = "true"; hplcResponse.Message = msgs.msg; } } catch (Exception e) { hplcResponse.Status = "false"; hplcResponse.Message = e.Message; } return(hplcResponse); }
public async Task <IActionResult> UpdateHPLCTestResult(UpdateStagingRequest hplcData) { _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}"); _logger.LogDebug($"Request - Update HPLC test for particular samples - {JsonConvert.SerializeObject(hplcData)}"); var rsResponse = await _centralLabService.UpdateHPLCTestResult(hplcData); _logger.LogInformation($" Update HPLC test for particular samples {rsResponse}"); _logger.LogDebug($"Response - Update HPLC test for particular samples - {JsonConvert.SerializeObject(rsResponse)}"); return(Ok(new AddHPLCResponse { Status = rsResponse.Status, Message = rsResponse.Message, })); }
public HPLCResultMsg UpdateHPLCTestResult(UpdateStagingRequest hplcData) { try { var stProc = UpdateStagingHPLCTestDetails; 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("@HPLCTestId", hplcData.testId), new SqlParameter("@UserId", Convert.ToInt32(hplcData.userId)), }; var hplcResult = UtilityDL.FillEntity <HPLCResultMsg>(stProc, pList); return(hplcResult); } catch (Exception ex) { throw ex; } }