//Deleting Distributor Address public static bool DeleteDistributorAddressBL(int deleteDistributorAddressID) { bool distributorAddressDeleted = false; try { if (deleteDistributorAddressID > 0) { DistributorAddressDAL distributorAddressDAL = new DistributorAddressDAL(); distributorAddressDeleted = distributorAddressDAL.DeleteDistributorAddressDAL(deleteDistributorAddressID); } else { throw new InventoryException("Invalid Distributor ID"); } } catch (InventoryException) { throw; } catch (Exception ex) { throw ex; } return(distributorAddressDeleted); }
//Returning complete list of distributor address public static List <DistributorAddress> GetAllDistributorAddressBL() { List <DistributorAddress> distributorAddressList = null; try { DistributorAddressDAL distributorAddressDAL = new DistributorAddressDAL(); distributorAddressList = distributorAddressDAL.GetAllDistributorAddressDAL(); } catch (InventoryException ex) { throw ex; } catch (Exception ex) { throw ex; } return(distributorAddressList); }
//Searching Distributor Address by distributor ID public static DistributorAddress SearchDistributorAddressBL(int searchDistributorAddressID) { DistributorAddress searchDistributorAddress = null; try { DistributorAddressDAL distributorAddressDAL = new DistributorAddressDAL(); searchDistributorAddress = distributorAddressDAL.SearchDistributorAddressDAL(searchDistributorAddressID); } catch (InventoryException ex) { throw ex; } catch (Exception ex) { throw ex; } return(searchDistributorAddress); }
//Validating & Adding Distributor Address public static bool AddDistributorAddressBL(DistributorAddress newdistributorAddress) { bool distributorAddressAdded = false; try { if (ValidateDistributorAddress(newdistributorAddress)) { DistributorAddressDAL distributorAddressDAL = new DistributorAddressDAL(); distributorAddressAdded = distributorAddressDAL.AddDistributorAddressDAL(newdistributorAddress); } } catch (InventoryException) { throw; } catch (Exception ex) { throw ex; } return(distributorAddressAdded); }