private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { DataGridView senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { Budget item = senderGrid.Rows[e.RowIndex].Tag as Budget; if (senderGrid.Columns[e.ColumnIndex].Name == "Edit") { EditItem(item); } else if (senderGrid.Columns[e.ColumnIndex].Name == "Remove") { RemoveItem(item); } else if (senderGrid.Columns[e.ColumnIndex].Name == "Pdf") { string path = DirectoriesController.GetPatientDocumentsFolder(item.Patient) + @"\" + item.PdfFile(); BudgetToPDF budgetToPdf = new BudgetToPDF(path, item); if (budgetToPdf.CreatePdf()) { System.Diagnostics.Process.Start(path); } else { BasicMessagesHandler.ShowInformationMessage("Pri vytváraní PDF súboru sa vyskytla chyba"); } } } }
private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { DataGridView senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { Patient item = senderGrid.Rows[e.RowIndex].Tag as Patient; if (senderGrid.Columns[e.ColumnIndex].Name == "Edit") { EditItem(item); } else if (senderGrid.Columns[e.ColumnIndex].Name == "Remove") { RemoveItem(item); } else if (senderGrid.Columns[e.ColumnIndex].Name == "PdfExport") { string path = DirectoriesController.GetPatientDocumentsFolder(item) + @"\" + item.FullName + "_EZKO.pdf"; EhrToPDF ehrToPdf = new EhrToPDF(path, item, GlobalSettings.User, ezkoController); if (ehrToPdf.CreatePdf()) { System.Diagnostics.Process.Start(path); } else { BasicMessagesHandler.ShowInformationMessage("Pri vytváraní PDF dokumentácie sa vyskytla chyba"); } } } }