Пример #1
0
 public CustomerProductBO()
 {
     customerproductDAL = new CustomerProductDAL();
 }
Пример #2
0
        public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
        {
            Type    controllerType = Type.GetType(string.Concat(_controllerNamespace, ".", controllerName, "Controller"));
            dynamic service        = new CustomerProductDAL();

            switch (controllerName)
            {
            case "CustomerProducts":
            {
                service = new CustomerProductDAL();
                break;
            }

            case "Orders":
            {
                service = new OrderDAL();
                break;
            }

            case "Home":
            {
                service = new DashBoardDAL();
                break;
            }

            case "Categories":
            {
                service = new CategoryDAL();
                break;
            }

            case "Products":
            {
                service = new ProductDAL();
                break;
            }

            case "BulkBuys":
            {
                service = new BulkBuyDAL();
                break;
            }

            case "Buyers":
            {
                service = new BuyerDAL();
                break;
            }

            case "Sellers":
            {
                service = new SellerDAL();
                break;
            }

            case "Borrowers":
            {
                service = new BorrowerDAL();
                break;
            }

            case "ProductTypes":
            {
                service = new ProductTypeDAL();
                break;
            }

            case "Customers":
            {
                service = new CustomerDAL();
                break;
            }

            case "Account":
            {
                service = new AccountDAL();
                break;
            }

            case "Manage":
            {
                service = new ManageDAL();
                break;
            }

            case "Vendors":
            {
                service = new VendorDAL();
                break;
            }
            }
            IController controller = Activator.CreateInstance(controllerType, new[] { service }) as Controller;

            return(controller);
        }