Esempio n. 1
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            this.detailRichTextBox.Text = "";
            result = ii.Find(getQuestionnaire());

            dataGridView.RowCount = result.Length;
            for (int i = 0; i < result.Length; i++)
            {
                dataGridView.Rows[i].Cells[0].Value = result[i].Hotel.name;
                dataGridView.Rows[i].Cells[1].Value = result[i].KU;
            }

            this.ageLabel.Text           = (DateTime.Now.Year - this.dateTimePicker.Value.Year).ToString();
            this.moneyLabel.Text         = int.Parse(this.moneyTextBox.Text).ToString();
            this.numberDaysLabel.Text    = int.Parse(this.numberDaysTextBox.Text).ToString();
            this.healthLabel.Text        = this.healthComboBox.Text.ToLower();
            this.insuranceLabel.Text     = this.insuranceCheckBox.Checked ? Values.InsuranceYes : Values.InsuranceNo;
            this.countryLabel.Text       = this.countryComboBox.Text;
            this.regionLabel.Text        = this.regionComboBox.Text;
            this.climateLabel.Text       = this.climateComboBox.Text.ToLower();
            this.locationLabel.Text      = this.locationComboBox.Text.ToLower();
            this.appointmentLabel.Text   = this.appointmentComboBox.Text.ToLower();
            this.serviceLevelLabel.Text  = this.serviceLevelComboBox.Text.ToLower();
            this.buildingLabel.Text      = this.buildingComboBox.Text.ToLower();
            this.nutritionLabel.Text     = this.nutritionComboBox.Text;
            this.roomServiceTextBox.Text = string.Join(", ",
                                                       roomService.FindAll(p => p.Checked).Select(x => x.Text.ToLower()).ToArray());
            this.hotelServiceTextBox.Text = string.Join(", ",
                                                        hotelService.FindAll(p => p.Checked).Select(x => x.Text.ToLower()).ToArray());
            this.childrenServiceTextBox.Text = string.Join(", ",
                                                           childrenService.FindAll(p => p.Checked).Select(x => x.Text.ToLower()).ToArray());

            this.multiPaneControl.SelectedPage = this.multiPanePage2;

            this.detailRichTextBox.Text = II.CurentII.GetSystemMessages();
            if (result.Length > 0)
            {
                this.dataGridView_CellEnter(this.dataGridView, new DataGridViewCellEventArgs(0, 0));
            }
            MessageBox.Show("Найдено " + result.Length.ToString() + " отель (-ля, -лей)", "Информация о результате",
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
        }