public static bool DeleteSupplierBL(int deleteSupplierID) { bool supplierDeleted = false; try { if (deleteSupplierID > 0) { SupplierDAL supplierDAL = new SupplierDAL(); supplierDeleted = supplierDAL.DeleteSupplierDAL(deleteSupplierID); } else { throw new InventoryException("Invalid Supplier ID"); } } catch (InventoryException) { throw; } catch (Exception ex) { throw ex; } return(supplierDeleted); }
public static bool DeleteSupplierBL(string deleteSupplierID) { bool SupplierDeleted = false; try { if (deleteSupplierID == null) { SupplierDAL supplierDAL = new SupplierDAL(); SupplierDeleted = supplierDAL.DeleteSupplierDAL(int.Parse(deleteSupplierID)); } else { throw new Exception("Invalid supplier ID"); } } catch (Exception) { throw; } catch (Exception ex) { throw ex; } return(SupplierDeleted); }
//creating a method to delete the existing valid suppliers public bool DeleteSupplierBL(string deleteSupplierID) { bool supplierDeleted = false; try { if (deleteSupplierID == string.Empty) { SupplierDAL supplierDAL = new SupplierDAL(); supplierDeleted = supplierDAL.DeleteSupplierDAL(deleteSupplierID); } else { throw new InventoryException("Invalid Supplier ID"); } } catch (Exception ex) { throw new InventoryException(ex.Message); } return(supplierDeleted); }