private void ProcessChosenItem() { if (dgItemInfo.SelectedItem != null) { switch (ItemType) { case MultipleItemType.BOMFiles: MULTIPLEBOM item = (MULTIPLEBOM)dgItemInfo.SelectedItem; if (!item.FilePath.Contains(frmBoardFileManager.ELECROOTDIR)) { item.FilePath = frmBoardFileManager.ELECROOTDIR + item.FilePath; } sVars.SelectedBOMFile = item; DialogResult = true; break; default: case MultipleItemType.RP: sVars.SelectedRPNumber = (DGVMULTIPLERP)dgItemInfo.SelectedItem; DialogResult = true; break; } this.Close(); } }
private void LoadBOMView() { try { var pairs = BOMFiles.Zip(Notes, (file, note) => file + "," + note); foreach (var pair in pairs) { var info = pair.Split(','); MULTIPLEBOM bominfo = new MULTIPLEBOM { Filename = info[0].Split('\\').Last(), Notes = info[1], FilePath = info[0] }; dgItemInfo.Items.Add(bominfo); } } catch (ArgumentException ae) { csExceptionLogger.csExceptionLogger.Write("loadBOMView_MissingParameters", ae); MessageBox.Show($"Can't have empty data fields!{(BOMFiles==null?"\n\t•"+nameof(BOMFiles):"")}{(Notes==null?"\n\t•"+nameof(Notes):"")}", "loadBOMView() - Empty Fields", MessageBoxButton.OK, MessageBoxImage.Warning); } catch (Exception ex) { MessageBox.Show("There was an issue loading the BOM File list information.\nError Message: " + ex.Message, "loadBOMView()", MessageBoxButton.OK, MessageBoxImage.Error); } }