Exemple #1
0
        protected virtual void ImportData(SingleChoiceActionExecuteEventArgs e)
        {
            ChoiceActionItem  activeItem    = e.SelectedChoiceActionItem;
            ListView          lv            = (ListView)View;
            ImportDataManager importManager = new ImportDataManager(Application);

            switch (activeItem.Data.ToString())
            {
            //7th Change
            case "Agent_ListView":
                importManager.ImportData <Agent>(MaxImportedRecordsCount, Agent.CreateCoolAgentImportDataFromXmlFileDelegate(Application), null, lv, true);
                //Dennis: This line won't be executed unless you handle the exception thrown from the previus ImportData call.
                //ImportDataManager.ImportData<Person>(MaxImportedRecordsCount, ImportDataLogic.CreateDummyPersonImportDataDelegate(), ImportDataLogic.CreateDummyPersonValidateDataDelegate(), lv, true);
                break;

            case "Customer_ListView":
                //PropertyCollectionSource pcs = lv.CollectionSource as PropertyCollectionSource;
                //if (pcs != null)
                //{
                importManager.ImportData <Customer>(MaxImportedRecordsCount, Customer.CreateCoolCustomerImportDataFromXmlFileDelegate(Application), null, lv, true);
                //}
                break;

            case "Product_ListView":
                importManager.ImportData <Product>(MaxImportedRecordsCount, Product.CreateCoolProductImportDataFromXmlFileDelegate(Application), null, lv, true);
                //Dennis: This line won't be executed unless you handle the exception thrown from the previus ImportData call.
                //ImportDataManager.ImportData<Person>(MaxImportedRecordsCount, ImportDataLogic.CreateDummyPersonImportDataDelegate(), ImportDataLogic.CreateDummyPersonValidateDataDelegate(), lv, true);
                break;
            }
        }
        protected virtual void ImportData(SingleChoiceActionExecuteEventArgs e)
        {
            ChoiceActionItem  activeItem    = e.SelectedChoiceActionItem;
            ListView          lv            = (ListView)View;
            ImportDataManager importManager = new ImportDataManager(Application);

            switch (activeItem.Data.ToString())
            {
            case "Person_ListView":
                importManager.ImportData <Person>(MaxImportedRecordsCount, ImportDataLogic.CreateCoolPersonImportDataFromXmlFileDelegate(), null, lv, true);
                //Dennis: This line won't be executed unless you handle the exception thrown from the previus ImportData call.
                //ImportDataManager.ImportData<Person>(MaxImportedRecordsCount, ImportDataLogic.CreateDummyPersonImportDataDelegate(), ImportDataLogic.CreateDummyPersonValidateDataDelegate(), lv, true);
                break;

            case "Party_PhoneNumbers_ListView":
                PropertyCollectionSource pcs = lv.CollectionSource as PropertyCollectionSource;
                if (pcs != null)
                {
                    importManager.ImportData <PhoneNumber>(MaxImportedRecordsCount, ImportDataLogic.CreateDummyPhoneNumberImportDataDelegate(), ImportDataLogic.CreateDummyPhoneNumberValidateDataDelegate(), lv, true);
                }
                break;
            }
        }