public async Task UpdateFbo(int productId, int addressId, SimsFboTypes fboTypes) { if (productId == 0) { throw new SimsItemMissing("Missing id"); } var product = await dbHost.Incidents.Products.Get(productId); if (!await dbHost.Incidents.IsClosed(product.HostId)) { await dbHost.Incidents.Products.Fbos.Update(productId, addressId, (int)fboTypes); } else { throw new SimsIncidentClosedException("Incident closed"); } }
public async Task AssignFbo(int productId, int addressId, SimsFboTypes types) { if (productId == 0) { throw new SimsItemMissing("Prouct Id missing"); } if (addressId == 0) { throw new SimsItemMissing("address Id missing"); } if (!await dbHost.Signals.IsClosed(productId)) { await dbHost.Signals.Products.Fbos.Add(productId, addressId, (int)types); } else { throw new SimsIncidentClosedException("Signal closed"); } }