Exemple #1
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            SettingsDto settings = null;

            if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))             // load fresh on initial load
            {
                settings = LoadFresh();
            }
            else             // load from session
            {
                settings = (SettingsDto)Session[_SettingsDtoEditSessionKey];

                if (settings == null)
                {
                    settings = LoadFresh();
                }
            }

            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            dic.Add(_SettingsDtoString, settings);

            // Call tabs load context
            ViewControl.LoadContext(dic);
        }
Exemple #2
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            ShippingMethodDto sm = null;

            if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))             // load fresh on initial load
            {
                sm = LoadFresh();

                CreateEmptyDto(ref sm, true);
            }
            else             // load from session
            {
                sm = (ShippingMethodDto)Session[GetShippingMethodSessionKey()];

                if (sm == null)
                {
                    sm = LoadFresh();
                }
            }

            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            dic.Add(_ShippingMethodDtoString, sm);

            // Call tabs load context
            ViewControl.LoadContext(dic);
        }
Exemple #3
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            if (ExpressionId > 0)
            {
                ExpressionDto expression = null;
                if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes"))) // load fresh on initial load
                {
                    expression = LoadFresh();
                }
                else // load from session
                {
                    expression = (ExpressionDto)Session[_ExpressionDtoEditSessionKey];

                    if (expression == null)
                    {
                        expression = LoadFresh();
                    }
                }

                // Put a dictionary key that can be used by other tabs
                IDictionary dic = new ListDictionary();
                dic.Add(_ExpressionDtoString, expression);

                // Call tabs load context
                ViewControl.LoadContext(dic);

                _Expression = expression;
            }
        }
Exemple #4
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            if (!String.IsNullOrEmpty(RoleId))
            {
                PermissionDto permission = null;
                if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))                 // load fresh on initial load
                {
                    permission = LoadFresh();
                }
                else                 // load from session
                {
                    permission = (PermissionDto)Session[_PermissionDtoEditSessionKey];

                    if (permission == null)
                    {
                        permission = LoadFresh();
                    }
                }

                // Put a dictionary key that can be used by other tabs
                IDictionary dic = new ListDictionary();
                dic.Add(_PermissionDtoString, permission);

                // Call tabs load context
                ViewControl.LoadContext(dic);

                _Permission = permission;
            }
        }
Exemple #5
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            if (PolicyId > 0)
            {
                PolicyDto policy = null;
                if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes"))) // load fresh on initial load
                {
                    policy = LoadFresh();
                }
                else // load from session
                {
                    policy = (PolicyDto)Session[_PolicyDtoEditSessionKey];

                    if (policy == null)
                    {
                        policy = LoadFresh();
                    }
                }

                // Put a dictionary key that can be used by other tabs
                IDictionary dic = new ListDictionary();
                dic.Add(_PolicyDtoString, policy);

                // Call tabs load context
                ViewControl.LoadContext(dic);

                _Policy = policy;
            }
        }
Exemple #6
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            CurrencyDto currency = null;

            if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))             // load fresh on initial load
            {
                currency = LoadFresh();
            }
            else             // load from session
            {
                currency = (CurrencyDto)Session[_CurrencyDtoEditSessionKey];

                if (currency == null)
                {
                    currency = LoadFresh();
                }
            }

            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            dic.Add(_CurrencyDtoContextString, currency);
            dic.Add(_CurrencyIdContextString, CurrencyId);

            // Call tabs load context
            ViewControl.LoadContext(dic);
        }
Exemple #7
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            if (WarehouseId > 0)
            {
                WarehouseDto warehouse = null;
                if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))                 // load fresh on initial load
                {
                    warehouse = LoadFresh();
                }
                else                 // load from session
                {
                    warehouse = (WarehouseDto)Session[_WarehouseDtoEditSessionKey];

                    if (warehouse == null)
                    {
                        warehouse = LoadFresh();
                    }
                }

                // Put a dictionary key that can be used by other tabs
                IDictionary dic = new ListDictionary();
                dic.Add(_WarehouseDtoString, warehouse);

                // Call tabs load context
                ViewControl.LoadContext(dic);

                _Warehouse = warehouse;
            }
        }
