Beispiel #1
0
        public bool DeleteSupplierByID(int supplierID)
        {
            int  products_count;
            bool deleted = false;

            try
            {
                //here will check first if there is a products with the same supplier id to not make error in refrential integratiye constraint
                products_count = _repository.Check_Products_Count_With_SupplierID(supplierID);

                if (products_count == 0)
                {
                    deleted = _repository.DeleteByID(supplierID);
                }
                return(deleted);
            }catch (Exception ex)
            {
                //Log Exception Error
                ExceptionHandler.LogException(ex, "Supplier_Bussiness_Logic_Layer_Delete");

                throw new Exception("Business Logic :: Supplier Business :: Delete Function :: Error in Execution", ex);
            }
        }