示例#1
0
        public tourPurchase(int routeId, routeChoice routesWindow, int clientId)
        {
            InitializeComponent();

            //datepicker.SelectedDate = DateTime.Now;

            this.routesWindow = routesWindow;
            this.routeId = routeId;
            this.clientId = clientId;

            SQLite connection = new SQLite();
            var reader = connection.ReadData(string.Format("SELECT Surname, Name, Secname FROM Clients WHERE ID ='{0}'", clientId));
            while (reader.Read())
            {
                personName.Content = string.Format("Продажа тура клиенту: {0} {1} {2}", reader.GetString(0), reader.GetString(1), reader.GetString(2));
            }

            reader = connection.ReadData(string.Format("SELECT Climat, Country, Hotel, Duration, Cost FROM Scopes WHERE ID = '{0}'", routeId));
            while (reader.Read())
            {
                Route route = new Route(
                    routeId,
                    reader.GetString(0),
                    reader.GetString(1),
                    reader.GetString(2),
                    reader.GetInt32(3),
                    reader.GetFloat(4));
                routesList.Items.Add(route);

            }
            connection.Close();
        }
示例#2
0
        /* класс маршрут */
        //private class Route
        //{
        //    public int Id { get; set; }
        //    public string Climate { get; set; }
        //    public string Country { get; set; }
        //    public string Hotel { get; set; }
        //    public int Duration { get; set; }
        //    public float Cost { get; set; }

        //    public Route(int id, string climate, string country, string hotel, int duration, float cost)
        //    {
        //        Id = id;
        //        Climate = climate;
        //        Country = country;
        //        Hotel = hotel;
        //        Duration = duration;
        //        Cost = cost;
        //    }
        //}

        /* инициализация */
        public routeChoice(int clientId, string clientName, Clients clientsWindow)
        {
            InitializeComponent();

            this.clientsWindow = clientsWindow;
            routesWindow = this;
            this.clientId = clientId;
            this.clientName = clientName;

            personName.Content += clientName;
            updateClimateList();
            updateCountryList();
            updateHotelList();
        }
示例#3
0
        /* выбрать клиента и перейти на форму выбора маршрута */
        private void clientsList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (clientsList.SelectedItem != null)
            {
                var client = clientsList.SelectedItem as Client;
                var clientId = client.Id;
                var clientName = client.Surname + " " + client.Name + " " + client.Secname;

                var editClientForm = new routeChoice(clientId, clientName, clientsWindow);
                editClientForm.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("Клиент не выбран!", "Предупреждение", MessageBoxButton.OK);
            }
        }