예제 #1
0
        /// <summary>
        /// Deletes the <seealso cref="Vehicle"/> that the
        /// <seealso cref="Admin"/> has selected.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void deleteButton_Click(object sender, EventArgs e)
        {
            Vehicle v = RentalControl.SelectedVehicle;

            VehicleControl.RemoveVehicle(v);
            UpdateList();
            carInfoPanel.Visible = false;
            searchPanel.Visible  = true;
        }
예제 #2
0
        public void RemoveVehicleTest()
        {
            Vehicle v = new Vehicle();

            DBController.Save(v, DBObject.SaveTypes.Insert);
            VehicleControl.RemoveVehicle(v);
            Vehicle v2 = DBController.GetByPrimaryKey <Vehicle>(v.PrimaryKey);

            Assert.IsNull(v2);
        }