Ejemplo n.º 1
0
        //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);
        }
Ejemplo n.º 2
0
        //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);
        }
Ejemplo n.º 3
0
        //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);
        }
Ejemplo n.º 4
0
        //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);
        }