public void ReadExcelIntoObjects(string fileName, string productNum) { AllProducts.Clear(); ExcelPackage.LicenseContext = LicenseContext.NonCommercial; using (var package = new ExcelPackage(new FileInfo(fileName))) { var firstSheet = package.Workbook.Worksheets["Configured Options"]; int row = 1, j = 1; for (row = 2; row < firstSheet.Dimension.Rows; row++) { ExcelProduct ep = new ExcelProduct(); ep.ProductName = firstSheet.Cells[row, 1].Text; ep.ProductNumber = firstSheet.Cells[row, 2].Text; ep.FeatureName = firstSheet.Cells[row, 3].Text; ep.FeatureRequired = firstSheet.Cells[row, 4].Text; ep.FeatureCSROnly = firstSheet.Cells[row, 5].Text; ep.OptionGroupName = firstSheet.Cells[row, 6].Text; ep.OptionGroupRequired = firstSheet.Cells[row, 7].Text; ep.OptionGroupCSRonly = firstSheet.Cells[row, 8].Text; ep.SubOptionGroupName = firstSheet.Cells[row, 9].Text; ep.SubOptionGroupRequired = firstSheet.Cells[row, 10].Text; ep.OptionName = firstSheet.Cells[row, 11].Text; ep.OptionCode = firstSheet.Cells[row, 12].Text; ep.HCPCS = firstSheet.Cells[row, 13].Text; ep.OptionRequired = firstSheet.Cells[row, 14].Text; ep.OptionCSROnly = firstSheet.Cells[row, 15].Text; ep.WorkTicketInput = firstSheet.Cells[row, 16].Text; AllProducts.Add(ep); } } }
private void MakeAllProducts() { AllProducts.Clear(); foreach (string product in product.ReturnAllProducts()) { AllProducts.Text += product; } }
public virtual int Fill(AllProducts.ProductsDataTable dataTable) { this.Adapter.SelectCommand = this.CommandCollection[0]; if ((this.ClearBeforeFill == true)) { dataTable.Clear(); } int returnValue = this.Adapter.Fill(dataTable); return returnValue; }