/// <summary>
        /// This function is called when the IlcCore Server request informations for an InfoPoint.
        /// Step 2
        /// To get Informations into your apps you need insert the appropiate BusinessObject into the dataInterface
        /// </summary>
        /// <param name="context"></param>
        /// <param name="infoPoint"></param>
        /// <param name="dataInterface"></param>
        public void CollectInformations(InformationProcess context, InfoPoint infoPoint, IInformationDataInterface dataInterface)
        {
            var company = infoPoint.Value as Company;
            if (company == null)
                return;
            dataInterface.Insert(company);
            dataInterface.Flush();

            if (dataInterface.MustCollect<ContactPerson>())
            {
                var contactsLoader = new ContactsLoader();
                var contacts = contactsLoader.LoadContactsByCompany(company);
                dataInterface.Insert(contacts);
                dataInterface.Flush();
            }
            
            // Step 3 
            // we Add the ProductsLoader and the Ilc.BusinessObjects.AdventureWorks Library
            // to showcase the Detail-Loading procedure
            // Details-Loading is deferred by creating and setting an DetailsLink for the InformationObject
            if (dataInterface.MustCollect<BikeProduct>())
            {
                var productsLoader = new ProductsLoader();
                var products = productsLoader.LoadProductByCompany(company);

                foreach (var product in products)
                {
                    var detailsLink = new List<DetailsLink>();
                    detailsLink.Add(dataInterface.CreateDetailsLink(Constants.ProductPhotoDetailslink, product.Id));
                    dataInterface.Insert(product, null, detailsLink);
                }
                dataInterface.Flush();
            }
        }
Example #2
0
 /// <summary>
 /// Step 3
 /// When the Client Opens the InformationObject in Detailsview it requests the Detailslink to be loaded.
 /// Though you can collect many different types of Details you have to identify them by there DetailsLinkName, which are best stored in Constants
 /// </summary>
 /// <param name="process"></param>
 /// <param name="dataInterface"></param>
 public void CollectDetails(DetailsProcess process, IDetailsDataInterface dataInterface)
 {
     if (dataInterface.IsIdDetailsLink(Constants.ProductPhotoDetailslink))
     {
         var productsLoader = new ProductsLoader();
         var productid      = dataInterface.GetLinkId();
         var items          = productsLoader.GetProductPhoto(productid);
         var item           = items.FirstOrDefault();
         dataInterface.Set(item);
     }
 }
Example #3
0
        /// <summary>
        /// This function is called when the IlcCore Server request informations for an InfoPoint.
        /// Step 2
        /// To get Informations into your apps you need insert the appropiate BusinessObject into the dataInterface
        /// </summary>
        /// <param name="context"></param>
        /// <param name="infoPoint"></param>
        /// <param name="dataInterface"></param>
        public void CollectInformations(InformationProcess context, InfoPoint infoPoint, IInformationDataInterface dataInterface)
        {
            var company = infoPoint.Value as Company;

            if (company == null)
            {
                return;
            }
            dataInterface.Insert(company);
            dataInterface.Flush();

            if (dataInterface.MustCollect <ContactPerson>())
            {
                var contactsLoader = new ContactsLoader();
                var contacts       = contactsLoader.LoadContactsByCompany(company);
                dataInterface.Insert(contacts);
                dataInterface.Flush();
            }

            // Step 3
            // we Add the ProductsLoader and the Ilc.BusinessObjects.AdventureWorks Library
            // to showcase the Detail-Loading procedure
            // Details-Loading is deferred by creating and setting an DetailsLink for the InformationObject
            if (dataInterface.MustCollect <BikeProduct>())
            {
                var productsLoader = new ProductsLoader();
                var products       = productsLoader.LoadProductByCompany(company);

                foreach (var product in products)
                {
                    var detailsLink = new List <DetailsLink>();
                    detailsLink.Add(dataInterface.CreateDetailsLink(Constants.ProductPhotoDetailslink, product.Id));
                    dataInterface.Insert(product, null, detailsLink);
                }
                dataInterface.Flush();
            }
        }
 /// <summary>
 /// Step 3 
 /// When the Client Opens the InformationObject in Detailsview it requests the Detailslink to be loaded.
 /// Though you can collect many different types of Details you have to identify them by there DetailsLinkName, which are best stored in Constants
 /// </summary>
 /// <param name="process"></param>
 /// <param name="dataInterface"></param>
 public void CollectDetails(DetailsProcess process, IDetailsDataInterface dataInterface)
 {
     if (dataInterface.IsIdDetailsLink(Constants.ProductPhotoDetailslink))
     {
         var productsLoader = new ProductsLoader();
         var productid = dataInterface.GetLinkId();
         var items = productsLoader.GetProductPhoto(productid);
         var item = items.FirstOrDefault();
         dataInterface.Set(item);
     }
 }