Ejemplo n.º 1
0
        public static bool DeleteDiscountBL(int deleteRetailerID, int deleteOrderID)
        {
            bool discountDeleted = false;

            try
            {
                if ((deleteOrderID > 0) && (deleteRetailerID > 0))
                {
                    Discount_DAL discountDAL = new Discount_DAL();
                    discountDeleted = discountDAL.DeleteDiscountDAL(deleteRetailerID, deleteOrderID);
                }
                else
                {
                    throw new GOException("Invalid Order ID and Retailer ID");
                }
            }
            catch (GOException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(discountDeleted);
        }
Ejemplo n.º 2
0
        public static List <Discount_Entities> GetAllDiscountBL()
        {
            List <Discount_Entities> discountList = null;

            try
            {
                Discount_DAL discountDAL = new Discount_DAL();
                discountList = discountDAL.GetAllDiscountDAL();
            }
            catch (GOException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(discountList);
        }
Ejemplo n.º 3
0
        public static Discount_Entities SearchDiscountBL(int searchRetailerID, int searchOrderID)
        {
            Discount_Entities searchDiscount = null;

            try
            {
                Discount_DAL discountDAL = new Discount_DAL();
                searchDiscount = discountDAL.SearchDiscountDAL(searchRetailerID, searchOrderID);
            }
            catch (GOException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(searchDiscount);
        }
Ejemplo n.º 4
0
        public static bool UpdateDiscountBL(Discount_Entities updateDiscount)
        {
            bool discountUpdated = false;

            try
            {
                if (ValidateDiscount(updateDiscount))
                {
                    Discount_DAL discountDAL = new Discount_DAL();
                    discountUpdated = discountDAL.UpdatedDiscountDAL(updateDiscount);
                }
            }
            catch (GOException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(discountUpdated);
        }
Ejemplo n.º 5
0
        public static bool AddDiscountBL(Discount_Entities newDiscount)
        {
            bool DiscountAdded = false;

            try
            {
                if (ValidateDiscount(newDiscount))
                {
                    Discount_DAL discountDAL = new Discount_DAL();
                    DiscountAdded = discountDAL.AddDiscountDAL(newDiscount);
                }
            }
            catch (GOException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(DiscountAdded);
        }