예제 #1
0
 private void RetrieveData()
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
     {
         CatalogFacade facade = new CatalogFacade(uow);
         CurrentInstances = facade.RetrieveAllCatalog(new CatalogConverter());
     }
 }
예제 #2
0
 private void RetrieveData()
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
     {
         CatalogFacade facade = new CatalogFacade(uow);
         CurrentCatalog = facade.RetrieveOrNewCatalog(InstanceId, new CatalogConverter());
         // Retrieve ScheduleEvents of Customer
         CategoryFacade categoryfacade = new CategoryFacade(uow);
         CurrentCatalog.CategoryList = categoryfacade.RetrieveCategoryTree(InstanceId, new CategoryConverter());
     }
 }
예제 #3
0
        protected void ucIList_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e)
        {
            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
            {
                CatalogFacade facade = new CatalogFacade(uow);
                IFacadeUpdateResult <CatalogData> result = facade.DeleteCatalog(e.Instance.Id);
                e.IsSuccessful = result.IsSuccessful;

                if (result.IsSuccessful)
                {
                    // Refresh whole list
                    CurrentInstances = facade.RetrieveAllCatalog(new CatalogConverter());
                }
                else
                {
                    // Deal with Update result
                    ProcUpdateResult(result.ValidationResult, result.Exception);
                }
            }
        }