Пример #1
0
        private void FormEditing_Load(object sender, EventArgs e)
        {
            this.customers             = Customer.GetAllCustomer(this.connection);
            this.vehicles              = Vehicle.GetAllVehicles(this.connection);
            this.locations             = LocationCar.GetAllLocation(this.connection);
            this.groupBoxHeader.Paint += PaintBorderlessGroupBox;
            switch (this.preselect)
            {
            case 0:
                this.tabControlBaseData.SelectedTab = tabPageCustomer;
                break;

            case 1:
                this.tabControlBaseData.SelectedTab = tabPageCustomer;
                FillListViewCustomer();
                ClearCustomer();
                break;

            case 2:
                this.tabControlBaseData.SelectedTab = tabPageVehicle;
                break;

            case 3:
                this.tabControlBaseData.SelectedTab = tabPageLocation;
                break;
            }

            this.pictureBoxVehicleImage.AllowDrop = true;
        }
Пример #2
0
        private void listViewLocation_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem item = this.listViewLocation.GetItemAt(e.X, e.Y);

            this.location  = null;
            this.location  = (LocationCar)item.Tag;
            this.editLocat = true;
            FillLocation();
        }
Пример #3
0
 private void toolStripMenuItemLocationEdit_Click(object sender, EventArgs e)
 {
     if (this.locationclick != null)
     {
         this.location = this.locationclick;
         FillLocation();
         this.locationclick = null;
         this.editLocat     = true;
     }
 }
Пример #4
0
 private void MenuItemLocationDelete_Click(object sender, EventArgs e)
 {
     if (this.locationclick != null)
     {
         this.locationclick.Delete();
         this.locations = LocationCar.GetAllLocation(this.connection);
         FillListViewLocation();
         this.locationclick = null;
     }
 }
Пример #5
0
        private void ClearLocation()
        {
            this.location  = new LocationCar(this.connection);
            this.editLocat = false;
            this.textBoxLocationName.Text     = string.Empty;
            this.textBoxLocationStreet.Text   = string.Empty;
            this.textBoxLocationHouseNr.Text  = string.Empty;
            this.textBoxLocationPostcode.Text = string.Empty;
            this.textBoxLocationCity.Text     = string.Empty;
            this.editLocat = false;

            this.groupBoxLocation.Text       = "Neuen Standort anlegen";
            this.labelLocationStatus.Visible = false;
        }
Пример #6
0
        private void FormRent_Load(object sender, EventArgs e)
        {
            this.groupBoxHeader.Paint += PaintBorderlessGroupBox;
            this.customers             = Customer.GetAllCustomer(this.connection);
            this.vehicles              = Vehicle.GetAvailableVehicles(this.connection, this.dateTimePickerBegin.Value);
            this.locations             = LocationCar.GetAllLocation(this.connection);

            ClearVehicle();
            ClearCustomer();

            this.comboBoxVehicleLocation.DataSource    = this.locations;
            this.comboBoxVehicleLocation.DisplayMember = "Name";
            this.comboBoxVehicleLocation.ValueMember   = "LocationId";

            if (this.editRent)
            {
                this.vehicle  = Vehicle.GetSpecificVehicles(this.connection, (int)this.rent.CarId);
                this.customer = Customer.GetSpecificCustomer(this.connection, (int)this.rent.CustomerId);
                this.vehicles.Add(vehicle);
                FillCustomer();
                FillVehicle();

                if (this.rent.Begin.HasValue)
                {
                    this.dateTimePickerBegin.Value = this.rent.Begin.Value;
                }
                if (this.rent.End.HasValue)
                {
                    this.dateTimePickerEnd.Value   = this.rent.End.Value;
                    this.dateTimePickerEnd.Checked = true;
                }
                this.listViewCustomer.Enabled = false;
                if (this.rent.Begin.Value < DateTime.Now)
                {
                    this.listViewVehicle.Enabled = false;
                }
            }
            FillListViewCustomer();
            FillListViewVehicle();
        }
Пример #7
0
        private void listViewLocation_MouseClick(object sender, MouseEventArgs e)
        {
            ListViewItem item = this.listViewLocation.GetItemAt(e.X, e.Y);

            this.locationclick = (LocationCar)item.Tag;
        }