Beispiel #1
0
        //ano
        private void button1_Click(object sender, EventArgs e)
        {
            AutomobilModelHandler.ExportToXml(idA.ToString(), idA);
            PojistovnaForm FormPoj = new PojistovnaForm();

            this.Hide();
            FormPoj.ShowDialog();
            this.Close();
        }
Beispiel #2
0
        //hledej
        public void button1_Click(object sender, EventArgs e)
        {
            //SqlConnection connection = DBConnector.GetInstance().GetConnection();
            // znacka = (string)automobil2. [comboBox1.SelectedIndex]["znacka"];
            znacka = comboBox1.SelectedItem.ToString();
            model  = comboBox2.SelectedItem.ToString();
            DateTime od  = dateTimePicker1.Value;
            DateTime doo = dateTimePicker2.Value;

            //model = (string)automobil.Rows[comboBox2.SelectedIndex]["model"];

            MessageBox.Show(model + "  " + znacka);

            //SelectAutomobil = AutomobilModelHandler.SelectByZnackaModel(znacka, model);

            VybraneAuto = AutomobilModelHandler.Detail(znacka, model);



            if (od > doo)
            {
                Uspech = false;
                MessageBox.Show("Datum je špatně vyplněno");
            }
            objednavky = ObjednavkaModelHandler.Select();
            foreach (var row in objednavky)
            {
                if (row.Automobil_idA == VybraneId && row.datum_vypujceni <= od && doo <= row.datum_vraceni)
                {
                    Uspech = false;
                    MessageBox.Show("V danem Termínu nejde vypůjči automobil");
                }
            }

            if (VybraneAuto.Zpusobily_jizdy == 0)
            {
                MessageBox.Show("Auto není provozu schopne, posílám zprávu automechanikovi");
                Dotaz3Form dot3 = new Dotaz3Form(VybraneAuto.Ida, od, doo);
                dot3.idA = VybraneId;
                this.Hide();
                dot3.ShowDialog();
                this.Close();
            }



            if (Uspech)
            {
                MessageBox.Show("Automobil je dostupny" + VybraneId.ToString() + od.ToString());
                DotazPojisteniForm dot2 = new DotazPojisteniForm(VybraneId, od, doo);
                this.Hide();
                dot2.ShowDialog();
                this.Close();
            }
        }
Beispiel #3
0
        private void Dotaz3Form_load(int a, DateTime od, DateTime doo)
        {
            idA  = a;
            od1  = od;
            doo1 = doo;
            dateTimePicker1.Value = od;
            dateTimePicker2.Value = doo;
            automobils            = AutomobilModelHandler.SelectByID(idA);

            foreach (var row in automobils)
            {
                textBox1.Text = row.Ida.ToString();
                textBox2.Text = row.Znacka;
                textBox3.Text = row.Model;
            }
        }
Beispiel #4
0
        private void NováVýpůjčkaForm_load()
        {
            dateTimePicker1.Format       = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "dd/MM/yyyy";
            dateTimePicker2.Format       = DateTimePickerFormat.Custom;
            dateTimePicker2.CustomFormat = "dd/MM/yyyy";

            automobils = AutomobilModelHandler.Select();

            foreach (var row in automobils)
            {
                if (!comboBox1.Items.Contains(row.Znacka))
                {
                    comboBox1.Items.Add(row.Znacka);
                }
            }
            comboBox1.SelectedIndex = 0;
        }