Exemple #8
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            // Call tabs load context
            ViewControl.LoadContext(dic);
        }
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            CatalogEntryDto       entry       = null;
            CatalogRelationDto    relation    = null;
            CatalogAssociationDto association = null;

            if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))             // load fresh on initial load
            {
                entry       = LoadFreshEntry();
                relation    = LoadFreshRelation();
                association = LoadFreshAssociation();

                // if Dtos not loaded, create empty Dtos
                CreateEmptyDtos(ref entry, ref relation, ref association, true);
            }
            else             // load from session
            {
                entry = (CatalogEntryDto)Session[_CatalogEntryDtoString];

                if (entry == null)
                {
                    entry = LoadFreshEntry();
                }

                association = (CatalogAssociationDto)Session[_CatalogAssociationDtoString];

                if (association == null)
                {
                    association = LoadFreshAssociation();
                }

                relation = (CatalogRelationDto)Session[_CatalogRelationDtoString];

                if (relation == null)
                {
                    relation = LoadFreshRelation();
                }
            }

            if (CatalogEntryId > 0 && entry.CatalogEntry.Count == 0)
            {
                Response.Redirect("ContentFrame.aspx?_a=Catalog&_v=Catalog-List");
            }

            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            dic.Add(_CatalogEntryDtoString, entry);
            dic.Add(_CatalogRelationDtoString, relation);
            dic.Add(_CatalogAssociationDtoString, association);

            // Call tabs load context
            ViewControl.LoadContext(dic);
        }
Exemple #10
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            //if (OrderGroupId > 0)
            {
                OrderGroup order      = null;
                bool       cartLoaded = false;
                Cart       cart       = null;
                if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes"))) // load fresh on initial load
                {
                    order = LoadFresh();

                    if (order == null)
                    {
                        cart = CreateFreshCart();

                        cartLoaded = true;

                        // persist in session
                        Session[_OrderGroupDtoSessionKey] = cart;
                    }
                }
                else // load from session
                {
                    order = (OrderGroup)Session[_OrderGroupDtoSessionKey];

                    if (order == null)
                    {
                        order = LoadFresh();
                    }
                }

                // Put a dictionary key that can be used by other tabs
                IDictionary dic = new ListDictionary();
                if (cartLoaded)
                {
                    dic.Add(_OrderContextObjectString, cart);
                }
                else
                {
                    dic.Add(_OrderContextObjectString, order);
                }

                // Call tabs load context
                ViewControl.LoadContext(dic);

                // Load order group context
                OrderGroupEdit.LoadContext(dic);
            }

            EditSaveControl.SavedClientScript  = String.Format("CSManagementClient.ChangeView('Order', 'Orders-List', 'filter={0}&class={1}');", FilterType, ClassType);
            EditSaveControl.CancelClientScript = String.Format("CSManagementClient.ChangeView('Order', 'Orders-List', 'filter={0}&class={1}');", FilterType, ClassType);
        }
Exemple #11
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            CatalogNodeDto node = null;

            if (CatalogNodeId > 0)
            {
                if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes"))) // load fresh on initial load
                {
                    node = LoadFreshNode();

                    if (node == null)
                    {
                        node = new CatalogNodeDto();
                    }
                }
                else // load from session
                {
                    node = (CatalogNodeDto)Session[_CatalogNodeDtoString];

                    if (node == null)
                    {
                        node = LoadFreshNode();
                    }
                }
            }
            else
            {
                node = (CatalogNodeDto)Session[_CatalogNodeDtoString];

                // create new dto objects if they are null
                if (node == null)
                {
                    node = new CatalogNodeDto();
                }
            }


            if (CatalogNodeId > 0 && node.CatalogNode.Count == 0)
            {
                Response.Redirect("ContentFrame.aspx?_a=Catalog&_v=Catalog-List");
            }

            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            dic.Add(_CatalogNodeDtoString, node);

            // Call tabs load context
            ViewControl.LoadContext(dic);
        }
