コード例 #1
0
ファイル: Settings.ascx.cs プロジェクト: crazyants/core-1
 /// <summary>
 ///     Fill dropdown lists
 /// </summary>
 private void FillForm()
 {
     ViewComboBox.Items.Add(new RadComboBoxItem(LocalizeString("NoneSelectedText"), string.Empty));
     ViewComboBox.AppendDataBoundItems = true;
     ViewComboBox.DataSource           = DnnPathHelper.GetViewNames("Cart");
     ViewComboBox.DataBind();
 }
コード例 #2
0
ファイル: Settings.ascx.cs プロジェクト: crazyants/core-1
        /// <summary>
        ///     Fill dropdown lists
        /// </summary>
        private void FillForm()
        {
            var checkoutViews       = DnnPathHelper.GetViewNames("Checkout");
            var payPalCheckoutViews = DnnPathHelper.GetViewNames("PayPalExpressCheckout");
            var notSetText          = LocalizeString("NoneSelectedText");

            ViewComboBox.Items.Add(new RadComboBoxItem(notSetText, string.Empty));
            ViewComboBox.AppendDataBoundItems = true;
            ViewComboBox.DataSource           = checkoutViews;
            ViewComboBox.DataBind();

            ReceiptViewComboBox.Items.Add(new RadComboBoxItem(notSetText, string.Empty));
            ReceiptViewComboBox.AppendDataBoundItems = true;
            ReceiptViewComboBox.DataSource           = checkoutViews;
            ReceiptViewComboBox.DataBind();

            PaymentErrorViewComboBox.Items.Add(new RadComboBoxItem(notSetText, string.Empty));
            PaymentErrorViewComboBox.AppendDataBoundItems = true;
            PaymentErrorViewComboBox.DataSource           = checkoutViews;
            PaymentErrorViewComboBox.DataBind();

            PayPalViewComboBox.Items.Add(new RadComboBoxItem(notSetText, string.Empty));
            PayPalViewComboBox.AppendDataBoundItems = true;
            PayPalViewComboBox.DataSource           = payPalCheckoutViews;
            PayPalViewComboBox.DataBind();
        }
コード例 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!Page.IsPostBack)
            {
                LocalizeView();

                var sortedProducts = GetSelectedProducts();
                LoadItems(sortedProducts);

                int gridColumns;
                if (!int.TryParse(Convert.ToString(ModuleSettings["GridColumns"]), out gridColumns))
                {
                    gridColumns = 3;
                }

                GridColumnsField.Text = gridColumns.ToString();

                // load the view names into the combobox
                ViewComboBox.Items.Add(new System.Web.UI.WebControls.ListItem(LocalizeString("NoneSelectedText"), string.Empty));
                ViewComboBox.AppendDataBoundItems = true;
                ViewComboBox.DataSource           = DnnPathHelper.GetViewNames("ProductGrid");
                ViewComboBox.DataBind();
            }
        }
コード例 #4
0
 /// <summary>
 ///     Fill dropdown lists
 /// </summary>
 private void FillForm()
 {
     ViewComboBox.Items.Add(new ListItem(LocalizeString("NoneSelectedText"), string.Empty));
     ViewComboBox.AppendDataBoundItems = true;
     ViewComboBox.DataSource           = DnnPathHelper.GetViewNames("FeaturedProducts", "ContentBlocks");
     ViewComboBox.DataBind();
 }
コード例 #5
0
        private void btnCopyDlgSaveChanges_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var user = UserController.Instance.GetCurrentUserInfo();

                string baseVirtualPath;
                if (user.IsSuperUser && chbCopyToHost.Checked)
                {
                    baseVirtualPath = PathHelper.ViewsVirtualPath;
                }
                else
                {
                    baseVirtualPath = DnnPathHelper.GetViewsVirtualPath();
                }

                var virtualPath = VirtualPathUtility.Combine(baseVirtualPath, txtViewSetName.Text);

                var sourceDirectory = new DirectoryInfo(Server.MapPath(ddlViewSets.SelectedValue));
                var targetDirectory = new DirectoryInfo(Server.MapPath(virtualPath));

                if (targetDirectory.Exists)
                {
                    msg.ShowError(Localization.GetString("ExistingViewset"));
                }
                else
                {
                    CopyFilesRecursively(sourceDirectory, targetDirectory);
                    msg.ShowOk(string.Format(Localization.GetString("ViewsetCreated"), targetDirectory.FullName));
                }
            }
        }
