Beispiel #1
0
        private void LoadGatewayAdmin(string gatewayName)
        {
            plhGatewayProvider.Controls.Clear();

            GatewayController controller = new GatewayController(Server.MapPath(ControlPath));
            GatewayInfo       gateway    = controller.GetGateway(gatewayName);

            if (gateway != null)
            {
                string controlPath = gateway.GatewayPath + "\\" + gateway.AdminControl;
                if (File.Exists(controlPath))
                {
                    controlPath = controlPath.Replace(Server.MapPath(ControlPath), ControlPath);

                    _gatewayControl = (StoreControlBase)LoadControl(controlPath);
                    _gatewayControl.ModuleConfiguration = ModuleConfiguration;
                    _gatewayControl.EnableViewState     = true;
                    _gatewayControl.DataSource          = gateway.GetSettings(PortalId);
                    _gatewayControl.ID = gatewayName;

                    plhGatewayProvider.Controls.Add(_gatewayControl);
                }
                else
                {
                    LiteralControl error = new LiteralControl("<span class=\"NormalRed\">" + Localization.GetString("CouldNotFind", LocalResourceFile) + " " + controlPath + ".</span>");
                    plhGatewayProvider.Controls.Add(error);
                }
            }
            else
            {
                LiteralControl error = new LiteralControl("<span class=\"NormalRed\">" + Localization.GetString("GatewayNotSelected", LocalResourceFile) + "</span>");
                plhGatewayProvider.Controls.Add(error);
            }
        }
Beispiel #2
0
        private void LoadEditControl(int couponID)
        {
            plhEditControl.Controls.Clear();
            StoreControlBase editControl = (StoreControlBase)LoadControl(ControlPath + "CouponEdit.ascx");

            editControl.ModuleConfiguration = ModuleConfiguration;
            editControl.StoreSettings       = StoreSettings;
            editControl.DataSource          = couponID;
            editControl.EditComplete       += editControl_EditComplete;
            plhEditControl.Controls.Add(editControl);
        }
Beispiel #3
0
        private void LoadReviewListControl()
        {
            // TODO: We may want to use caching here
            StoreControlBase reviewList = (StoreControlBase)LoadControl(ControlPath + "ReviewList.ascx");

            reviewList.ModuleConfiguration = ModuleConfiguration;
            reviewList.StoreSettings       = StoreSettings;
            reviewList.EditComplete       += reviewList_EditComplete;
            plhReviews.Controls.Clear();
            plhReviews.Controls.Add(reviewList);
        }
Beispiel #4
0
        private void LoadReviewEditControl()
        {
            // Inject the edit control
            StoreControlBase reviewEdit = (StoreControlBase)LoadControl(ControlPath + "ReviewEdit.ascx");

            reviewEdit.ModuleConfiguration = ModuleConfiguration;
            reviewEdit.StoreSettings       = StoreSettings;
            reviewEdit.DataSource          = _catalogNav.ReviewID;
            reviewEdit.EditComplete       += reviewEdit_EditComplete;
            plhReviews.Controls.Clear();
            plhReviews.Controls.Add(reviewEdit);
        }
Beispiel #5
0
        public static string GetTemplatePath(StoreControlBase control, bool portalTemplates)
        {
            string templatePath;

            if (portalTemplates)
            {
                templatePath = control.PortalSettings.HomeDirectory + "Store/Templates/";
            }
            else
            {
                templatePath = control.TemplateSourceDirectory + "/Templates/";
            }
            return(templatePath);
        }
Beispiel #6
0
        private void ShowEditControl()
        {
            panelList.Visible = false;
            panelEdit.Visible = true;

            // Inject the edit control
            StoreControlBase reviewEdit = (StoreControlBase)LoadControl(ControlPath + "ReviewEdit.ascx");

            reviewEdit.ModuleConfiguration = ModuleConfiguration;
            reviewEdit.StoreSettings       = StoreSettings;
            reviewEdit.DataSource          = _nav.ReviewID;
            reviewEdit.EditComplete       += reviewEdit_EditComplete;
            panelEdit.Controls.Clear();
            panelEdit.Controls.Add(reviewEdit);
        }
Beispiel #7
0
        private void LoadAccountControl()
        {
            // TODO: We may want to use caching here
            StoreControlBase control = (StoreControlBase)LoadControl(ControlPath + _nav.PageID + ".ascx");

            control.ID = _nav.PageID.ToLower();
            control.ModuleConfiguration = ModuleConfiguration;
            control.StoreSettings       = StoreSettings;
            control.EditComplete       += accountControl_EditComplete;
            plhAccountControl.Controls.Clear();
            plhAccountControl.Controls.Add(control);
            if (control is IStoreTabedControl)
            {
                lblParentTitle.Text = ((IStoreTabedControl)control).Title;
            }
        }
Beispiel #8
0
        private void LoadAdminControl()
        {
            plhAdminControl.Controls.Clear();

            if (!String.IsNullOrEmpty(_adminNav.PageID))
            {
                // TODO: We may want to use caching here
                StoreControlBase adminControl = (StoreControlBase)LoadControl(ControlPath + _adminNav.PageID + ".ascx");
                adminControl.ModuleConfiguration = ModuleConfiguration;
                adminControl.StoreSettings       = StoreSettings;
                adminControl.EditComplete       += adminControl_EditComplete;
                adminControl.ID = _adminNav.PageID;
                plhAdminControl.Controls.Add(adminControl);
                if (adminControl is IStoreTabedControl)
                {
                    lblParentTitle.Text = ((IStoreTabedControl)adminControl).Title;
                }
            }
        }