Exemple #12
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            if (TemplateId > 0)
            {
                TemplateDto templates = DictionaryManager.GetTemplateDto(TemplateId);

                // Put a dictionary key that can be used by other tabs
                IDictionary dic = new ListDictionary();
                dic.Add(_TemplateDtoString, templates);

                // Call tabs load context
                ViewControl.LoadContext(dic);
            }
        }
Exemple #13
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            PaymentMethodDto pm = null;

            if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))             // load fresh on initial load
            {
                pm = LoadFresh();

                CreateEmptyDto(ref pm, true);
            }
            else             // load from session
            {
                pm = (PaymentMethodDto)Session[GetPaymentMethodSessionKey()];

                if (pm == null)
                {
                    pm = LoadFresh();
                }
            }

            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            dic.Add(_PaymentMethodDtoString, pm);

            // Call tabs load context
            ViewControl.LoadContext(dic);

            // set redirect functiond for editsave control
            string langId = String.Empty;

            if (pm != null && pm.PaymentMethod != null && pm.PaymentMethod.Count > 0)
            {
                langId = pm.PaymentMethod[0].LanguageId;
            }
            else
            {
                langId = LanguageCode;
            }

            EditSaveControl.CancelClientScript = "CSOrderClient.PaymentMethodSaveRedirect('" + langId + "');";
            EditSaveControl.SavedClientScript  = "CSOrderClient.PaymentMethodSaveRedirect('" + langId + "');";
        }
Exemple #14
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            TaxDto tax = null;

            if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes")))             // load fresh on initial load
            {
                tax = LoadFresh();

                CreateEmptyDto(ref tax, true);
            }
            else             // load from session
            {
                tax = (TaxDto)Session[_TaxDtoEditSessionKey];

                if (tax == null)
                {
                    tax = LoadFresh();
                }
            }

            // Put a dictionary key that can be used by other tabs
            IDictionary dic = new ListDictionary();

            dic.Add(_TaxDtoString, tax);

            // Call tabs load context
            ViewControl.LoadContext(dic);

            // set redirect functiond for editsave control
            string langId = String.Empty;

            //if (tax != null && tax.TaxLanguage != null && tax.TaxLanguage.Count > 0)
            //    langId = tax.TaxLanguage[0].LanguageId;
            //else
            //	langId = LanguageCode;

            EditSaveControl.CancelClientScript = "CSOrderClient.TaxSaveRedirect();";
            EditSaveControl.SavedClientScript  = "CSOrderClient.TaxSaveRedirect();";
        }
Exemple #15
0
        /// <summary>
        /// Loads the context.
        /// </summary>
        private void LoadContext()
        {
            //if (SiteId != Guid.Empty)
            {
                SiteDto dto = null;
                if (!this.IsPostBack && (!this.Request.QueryString.ToString().Contains("Callback=yes"))) // load fresh on initial load
                {
                    dto = LoadFresh();
                }
                else // load from session
                {
                    dto = (SiteDto)Session[_SiteEditSessionKey];

                    if (dto == null)
                    {
                        dto = LoadFresh();
                    }
                }

                // Put a dictionary key that can be used by other tabs
                IDictionary dic = new ListDictionary();

                if (SiteId != Guid.Empty && NeedCopy)
                {
                    // add existing site with specified SiteId
                    dic.Add(_SiteDtoSourceString, CMSContext.Current.GetSiteDto(SiteId, true));
                }
                else
                {
                    dic.Add(_SiteDtoSourceString, dto);
                }

                // add current site (new or existing)
                dic.Add(_SiteDtoDestinationString, dto);

                // Call tabs load context
                ViewControl.LoadContext(dic);
            }
        }