private void btnCopyPreviousGenus_Click(object sender, RibbonControlEventArgs e) { int index = Globals.ThisAddIn.currentBatch.Index; if (index > 0) { Taxon previousTaxon = Globals.ThisAddIn.currentBatch.GetByIndex(index - 1); Control taxonPanel = Globals.ThisAddIn.myTaxonPanel.Controls[1].Controls[0]; taxonPanel.Controls["textboxGenus"].Text = previousTaxon.Genus; Globals.ThisAddIn.UpdateTrackingNumber(); } }
private static void CreateData(ExcelWorksheet ws, ref int rowIndex) { for (int i = 0; i < Globals.ThisAddIn.currentBatch.Count; i++) { Taxon t = Globals.ThisAddIn.currentBatch.GetByIndex(i); for (int j = 1; j <= CollectionData.columnIndex.Keys.Max(); j++) { string prop = CollectionData.columnIndex[j].PropertyName; if (!string.IsNullOrEmpty(prop)) { object propertyVal = GetPropValue(t, CollectionData.columnIndex[j].PropertyName); if (!(CollectionData.columnIndex[j].NullableZero && (Convert.ToInt32(propertyVal) == 0))) { var cell = ws.Cells[rowIndex + i, j]; cell.Value = propertyVal; cell.Style.WrapText = true; } } } ws.Row(rowIndex + i).Height = 50; } }