public static async void LoadMunisInfoByDevice(Device device, ExtendedForm parentForm) { try { parentForm.Waiting(); DataTable reqLinesTable = new DataTable(); DataTable reqHeaderTable = new DataTable(); DataTable inventoryTable = new DataTable(); if (device.PO == "" || device.PO == null) { device.PO = await GetPOFromDevice(device); } if (device.PO != string.Empty) { inventoryTable = await LoadMunisInventoryGrid(device); reqLinesTable = await GetReqLineItemsFromReqNum(await GetReqNumberFromPOAsync(device.PO), GetFYFromPO(device.PO)); reqHeaderTable = await GetReqHeaderFromReqNum(await GetReqNumberFromPOAsync(device.PO), GetFYFromPO(device.PO)); } else { inventoryTable = await LoadMunisInventoryGrid(device); reqLinesTable = null; reqHeaderTable = null; } if (inventoryTable != null || reqLinesTable != null) { GridForm newGridForm = new GridForm(parentForm, "MUNIS Info"); if (inventoryTable == null) { OtherFunctions.Message("Munis Fixed Asset info. not found.", MessageBoxButtons.OK, MessageBoxIcon.Information, "No FA Record"); } else { newGridForm.AddGrid("InvGrid", "FA Info:", inventoryTable); } if (reqLinesTable == null) { OtherFunctions.Message("Could not resolve PO from Asset Tag or Serial. Please add a valid PO if possible.", MessageBoxButtons.OK, MessageBoxIcon.Information, "No Req. Record"); } else { newGridForm.AddGrid("ReqHeadGrid", "Requisition Header:", reqHeaderTable); newGridForm.AddGrid("ReqLineGrid", "Requisition Line Items:", reqLinesTable); } if (newGridForm.GridCount > 0) { newGridForm.Show(); } else { newGridForm.Dispose(); } } else if (inventoryTable == null && reqLinesTable == null) { OtherFunctions.Message("Could not resolve any purchase or Fixed Asset info.", MessageBoxButtons.OK, MessageBoxIcon.Information, "Nothing Found"); } } catch (Exception ex) { ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod()); } finally { parentForm.DoneWaiting(); } }