public async void UpdatePOObjectForVendor(POIntertekOutput poobject, MMSSubVendorEvent vendor) { try { poobject.VendorName = vendor.VendName; } catch (Exception ex) { _logger.LogError(ex, "UpdatePOObjectForVendor - Failed Updating IntertekPO: {Reason}", ex.Message); } }
public async void UpdatePOObjectForVendor(POAPLLOutput poobject, MMSSubVendorEvent vendor) { try { poobject.VendName = vendor.VendName; //poobject.ActivityCode = "U"; } catch (Exception ex) { _logger.LogError(ex, "UpdatePOObjectForVendor - Failed Updating APLPO: {Reason}", ex.Message); } }
public async Task <ApiResult <string> > UpsertPOAPLVendor(MMSSubVendorEvent model) { try { string vendcode = model.VendCode; _logger.LogInformation("Using {VendCode} as po vendorcode for lookup.", vendcode); _logger.LogDebug("Fetching POs for VendorCode for {VendCode}", vendcode); var pos = await _GetPOSkuLines.GetPOsForVendorFromDB(vendcode); if (pos != null && pos.Count > 0) { //update for the POs w.r.t vendorcode _logger.LogDebug("Going to update data for POS for VendCode in elastic", vendcode); //update data in elastic for the POs returned pos.ForEach(async x => { //check if the PO exists var existingPO = await GetExistingPO(x.PONumber.ToString()); if (existingPO != null && existingPO.POAPL != null)//check to see if the PO is on elastic/DB, if not skip { //if (existingPO.POAPL.CheckPoStatus()) //{ _POProductMapper.UpdatePOObjectForVendor(existingPO.POAPL, model); var response = await _getDataService.UpdateItem <POAPLLOutput>(existingPO.POAPL, _poIndex); //} } }); _logger.LogDebug("Updated data for POs for VendorCode -{vendcode} in elastic", vendcode); } else { _logger.LogDebug("No POs found for VendorCode - {vendcode}. PO APLLVendor Data not updated in elastic.", vendcode); } return(new ApiResult <string>()); } catch (Exception ex) { _logger.LogError(ex, "UpsertPOAPLVendor-Failed Updating APLPO: {Reason}", ex.Message); return(new ApiResult <string>(new[] { ex.Message })); } }