Пример #1
0
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            List <Guid> lstDel = GeneralUtilities.GetCheckedItemGuidsByValue(gvPages, true, "chkContent");

            widgetHelper.RemoveVersions(lstDel);

            BindDataGrid();
        }
Пример #2
0
        protected void btnSaveMapping_Click(object sender, EventArgs e)
        {
            List <Guid> lstUpd = GeneralUtilities.GetCheckedItemGuidsByValue(gvPages, true, "chkSelect");

            pageHelper.BulkUpdateTemplate(SiteData.CurrentSiteID, lstUpd, ddlTemplate.SelectedValue);

            LoadGrid();
        }
Пример #3
0
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            List <Guid> lstDel = GeneralUtilities.GetCheckedItemGuidsByValue(gvPages, true, "chkContent");

            pageHelper.RemoveVersions(SiteID, lstDel);

            LoadGrid();

            Master.ShowSave();
        }
Пример #4
0
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            List <Guid> lstDel = GeneralUtilities.GetCheckedItemGuidsByValue(gvPages, true, "chkContent");

            foreach (Guid delID in lstDel)
            {
                ContentSnippet.GetVersion(delID).DeleteThisVersion();
            }

            BindDataGrid();
        }
Пример #5
0
        protected void btnDuplicate_Click(object sender, EventArgs e)
        {
            Guid        gSrc    = new Guid(hdnSelectedItem.Value);
            ContentPage pageSrc = pageHelper.FindContentByID(SiteID, gSrc);

            if (pageSrc != null)
            {
                phDone.Visible = true;
                List <Guid> lstSel = GeneralUtilities.GetCheckedItemGuidsByValue(gvWidgets, true, "chkContent");
                litCount.Text = string.Format(" {0} ", lstSel.Count);

                if (cmsHelper.cmsAdminWidget != null)
                {
                    List <Widget> cacheWidget = cmsHelper.cmsAdminWidget;

                    List <Widget> ww = (from w in pageSrc.GetWidgetList()
                                        where lstSel.Contains(w.Root_WidgetID) && w.IsLatestVersion == true
                                        select w).ToList();

                    if (ww != null)
                    {
                        foreach (var w in ww)
                        {
                            Guid newWidget = Guid.NewGuid();

                            Widget wCpy = new Widget {
                                Root_ContentID        = guidContentID,
                                Root_WidgetID         = newWidget,
                                WidgetDataID          = Guid.NewGuid(),
                                PlaceholderName       = sZone,
                                ControlPath           = w.ControlPath,
                                ControlProperties     = w.ControlProperties,
                                IsLatestVersion       = true,
                                IsPendingChange       = true,
                                IsWidgetActive        = true,
                                IsWidgetPendingDelete = false,
                                WidgetOrder           = w.WidgetOrder,
                                GoLiveDate            = w.GoLiveDate,
                                RetireDate            = w.RetireDate,
                                EditDate = SiteData.CurrentSite.Now
                            };

                            cacheWidget.Add(wCpy);
                        }
                    }

                    cmsHelper.cmsAdminWidget = cacheWidget;
                }
            }
        }
Пример #6
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            List <Guid> lsActive = GeneralUtilities.GetCheckedItemGuidsByValue(gvPages, true, "chkContent");

            widgetHelper.SetStatusList(guidContentID, lsActive, true);

            List <Guid> lsInactive = GeneralUtilities.GetCheckedItemGuidsByValue(gvPages, false, "chkContent");

            widgetHelper.SetStatusList(guidContentID, lsInactive, false);

            LoadGrid();

            Master.ShowSave();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List <CMSTextWidgetPicker> lst = PickerValues;

            List <Guid> lstUpd1 = GeneralUtilities.GetCheckedItemGuidsByValue(gvContent, true, "chkSelect1");
            List <Guid> lstUpd2 = GeneralUtilities.GetCheckedItemGuidsByValue(gvContent, true, "chkSelect2");
            List <Guid> lstUpd3 = GeneralUtilities.GetCheckedItemGuidsByValue(gvContent, true, "chkSelect3");
            List <Guid> lstUpd4 = GeneralUtilities.GetCheckedItemGuidsByValue(gvContent, true, "chkSelect4");
            List <Guid> lstUpd5 = GeneralUtilities.GetCheckedItemGuidsByValue(gvContent, true, "chkSelect5");

            lst.ForEach(x => {
                x.ProcessBody      = lstUpd1.Contains(x.TextWidgetPickerID);
                x.ProcessPlainText = lstUpd2.Contains(x.TextWidgetPickerID);
                x.ProcessHTMLText  = lstUpd3.Contains(x.TextWidgetPickerID);
                x.ProcessComment   = lstUpd4.Contains(x.TextWidgetPickerID);
                x.ProcessSnippet   = lstUpd5.Contains(x.TextWidgetPickerID);
            });

            foreach (CMSTextWidgetPicker w in lst)
            {
                TextWidget ww = new TextWidget();
                ww.SiteID             = SiteID;
                ww.TextWidgetID       = w.TextWidgetPickerID;
                ww.TextWidgetAssembly = w.AssemblyString;

                ww.ProcessBody      = w.ProcessBody;
                ww.ProcessPlainText = w.ProcessPlainText;
                ww.ProcessHTMLText  = w.ProcessHTMLText;
                ww.ProcessComment   = w.ProcessComment;
                ww.ProcessSnippet   = w.ProcessSnippet;

                if (ww.ProcessBody || ww.ProcessPlainText || ww.ProcessHTMLText || ww.ProcessComment || ww.ProcessSnippet)
                {
                    ww.Save();
                }
                else
                {
                    ww.Delete();
                }
            }

            if (SiteData.CurretSiteExists)
            {
                SiteData.CurrentSite.LoadTextWidgets();
            }

            Response.Redirect(SiteData.CurrentScriptName);
        }