Exemplo n.º 1
0
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (lstVeReservation.SelectedItems.Count > 0)
     {
         for (int i = 0; i < ReservationList.Count; i++)
         {
             if (ReservationList[i].ReservationId ==
                 int.Parse(formControle.ListViewSelectedItemToString(lstVeReservation)[0]))
             {
                 formMain.MadeChanges = true;
                 ReservationList.RemoveAt(i);
             }
         }
         FillListView();
     }
 }
Exemplo n.º 2
0
        private void lstVeCar_SelectedIndexChanged(object sender, EventArgs e)
        {
            string[] temp;
            lstVeDeals.Items.Clear();

            if (lstVeCar.SelectedItems.Count > 0)
            {
                temp = formControle.ListViewSelectedItemToString(lstVeCar);
                foreach (Deal deal in DealList)
                {
                    if (deal.CarID == int.Parse(temp[0]))
                    {
                        formControle.Add1VehicleListBoxToForm2 <Deal>(deal, lstVeDeals);
                    }
                }
            }
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (lstVeCar.SelectedItems.Count > 0)
     {
         if (formControle.CheckTextBox() && formControle.CheckIFBeforeAndSameDate(dtpFrom.Value, dtpTo.Value))
         {
             string[] s  = formControle.ListViewSelectedItemToString(lstVeCar);
             Deal     de = new Deal(int.Parse(s[0]), dtpFrom.Value, dtpTo.Value,
                                    double.Parse(txtPricePerDay.Text));
             if (formControle.DateCheck1(de, DealList, dtpFrom.Value, dtpTo.Value, lblFrom, lblTo))
             {
                 DealList.Add(de);
                 formControle.AddDataToListBox(DealList, lstVeDeals);
                 formMain.MadeChanges = true;
             }
         }
     }
     else
     {
         MessageBox.Show("Vehicle not selected");
     }
 }
Exemplo n.º 4
0
        private void LstVeCustomer_SelectedIndexChanged(object sender, EventArgs e)
        {
            int id = 0;
            List <Reservation> temp = new List <Reservation>();

            if (LstVeCustomer.SelectedItems.Count > 0)
            {
                id = int.Parse(formControle.ListViewSelectedItemToString(LstVeCustomer)[0]);
                foreach (Reservation item in ReservationList)
                {
                    if (item.CustomerID == id)
                    {
                        temp.Add(item);
                    }
                }
            }
            formControle.AddDataToListBox <Reservation>(temp, lstVeReservation);
        }