示例#1
0
        private void ClearDataBase()
        {
            foreach (Tunnel tunnel in Tunnel.GetTunnels())
            {
                foreach (Cultivation cultivation in Cultivation.GetCultivationsInTunnel(tunnel.id))
                {
                    CultivationComment.DeleteFromBreeding(cultivation.id);
                    Cultivation.DeleteFromTunnel(cultivation.id);
                }

                foreach (AvrDevice avr_device in AvrDevice.GetAvrDevicesInTunnel(tunnel.id))
                {
                    Measurement.DeleteMeasurements();
                    AvrDevice.DeleteAvrDevice(avr_device.id);
                }

                Tunnel.DeleteTunnel(tunnel.id);
            }

            Plant.DeletePlants();
        }
示例#2
0
 public IActionResult Delete(int id)
 {
     Tunnel.DeleteTunnel(id);
     return(new NoContentResult());
 }