private void AddManager_Load(object sender, EventArgs e) { textBox1.Text = (ManagerFactory.count() + 1).ToString(); for (int i = 0; i < ManagerTypeCol.count(); i++) { comboBox1.Items.Add(ManagerTypeCol.collection[i].Type); } }
private void AddOrder_Load(object sender, EventArgs e) { textBox1.Text = (OrderFactory.count() + 1).ToString(); for (int i = 0; i < ManagerTypeCol.count(); i++) { comboBox1.Items.Add(ManagerTypeCol.collection[i].Type); } for (int i = 0; i < ClientTypeCol.count(); i++) { comboBox2.Items.Add(ClientTypeCol.coll_of_type[i].Type); } for (int i = 0; i < TourFactory.count(); i++) { comboBox3.Items.Add(TourFactory.array_Tours[i]._name.Name); } }
static public void openData() { string filename = "C:\\Users\\Angela\\Documents\\visual studio 2015\\Projects\\turfirm\\turfirm\\bin\\Debug\\Managers.xlsx"; Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel._Workbook ExcelWorkBook; Microsoft.Office.Interop.Excel.Worksheet ExcelWorkSheet; ExcelWorkBook = ExcelApp.Workbooks.Open(filename, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); ExcelWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)ExcelWorkBook.Worksheets.get_Item(1); int i = 1; int flag = 0; while (true) { dataManagers.Rows.Add(1); for (int j = 1; j <= dataManagers.ColumnCount; j++) { dataManagers.Rows[i - 1].Cells[j - 1].Value = ExcelApp.Cells[i, j].Value; if (dataManagers.Rows[i - 1].Cells[0].Value == null) { flag = 1; dataManagers.Rows.RemoveAt(i - 1); break; } } if (flag == 1) { break; } ++i; } ManagerTypeCol coll = new ManagerTypeCol(); ManagerFactory obj = new ManagerFactory(); }