コード例 #6
0
        private void FillViewSets()
        {
            ddlViewSets.Items.Clear();

            var hostViewsDir = new DirectoryInfo(Server.MapPath(PathHelper.ViewsVirtualPath));
            var hostViewSets = hostViewsDir.GetDirectories();

            foreach (var hostViewSet in hostViewSets)
            {
                var item = new ListItem();
                item.Text  = string.Format(Localization.GetString("Host"), hostViewSet.Name);
                item.Value = VirtualPathUtility.Combine(PathHelper.ViewsVirtualPath, hostViewSet.Name);
                ddlViewSets.Items.Add(item);
            }

            var siteViewsPath = DnnPathHelper.GetViewsVirtualPath();
            var siteViewsDir  = new DirectoryInfo(Server.MapPath(siteViewsPath));

            if (siteViewsDir.Exists)
            {
                var siteViewSets = siteViewsDir.GetDirectories();

                foreach (var siteViewSet in siteViewSets)
                {
                    var item = new ListItem();
                    item.Text  = string.Format(Localization.GetString("Site"), siteViewSet.Name);
                    item.Value = VirtualPathUtility.Combine(siteViewsPath, siteViewSet.Name);
                    ddlViewSets.Items.Add(item);
                }
            }
        }
コード例 #7
0
        /// <summary>
        ///     Fill dropdown lists
        /// </summary>
        private void FillForm()
        {
            ViewComboBox.Items.Add(new RadComboBoxItem(LocalizeString("NoneSelectedText"), string.Empty));
            ViewComboBox.AppendDataBoundItems = true;
            ViewComboBox.DataSource           = DnnPathHelper.GetViewNames("Category");
            ViewComboBox.DataBind();

            var allCats    = HccApp.CatalogServices.Categories.FindAllSnapshotsPaged(1, 5000);
            var categories = CategoriesHelper.ListFullTreeWithIndentsForComboBox(allCats, false);

            CategoryComboBox.Items.Add(new RadComboBoxItem(LocalizeString("NoneSelectedText"), string.Empty));
            CategoryComboBox.AppendDataBoundItems = true;
            CategoryComboBox.DataSource           = categories;
            CategoryComboBox.DataTextField        = "Text";
            CategoryComboBox.DataValueField       = "Value";
            CategoryComboBox.DataBind();

            var columns = HccApp.ContentServices.Columns.FindAll();

            FillComboBox(ddlPreContentColumnId, columns, "DisplayName", "Bvin",
                         Convert.ToString(ModuleSettings["DefaultPreContentColumnId"]));
            FillComboBox(ddlPostContentColumnId, columns, "DisplayName", "Bvin",
                         Convert.ToString(ModuleSettings["DefaultPostContentColumnId"]));

            FillSortingCheckboxList();
        }
コード例 #8
0
 private void PopulateTemplates()
 {
     ddlTemplateList.Items.Clear();
     ddlTemplateList.Items.Add(new ListItem(Localization.GetString("NotSet"), string.Empty));
     ddlTemplateList.AppendDataBoundItems = true;
     ddlTemplateList.DataSource           = DnnPathHelper.GetViewNames("Products");
     ddlTemplateList.DataBind();
 }
コード例 #9
0
 private void PopulateTemplates()
 {
     ddlTemplateList.Items.Clear();
     ddlTemplateList.Items.Add(new RadComboBoxItem("- Not Set -", string.Empty));
     ddlTemplateList.AppendDataBoundItems = true;
     ddlTemplateList.DataSource           = DnnPathHelper.GetViewNames("Products");
     ddlTemplateList.DataBind();
 }
コード例 #10
0
 private void PopulateTemplates()
 {
     TemplateList.Items.Clear();
     TemplateList.Items.Add(new ListItem("- Not Selected -", string.Empty));
     TemplateList.AppendDataBoundItems = true;
     TemplateList.DataSource           = DnnPathHelper.GetViewNames("Category");
     TemplateList.DataBind();
 }
