public async Task <ServiceResponse> UpdateRCHId(UpdateRCHIDRequest rData) { ServiceResponse sResponse = new ServiceResponse(); try { if (string.IsNullOrEmpty(rData.rchId)) { sResponse.Status = "false"; sResponse.Message = "RCHID is missing"; return(sResponse); } else if (string.IsNullOrEmpty(rData.revisedRCHID)) { sResponse.Status = "false"; sResponse.Message = "Revised RCHID is missing"; return(sResponse); } else if (rData.userId <= 0) { sResponse.Status = "false"; sResponse.Message = "Invalid UserId"; return(sResponse); } else { var result = _supportData.UpdateRCHId(rData); if (string.IsNullOrEmpty(result.msg)) { sResponse.Status = "false"; sResponse.Message = $"Unable to Update the Revised RCHID - {rData.revisedRCHID}"; return(sResponse); } else { if (result.revisedExistCheck == 1) { EmailRCHTrigger(result.rchUpdateCode, 1); } else { EmailRCHTrigger(result.rchUpdateCode, 0); } sResponse.Status = "true"; sResponse.Message = result.msg; return(sResponse); } } } catch (Exception e) { sResponse.Status = "false"; sResponse.Message = e.Message; return(sResponse); } }
public async Task <IActionResult> UpdateErrorRCHID(UpdateRCHIDRequest rData) { _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}"); _logger.LogDebug($"Updating the Error RCHID - {JsonConvert.SerializeObject(rData)}"); var subjectSample = await _supportService.UpdateRCHId(rData); return(Ok(new ServiceResponse { Status = subjectSample.Status, Message = subjectSample.Message, })); }
public UpdateRCHIDMsg UpdateRCHId(UpdateRCHIDRequest rData) { string stProc = UpdateRCHIdDetail; var pList = new List <SqlParameter>() { new SqlParameter("@OldRCHId", rData.rchId), new SqlParameter("@NewRCHId", rData.revisedRCHID), new SqlParameter("@UserId", rData.userId), }; var allData = UtilityDL.FillEntity <UpdateRCHIDMsg>(stProc, pList); return(allData); }