Пример #1
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);
            }
        }
Пример #2
0
        static public void openData()
        {
            string filename = "C:\\Users\\Angela\\Documents\\visual studio 2015\\Projects\\turfirm\\turfirm\\bin\\Debug\\Tours.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)
            {
                dataTours.Rows.Add(1);
                for (int j = 1; j <= dataTours.ColumnCount; j++)
                {
                    dataTours.Rows[i - 1].Cells[j - 1].Value = ExcelApp.Cells[i, j].Value;
                    if (dataTours.Rows[i - 1].Cells[j - 1].Value == null)
                    {
                        flag = 1;
                        dataTours.Rows.RemoveAt(i - 1);
                        break;
                    }
                }
                if (flag == 1)
                {
                    break;
                }
                ++i;
            }

            FoodCol      food = new FoodCol();
            TransportCol col  = new TransportCol();
            TourTypeCol  coll = new TourTypeCol();
            TourFactory  obj  = new TourFactory();
        }
Пример #3
0
        public FilterContr(FilterCol obj)
        {
            filtrationTours = new TourFiltr();

            allTours = TourFactory.getTours();
        }