Example #1
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            CatalogDto catalogDto = null;

            if (MetaClassId > 0)
            {
                MetaDataTab.MetaClassId = MetaClassId;
                catalogDto = CatalogContext.Current.GetCatalogDto(ParentCatalogId);
            }
            else if (MetaClassId == 0 && CatalogNodeId == 0 && Session["CatalogNode-MetaClassId"] != null)
            {
                if (!String.IsNullOrEmpty(Session["CatalogNode-MetaClassId"].ToString()))
                {
                    MetaDataTab.MetaClassId = Int32.Parse(Session["CatalogNode-MetaClassId"].ToString());
                    catalogDto = CatalogContext.Current.GetCatalogDto(ParentCatalogId);
                }
            }
            else if (CatalogNodeId > 0)
            {
                MetaDataTab.ObjectId = CatalogNodeId;
                CatalogNodeDto dto = CatalogContext.Current.GetCatalogNodeDto(CatalogNodeId);
                if (dto.CatalogNode.Count > 0)
                {
                    catalogDto = CatalogContext.Current.GetCatalogDto(dto.CatalogNode[0].CatalogId);
                    MetaDataTab.MetaClassId = dto.CatalogNode[0].MetaClassId;
                }
            }

            if (HttpContext.Current.Items["CatalogNode-MetaClassId"] != null)
            {
                MetaDataTab.MetaClassId = Int32.Parse(HttpContext.Current.Items["CatalogNode-MetaClassId"].ToString());
            }

            if (catalogDto != null)
            {
                List <string> list = new List <string>();
                list.Add(catalogDto.Catalog[0].DefaultLanguage);
                if (catalogDto.CatalogLanguage.Count > 0)
                {
                    foreach (CatalogDto.CatalogLanguageRow row in catalogDto.CatalogLanguage.Rows)
                    {
                        list.Add(row.LanguageCode);
                    }

                    MetaDataTab.Languages = list.ToArray();
                }
                MetaDataTab.DataBind();
            }
        }
Example #2
0
        /// <summary>
        /// Binds the meta form.
        /// </summary>
        private void BindMetaForm()
        {
            string    metaClassName = Request.QueryString["class"];
            MetaClass metaClass     = null;

            if ((_order == null || _order.OrderGroupId <= 0) || String.IsNullOrEmpty(metaClassName))
            {
                // Call clear meta cache so we have the latest meta class when binding to an item
                OrderContext.Current.ClearMetaCache();

                if (_order is Cart)
                {
                    // if this is new order/cart/payment plan
                    metaClass = OrderContext.Current.ShoppingCartMetaClass;
                }
                else
                {
                    // if we are in edit mode
                    if (this.ViewId.StartsWith("PaymentPlan", StringComparison.OrdinalIgnoreCase))
                    {
                        metaClass = OrderContext.Current.PaymentPlanMetaClass;
                    }
                    else if (this.ViewId.StartsWith("PurchaseOrder", StringComparison.OrdinalIgnoreCase))
                    {
                        metaClass = OrderContext.Current.PurchaseOrderMetaClass;
                    }
                    else if (this.ViewId.StartsWith("ShoppingCart", StringComparison.OrdinalIgnoreCase))
                    {
                        metaClass = OrderContext.Current.ShoppingCartMetaClass;
                    }
                }
            }
            else
            {
                metaClass = MetaClass.Load(OrderContext.MetaDataContext, metaClassName);
            }

            // Bind Meta Form
            MetaDataTab.MetaClassId = metaClass.Id;
            Dictionary <string, MetaObject> metaObjects = new Dictionary <string, MetaObject>();

            metaObjects.Add(MetaDataTab.Languages[0], _order);
            IDictionary dic = new ListDictionary();

            dic.Add("MetaObjectsContext", metaObjects);
            MetaDataTab.LoadContext(dic);
            MetaDataTab.DataBind();
        }
Example #3
0
        private void BindMetaForm()
        {
            // Bind Meta Form
            MetaDataTab.MetaClassId = OrderContext.Current.LineItemMetaClass.Id;

            Dictionary <string, MetaObject> metaObjects = new Dictionary <string, MetaObject>();

            metaObjects.Add(MetaDataTab.Languages[0], SelectedLineItem);

            IDictionary dic = new ListDictionary();

            dic.Add("MetaObjectsContext", metaObjects);

            MetaDataTab.LoadContext(dic);

            MetaDataTab.DataBind();
        }
Example #4
0
        /// <summary>
        /// Binds the meta form.
        /// </summary>
        private void BindMetaForm()
        {
            CatalogDto catalogDto = null;

            if (CatalogEntryId == 0)
            {
                catalogDto = CatalogContext.Current.GetCatalogDto(ParentCatalogId);
            }
            else if (CatalogEntryId > 0)
            {
                MetaDataTab.ObjectId = CatalogEntryId;
                CatalogEntryDto dto = CatalogContext.Current.GetCatalogEntryDto(CatalogEntryId);
                if (dto.CatalogEntry.Count > 0)
                {
                    catalogDto = CatalogContext.Current.GetCatalogDto(dto.CatalogEntry[0].CatalogId);
                    MetaDataTab.MetaClassId = dto.CatalogEntry[0].MetaClassId;
                }
            }

            //if (this.IsPostBack)
            if (!String.IsNullOrEmpty(MetaClassList.SelectedValue))
            {
                MetaDataTab.MetaClassId = Int32.Parse(MetaClassList.SelectedValue);
            }

            if (catalogDto != null)
            {
                List <string> list = new List <string>();
                list.Add(catalogDto.Catalog[0].DefaultLanguage);
                if (catalogDto.CatalogLanguage.Count > 0)
                {
                    foreach (CatalogDto.CatalogLanguageRow row in catalogDto.CatalogLanguage.Rows)
                    {
                        list.Add(row.LanguageCode);
                    }
                }

                MetaDataTab.Languages = list.ToArray();
                MetaDataTab.DataBind();
            }

            // add parent catalognode
            if (ParentCatalogNodeId > 0)
            {
            }
        }
        private void BindMetaForm()
        {
            // Bind Meta Form
            MetaDataTab.MetaClassId = Int32.Parse(PaymentType.SelectedValue);

            Dictionary <string, MetaObject> metaObjects = new Dictionary <string, MetaObject>();

            if (SelectedPayment != null && SelectedPayment.MetaClass.Id.ToString() == PaymentType.SelectedValue)
            {
                metaObjects.Add(MetaDataTab.Languages[0], SelectedPayment);
            }
            else
            {
                metaObjects.Add(MetaDataTab.Languages[0], null);
            }

            IDictionary dic = new ListDictionary();

            dic.Add("MetaObjectsContext", metaObjects);

            MetaDataTab.LoadContext(dic);

            MetaDataTab.DataBind();
        }