Esempio n. 1
0
        private IList <BindingListItem> GetBindingList(string subjectType, IUnitOfWork unitOfWork)
        {
            IList <BindingListItem> dataSource = null;

            switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), subjectType))
            {
            case InstanceTypes.Language:
                LanguageFacade languageFacade = new LanguageFacade(unitOfWork);
                dataSource = languageFacade.GetBindingList();
                break;

            case InstanceTypes.Location:
                LocationFacade locationFacade = new LocationFacade(unitOfWork);
                dataSource = locationFacade.GetBindingList();
                break;

            case InstanceTypes.Folder:
                FolderFacade folderFacade = new FolderFacade(unitOfWork);
                dataSource = folderFacade.GetBindingList();
                break;

            case InstanceTypes.Reference:
                ReferenceFacade referenceFacade = new ReferenceFacade(unitOfWork);
                dataSource = referenceFacade.GetBindingList();
                break;
            }

            return(dataSource);
        }
Esempio n. 2
0
        private void LoadDDL()
        {
            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
            {
                LanguageFacade facade = new LanguageFacade(uow);
                ddlLanguage.DataSource = facade.GetBindingList();
            }

            ddlLanguage.DataValueField = BindingListItem.ValueProperty;
            ddlLanguage.DataTextField  = BindingListItem.TextProperty;
            ddlLanguage.DataBind();
        }
        private IList <BindingListItem> GetBindingList(string subjectType)
        {
            IList <BindingListItem> dataSource = null;

            switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), subjectType))
            {
            case InstanceTypes.Customer:
                CustomerSystem sys = new CustomerSystem(UnitOfWork);
                dataSource = sys.GetBindingList();
                break;

            case InstanceTypes.Contact:
                ContactSystem contactSystem = new ContactSystem(UnitOfWork);
                dataSource = contactSystem.GetBindingList();
                break;

            case InstanceTypes.Product:
                ProductSystem productSystem = new ProductSystem(UnitOfWork);
                dataSource = productSystem.GetBindingList();
                break;

            case InstanceTypes.Supplier:
                SupplierSystem supplierSystem = new SupplierSystem(UnitOfWork);
                dataSource = supplierSystem.GetBindingList();
                break;

            case InstanceTypes.Catalog:
                CatalogSystem catalogSystem = new CatalogSystem(UnitOfWork);
                dataSource = catalogSystem.GetBindingList();
                break;

            case InstanceTypes.Employee:
                EmployeeSystem employeeSystem = new EmployeeSystem(UnitOfWork);
                dataSource = employeeSystem.GetBindingList();
                break;

            case InstanceTypes.Document:
                DocumentSystem docSystem = new DocumentSystem(UnitOfWork);
                dataSource = docSystem.GetBindingList();
                break;

            case InstanceTypes.User:
                UserFacade facade = new UserFacade(UnitOfWork);
                dataSource = facade.GetBindingList();
                break;

            case InstanceTypes.Language:
                LanguageFacade languageFacade = new LanguageFacade(UnitOfWork);
                dataSource = languageFacade.GetBindingList();
                break;

            case InstanceTypes.Domain:
                DomainFacade domainFacade = new DomainFacade(UnitOfWork);
                dataSource = domainFacade.GetBindingList();
                break;

            case InstanceTypes.MainMenu:
                MainMenuFacade mainMenuFacade = new MainMenuFacade(UnitOfWork);
                dataSource = mainMenuFacade.GetBindingList();
                break;

            case InstanceTypes.SetupMenu:
                SetupMenuFacade setupMenuFacade = new SetupMenuFacade(UnitOfWork);
                dataSource = setupMenuFacade.GetBindingList();
                break;

            case InstanceTypes.ShipTo:
                ShipToFacade shipTofacade = new ShipToFacade(UnitOfWork);
                dataSource = shipTofacade.GetBindingList();
                break;

            case InstanceTypes.SellingPeriod:
                SellingPeriodFacade sellingPeriodfacade = new SellingPeriodFacade(UnitOfWork);
                dataSource = sellingPeriodfacade.GetBindingList();
                break;

            case InstanceTypes.UserMatch:
                dataSource = GetUserMatch();
                break;
            }

            return(dataSource);
        }