Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        //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);
        }