Exemple #1
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();
        }
        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();
        }
        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();
        }