コード例 #11
0
        private void LoadData()
        {
            ViewComboBox.Items.Add(new ListItem(LocalizeString("NoneSelectedText"), string.Empty));
            ViewComboBox.AppendDataBoundItems = true;
            ViewComboBox.DataSource           = DnnPathHelper.GetViewNames("CategoryMenu");
            ViewComboBox.DataBind();

            var viewText = Convert.ToString(ModuleSettings["View"]);

            ViewContentLabel.Text = LocalizeString("NoneSelectedText");
            if (!string.IsNullOrEmpty(viewText))
            {
                ViewComboBox.SelectedValue = viewText;
                ViewContentLabel.Text      = viewText;
            }

            TitleField.Text = Convert.ToString(ModuleSettings["Title"]);

            ModeField.Items.Clear();
            ModeField.Items.Add(new ListItem(LocalizeString("ModeField_ShowRootOnly"), "0"));
            ModeField.Items.Add(new ListItem(LocalizeString("ModeField_ShowAll"), "1"));
            ModeField.Items.Add(new ListItem(LocalizeString("ModeField_ShowChildrenPeerParents"), "2"));
            ModeField.Items.Add(new ListItem(LocalizeString("ModeField_ShowAllParent"), "3"));
            ModeField.Items.Add(new ListItem(LocalizeString("ModeField_ShowSelected"), "4"));
            ModeField.Items.Add(new ListItem(LocalizeString("ModeField_ShowChildrenSelected"), "5"));

            var mode = ModuleSettings["CategoryMenuMode"] != null ? ModuleSettings["CategoryMenuMode"].ToString() : "0";

            if (ModeField.Items.FindByValue(mode) != null)
            {
                ModeField.Items.FindByValue(mode).Selected = true;
            }

            ProductCountCheckBox.Checked     = Convert.ToBoolean(ModuleSettings["ShowProductCount"]);
            SubCategoryCountCheckBox.Checked = Convert.ToBoolean(ModuleSettings["ShowCategoryCount"]);
            HomeLinkField.Checked            = Convert.ToBoolean(ModuleSettings["HomeLink"]);
            MaximumDepth.Text = Convert.ToString(ModuleSettings["MaximumDepth"]);
            var listCategories     = HccApp.CatalogServices.Categories.FindAll();
            var selectedCategories = Convert.ToString(ModuleSettings["SelectedCategories"])
                                     .Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var cat in listCategories)
            {
                ddlParentCategories.Items.Add(new ListItem(cat.Name, cat.Bvin));

                if (selectedCategories.Contains(cat.Bvin))
                {
                    lstSelectedCategories.Items.Add(new ListItem(cat.Name, cat.Bvin));
                }
                else
                {
                    lstCategories.Items.Add(new ListItem(cat.Name, cat.Bvin));
                }
            }
            ddlParentCategories.SelectedValue = Convert.ToString(ModuleSettings["ChildrenOfCategory"]);
            AdjustShowingFields();
        }
コード例 #12
0
        public void Category_LoadDisplayTemplate()
        {
            //Arrange
            var count = _irepocategory.GetTotalDisplayTemplateCount();

            //Act
            var result = DnnPathHelper.GetViewNames("Category");

            //TODO:Need to change DnnCustomerAccountRepository to set fake portalId

            //Assert
            Assert.AreEqual(count, result.Count);
        }
コード例 #13
0
ファイル: ProductRepositoryTest.cs プロジェクト: wncoder/core
        public void Product_LoadTemplate()
        {
            //Arrange
            var count = _irepoproduct.GetTotalDisplayTemplateCount();

            //Act
            var result = DnnPathHelper.GetViewNames("Products");

            //TODO:Need to change function for CI

            //Assert
            Assert.AreEqual(count, result.Count);
        }
コード例 #14
0
        /// <summary>
        ///     Fills the form.
        /// </summary>
        private void FillForm()
        {
            ViewComboBox.Items.Add(new ListItem(LocalizeString("NoneSelectedText"), string.Empty));
            ViewComboBox.AppendDataBoundItems = true;
            ViewComboBox.DataSource           = DnnPathHelper.GetViewNames("ContentColumn");
            ViewComboBox.DataBind();

            ContentBlocksComboBox.Items.Add(new ListItem(LocalizeString("NoneSelectedText"), string.Empty));
            ContentBlocksComboBox.AppendDataBoundItems = true;
            ContentBlocksComboBox.DataSource           = HccApp.ContentServices.Columns.FindAll();
            ContentBlocksComboBox.DataTextField        = "DisplayName";
            ContentBlocksComboBox.DataValueField       = "Bvin";
            ContentBlocksComboBox.DataBind();
        }
コード例 #15
0
        private void btnUploadDlgSaveChanges_Click(object sender, EventArgs e)
        {
            try
            {
                if (fuViewSet.HasFile)
                {
                    var tempFile = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());
                    fuViewSet.PostedFile.SaveAs(tempFile);

                    var    user = UserController.Instance.GetCurrentUserInfo();
                    string baseVirtualPath;
                    if (user.IsSuperUser && chbUploadToHost.Checked)
                    {
                        baseVirtualPath = PathHelper.ViewsVirtualPath;
                    }
                    else
                    {
                        baseVirtualPath = DnnPathHelper.GetViewsVirtualPath();
                    }

                    var setVirtualPath = VirtualPathUtility.Combine(baseVirtualPath,
                                                                    Path.GetFileNameWithoutExtension(fuViewSet.FileName));
                    var setPath = Server.MapPath(setVirtualPath);
                    ZipUtils.UnZipFiles(tempFile, setPath);

                    msg.ShowOk(Localization.GetString("ViewsetInstalled"));
                }
                else
                {
                    msg.ShowWarning(Localization.GetString("rfvUploadViewset.ErrorMessage"));
                }
            }
            catch (Exception ex)
            {
                EventLog.LogEvent(ex);
                msg.ShowError(Localization.GetString("FailedToUpload"));
            }
        }