/// <summary> /// DeleteDirect /// </summary> /// <param name="assetId">assetId</param> /// <param name="companyId">companyId</param> public bool DeleteDirect(int assetId, int companyId) { // Delete laterals // ... Define initial models AssetSewerLateral assetSewerLateral = new AssetSewerLateral(null); // ... Load laterals AssetSewerLateralGateway assetSewerLateralGateway = new AssetSewerLateralGateway(); assetSewerLateralGateway.LoadBySectionId(assetId, companyId); // ... Delete laterals foreach (AssetsTDS.AM_ASSET_SEWER_LATERALRow rowLateral in (AssetsTDS.AM_ASSET_SEWER_LATERALDataTable)assetSewerLateralGateway.Table) { assetSewerLateral.DeleteDirect(rowLateral.AssetID, companyId); } // Delete section AssetSewerSectionGateway assetSewerSectionGateway = new AssetSewerSectionGateway(null); assetSewerSectionGateway.Delete(assetId, companyId); AssetSewer assetSewer = new AssetSewer(null); assetSewer.DeleteDirect(assetId, companyId); Asset asset = new Asset(null); asset.DeleteDirect(assetId, companyId); return true; }