Ejemplo n.º 1
0
        private void AddNewOwner()
        {
            VehicleOwner     owner = new VehicleOwner(Vehicle);
            VehicleOwnerForm form  = new VehicleOwnerForm(Database);

            form.VehicleOwner = owner;

            if (form.ShowDialog() == DialogResult.OK)
            {
                bsOwnerList.Add(owner);
                MarkAsModified();
            }
        }
Ejemplo n.º 2
0
        private void EditCurrentOwner()
        {
            if (bsOwnerList.Current != null)
            {
                VehicleOwner owner     = (VehicleOwner)bsOwnerList.Current;
                VehicleOwner ownerCopy = new VehicleOwner(Vehicle, owner.Contractor, owner.DateFrom);

                VehicleOwnerForm form = new VehicleOwnerForm(Database);
                form.VehicleOwner = ownerCopy;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    owner.Contractor = ownerCopy.Contractor;
                    owner.DateFrom   = ownerCopy.DateFrom;

                    MarkAsModified();
                }
            }
        }