Beispiel #1
0
 private void AddClient_Load(object sender, EventArgs e)
 {
     textBox1.Text = (ClientFactory.count() + 1).ToString();
     for (int i = 0; i < ClientTypeCol.count(); i++)
     {
         comboBox1.Items.Add(ClientTypeCol.coll_of_type[i].Type);
     }
 }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        static public void openData()
        {
            string filename = "C:\\Users\\Angela\\Documents\\Visual Studio 2015\\Projects\\turfirm\\turfirm\\bin\\Debug\\Clients.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)
            {
                dataClients.Rows.Add(1);
                for (int j = 1; j <= dataClients.ColumnCount; j++)
                {
                    dataClients.Rows[i - 1].Cells[j - 1].Value = ExcelApp.Cells[i, j].Value;
                    if (dataClients.Rows[i - 1].Cells[0].Value == null)
                    {
                        flag = 1;
                        dataClients.Rows.RemoveAt(i - 1);
                        break;
                    }
                }
                if (flag == 1)
                {
                    break;
                }
                ++i;
            }
            ClientTypeCol col = new ClientTypeCol();
            ClientFactory obj = new ClientFactory();
        }