コード例 #1
0
ファイル: producttypes.aspx.cs プロジェクト: jaytem/minGit
    protected void Display_EditProductType()
    {
        _ProductType = new ProductType(m_refContentApi.RequestInformationRef);
            _ProductTypeData = _ProductType.GetItem(m_iID, true);

            phTabAttributes.Visible = true;
            phTabMediaDefaults.Visible = true;

            tr_id.Visible = true;
            txt_id.Text = _ProductTypeData.Id.ToString();
            phAddEdit.Visible = true;
            txtTitle.Attributes.Add("onkeypress", "return " + JSLibrary.CheckKeyValueName+ "(event, \'34,13\');");
            txtDescription.Attributes.Add("onkeypress", "return " + JSLibrary.CheckKeyValueName+ "(event, \'34,13\');");

            Util_PopulateData();
            drp_type.Enabled = false;

            if (_ProductTypeData.EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct)
            {

                drp_SubscriptionProvider.Items.Add(new ListItem("MembershipSubscriptionProvider"));
                drp_SubscriptionProvider.SelectedIndex = 0;

            }

            Util_XSLTLinks();
            Util_AddProductTypeItems(_ProductTypeData.EntryClass);
            Util_SetJs();
            Util_SetLabels();
    }
コード例 #2
0
ファイル: producttypes.aspx.cs プロジェクト: jaytem/minGit
    protected void Display_ViewProductType()
    {
        _ProductType = new ProductType(m_refContentApi.RequestInformationRef);
            _ProductTypeData = _ProductType.GetItem(m_iID, true);

            _IsUsed = _ProductType.IsProductTypeUsed(m_iID);

            tr_id.Visible = true;
            txt_id.Text = _ProductTypeData.Id.ToString();
            phAddEdit.Visible = false;
            phView.Visible = true;
            phTabAttributes.Visible = true;
            phTabMediaDefaults.Visible = true;
            txtTitle.Attributes.Add("onkeypress", "return " + JSLibrary.CheckKeyValueName+ "(event, \'34,13\');");
            txtDescription.Attributes.Add("onkeypress", "return " + JSLibrary.CheckKeyValueName+ "(event, \'34,13\');");

            XmlConfigData xml_config_data;
            xml_config_data = m_refContentApi.GetXmlConfiguration(m_iID);
            PopulatePropertiesGrid(xml_config_data, Convert.ToInt64(_ProductTypeData.EntryClass), _ProductTypeData.SubscriptionProvider);
            PopulateDisplayGrid(xml_config_data);
            if (xml_config_data.PackageDisplayXslt.Length > 0)
            {
                PopulatePreviewGrid(xml_config_data);
                phPreview.Visible = true;
                phTabPreview.Visible = true;
            }
            else
            {
                phTabPreview.Visible = false;
                phPreview.Visible = false;
            }

            Util_PopulateData();
            Util_XSLTLinks();
            Util_AddProductTypeItems(_ProductTypeData.EntryClass);
            Util_SetJs();
            Util_SetLabels();
    }
コード例 #3
0
ファイル: producttypes.aspx.cs プロジェクト: jaytem/minGit
    public void Process_EditProductType()
    {
        try
            {
                _ProductType = new ProductType(m_refContentApi.RequestInformationRef);
                _ProductTypeData = _ProductType.GetItem(m_iID, true);

                _ProductTypeData.Title = (string) txtTitle.Text;
                _ProductTypeData.Description = (string) txtDescription.Text;
                _ProductTypeData.DefaultXslt = (string) (Request.Form["frm_xsltdefault"].Replace("frm_xsltdefault", ""));
                _ProductTypeData.Xslt1 = (string) txt_xslt1.Text;
                _ProductTypeData.Xslt2 = (string) txt_xslt2.Text;
                _ProductTypeData.Xslt3 = (string) txt_xslt3.Text;
                _ProductTypeData.PhysicalPath = Server.MapPath(m_refContentApi.XmlPath);
                _ProductTypeData.Attributes = Process_GetAttributes();
                _ProductTypeData.DefaultThumbnails = Process_GetThumbnails();
                if (_ProductTypeData.EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct)
                {
                    _ProductTypeData.SubscriptionProvider = Request.Form["drp_SubscriptionProvider"];
                }

                _ProductType.Update(_ProductTypeData);
                Response.Redirect(_PageName + "?action=viewproducttype&id=" + m_iID, false);

            }
            catch (Ektron.Cms.Exceptions.SpecialCharactersException)
            {

                trError.Visible = true;
                litErrorMessage.Text = string.Format(GetMessage("js alert product type title cant include"), EkFunctions.HtmlEncode("<,>"));
                Display_EditProductType();

            }
            catch (Exception ex)
            {
                trError.Visible = true;
                litErrorMessage.Text = ex.Message.ToString();
                Display_EditProductType();
                // Utilities.ShowError()

            }
    }
コード例 #4
0
ファイル: producttypes.aspx.cs プロジェクト: jaytem/minGit
    protected void Display_AddThumbnail()
    {
        phAddThumbnail.Visible = true;
            _ProductType = new ProductType(m_refContentApi.RequestInformationRef);
            if (this.m_iID > 0)
            {
                _ProductTypeData = _ProductType.GetItem(m_iID, true);
            }

            Util_SetJs();
            Util_SetLabels();
    }
コード例 #5
0
ファイル: producttypes.aspx.cs プロジェクト: jaytem/minGit
    private void Page_Init(System.Object sender, System.EventArgs e)
    {
        //register page resources
            this.RegisterJS();
            this.RegisterCSS();

            _MessageHelper = _ContentApi.EkMsgRef;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                _ProductType = new ProductType(m_refContentApi.RequestInformationRef);
                ProductTypeData myProductTypeData = _ProductType.GetItem(Convert.ToInt64(Request.QueryString["id"]), true);

                this.ucAttributes.ProductData = myProductTypeData;
                this.ucAttributes.DisplayMode = Ektron.Cms.Commerce.Workarea.ProductTypes.Tabs.Attributes.DisplayModeValue.View;
                this.ucAttributesEdit.ProductData = myProductTypeData;
                this.ucAttributesEdit.DisplayMode = Ektron.Cms.Commerce.Workarea.ProductTypes.Tabs.Attributes.DisplayModeValue.Edit;

                this.ucMediaDefaults.ProductData = myProductTypeData;
                this.ucMediaDefaults.DisplayMode = Ektron.Cms.Commerce.Workarea.ProductTypes.Tabs.MediaDefaults.DisplayModeValue.View;
                this.ucMediaDefaultsEdit.ProductData = myProductTypeData;
                this.ucMediaDefaultsEdit.DisplayMode = Ektron.Cms.Commerce.Workarea.ProductTypes.Tabs.MediaDefaults.DisplayModeValue.Edit;
            }

            if (Request.QueryString["action"] == "addproducttype")
            {
                this.ucAttributesEdit.DisplayMode = Ektron.Cms.Commerce.Workarea.ProductTypes.Tabs.Attributes.DisplayModeValue.Edit;
                this.ucMediaDefaultsEdit.DisplayMode = Ektron.Cms.Commerce.Workarea.ProductTypes.Tabs.MediaDefaults.DisplayModeValue.Edit;
            }
    }
コード例 #6
0
ファイル: CatalogEntry.aspx.cs プロジェクト: jaytem/minGit
 public void Process_Edit()
 {
     if (!string.IsNullOrEmpty(Request.Form["hdn_xmlid"]) && Convert.ToInt64(Request.Form["hdn_xmlid"]) > 0)
     {
         m_refProductType = new ProductType(m_refContentApi.RequestInformationRef);
         prod_type_data = m_refProductType.GetItem(Convert.ToInt64(Request.Form["hdn_xmlid"]), true);
         xid = prod_type_data.Id;
         Util_SetXmlId(xid);
     }
     if (Request.Form["hdn_entrytype"] == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct.ToString())
     {
         Process_EditSubscription();
     }
     else if (Request.Form["hdn_entrytype"] == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle.ToString())
     {
         Process_EditBundle();
     }
     else if (Request.Form["hdn_entrytype"] == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit.ToString())
     {
         Process_EditKit();
     }
     else if ((Request.Form["hdn_entrytype"] == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product.ToString()) || (Request.Form["hdn_entrytype"] == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.ComplexProduct.ToString()))
     {
         Process_EditProduct();
     }
 }
コード例 #7
0
ファイル: CatalogEntry.aspx.cs プロジェクト: jaytem/minGit
        protected void Util_ObtainValues()
        {
            if (Request.QueryString["back_LangType"] != "")
            {
                backLangType = Convert.ToInt64(Request.QueryString["back_LangType"]);
            }
            if (Request.QueryString["content_id"] != "")
            {
                otherLangId = Convert.ToInt64(Request.QueryString["content_id"]);
            }
            if (Request.QueryString["type"] != "")
            {
                m_sEditAction = Request.QueryString["type"];
            }
            if (!(Request.QueryString["folder_id"] == null)) // add
            {
                m_iFolder = Convert.ToInt64(Request.QueryString["folder_id"]);
            }
            if (!(Request.QueryString["back_folder_id"] == null)) // edit
            {
                m_iFolder = Convert.ToInt64(Request.QueryString["back_folder_id"]);
            }
            if (Request.QueryString["xid"] != "")
            {
                xid = Convert.ToInt64(Request.QueryString["xid"]);
                if (xid > 0)
                {
                    m_refProductType = new ProductType(m_refContentApi.RequestInformationRef);
                    prod_type_data = m_refProductType.GetItem(xid, true);
                    this.editorPackage = prod_type_data.PackageXslt;
                    hdn_entrytype.Value = prod_type_data.EntryClass.ToString();
                }
            }
            Util_SetXmlId(xid);

            m_cPerms = m_refContentApi.LoadPermissions(m_iFolder, "folder", 0);

            if (Request.QueryString["incontext"] != "")
            {
                _inContextEditing = Convert.ToBoolean(Request.QueryString["incontext"]);
            }

            //m_mMeasures = New Measurements(m_refContentApi.RequestInformationRef).GetMeasurements()
        }
コード例 #8
0
ファイル: CatalogEntry.aspx.cs プロジェクト: jaytem/minGit
        protected override void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                base.Page_Load(sender, e);
                if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce))
                {
                    throw (new Exception(GetMessage("feature locked error")));
                }
                Util_ObtainValues();
                Util_CheckAccess();
                m_refCatalog = new Ektron.Cms.Commerce.CatalogEntry(m_refContentApi.RequestInformationRef);
                m_refCurrency = new Currency(m_refContentApi.RequestInformationRef);
                m_refContent = m_refContentApi.EkContentRef;
                hdn_defaultCurrency.Value = m_refContentApi.RequestInformationRef.CommerceSettings.DefaultCurrencyId.ToString();

                switch (this.m_sEditAction)
                {
                    case "add":
                    case "addlang":
                        m_iFolder = this.m_iID;
                        if (!Page.IsPostBack)
                        {
                            UserRights = m_refContentApi.LoadPermissions(m_iFolder, "folder", ContentAPI.PermissionResultType.Folder);
                            ContentMetaData[] defaultMeta;
                            Util_CheckFolderType();
                            if (m_sEditAction == "addlang")
                            {
                                entry_edit_data = m_refCatalog.GetItem(otherLangId, backLangType);
                                if (entry_edit_data.ProductType.Id > 0)
                                {
                                    m_refProductType = new ProductType(m_refContentApi.RequestInformationRef);
                                    prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true);
                                    editorPackage = prod_type_data.PackageXslt;
                                    xid = prod_type_data.Id;
                                    Util_SetXmlId(xid);
                                    hdn_entrytype.Value = entry_edit_data.EntryType.ToString();
                                }
                            }
                            if (entry_edit_data == null)
                            {
                                Util_GetEntryType();
                            }
                            defaultMeta = m_refContentApi.GetMetaDataTypes("id");
                            if ((defaultMeta != null) && defaultMeta.Length > 0)
                            {
                                meta_data.AddRange(defaultMeta);
                            }
                            Display_ContentTab();
                            Display_SummaryTab();
                            Display_EntryTab();
                            Display_PricingTab();
                            Display_MediaTab();
                            Display_ItemTab();
                            Display_MetadataTab();
                            Display_ScheduleTab();
                            Display_TaxonomyTab();
                            Display_CommentTab();
                            Display_TemplateTab();
                            if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                            {
                                Display_AliasTab();
                            }
                            Util_SetLabels();
                        }
                        else
                        {
                            Process_Add();
                        }
                        break;
                    case "update":
                        if (!Page.IsPostBack)
                        {
                            UserRights = m_refContentApi.LoadPermissions(m_iID, "content", ContentAPI.PermissionResultType.Content);
                            if (PullApproval)
                                this.m_refContent.TakeOwnership(m_iID);
                            entry_edit_data = m_refCatalog.GetItemEdit(m_iID, m_refContentApi.RequestInformationRef.ContentLanguage, true);
                            if (entry_edit_data.ProductType.Id > 0)
                            {
                                m_refProductType = new ProductType(m_refContentApi.RequestInformationRef);
                                prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true);
                                editorPackage = prod_type_data.PackageXslt;
                                xid = prod_type_data.Id;
                                Util_SetXmlId(xid);
                                hdn_entrytype.Value = entry_edit_data.EntryType.ToString();
                            }
                            meta_data = entry_edit_data.Metadata;
                            m_iFolder = entry_edit_data.FolderId;
                            Util_CheckFolderType();
                            Display_ContentTab();
                            Display_SummaryTab();
                            Display_EntryTab();
                            Display_PricingTab();
                            Display_MediaTab();
                            Display_ItemTab();
                            Display_MetadataTab();
                            Display_ScheduleTab();
                            Display_TaxonomyTab();
                            Display_CommentTab();
                            Display_TemplateTab();
                            if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                            {
                                Display_AliasTab();
                            }
                            Util_SetLabels();
                        }
                        else
                        {
                            Process_Edit();
                        }
                        break;
                }
                Util_SetJS();

                if (prod_type_data != null)
                {
                    hdn_productType.Value = prod_type_data.EntryClass.ToString();
                }

                this.RegisterJs();
                this.RegisterCss();
                if (catalog_data != null)
                {
                    chk_searchable.Checked = catalog_data.IscontentSearchable;
                }

                //-------------------DisplayTabs Based on selected options from Folder properties----------------------------------
                if (((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) == (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) && catalog_data.DisplaySettings != 0)
                {
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Summary) == (int)EkEnumeration.FolderTabDisplaySettings.Summary)
                    { divSummary.Visible = true; }
                    else
                    {
                        divSummary.Visible = false;
                        liSummary.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.MetaData) == (int)EkEnumeration.FolderTabDisplaySettings.MetaData)
                    { divMetadata.Visible = true; }
                    else
                    {
                        if (!metadataRequired)
                        {
                            divMetadata.Visible = false;
                            liMetadata.Visible = false;
                        }
                    }
                    if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                    {

                        if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) == (int)EkEnumeration.FolderTabDisplaySettings.Aliasing)
                        { divAlias.Visible = true; }
                        else
                        {
                            if (!catalog_data.AliasRequired)
                            {
                                divAlias.Visible = false;
                                liAlias.Visible = false;
                            }
                        }
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Schedule) == (int)EkEnumeration.FolderTabDisplaySettings.Schedule)
                    { divSchedule.Visible = true; }
                    else
                    {
                        divSchedule.Visible = false;
                        liSchedule.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Comment) == (int)EkEnumeration.FolderTabDisplaySettings.Comment)
                    { divComment.Visible = true; }
                    else
                    {
                        divComment.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Templates) == (int)EkEnumeration.FolderTabDisplaySettings.Templates)
                    { divTemplates.Visible = true; }
                    else
                    {
                        divTemplates.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) == (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy)
                    { divCategories.Visible = true; }
                    else
                    {
                        if (!catalog_data.IsCategoryRequired)
                        {
                            divCategories.Visible = false;
                            liCategory.Visible = false;
                        }
                    }
                }

                //-------------------DisplayTabs Based on selected options from Folder properties End------------------------------
            }
            catch (Exception ex)
            {

                Utilities.ShowError(ex.Message);

            }
        }
コード例 #9
0
ファイル: AddImage.aspx.cs プロジェクト: jaytem/minGit
        protected void Page_Init(object sender, System.EventArgs e)
        {
            _MessageHelper = _ContentApi.EkMsgRef;
                _ProductType = new ProductType(_ContentApi.RequestInformationRef);
                Response.CacheControl = "no-cache";
                Response.AddHeader("Pragma", "no-cache");
                Response.Expires = -1;

                if (! Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce))
                {
                    Utilities.ShowError(_ContentApi.EkMsgRef.GetMessage("feature locked error"));
                }

                if (!string.IsNullOrEmpty(Request.QueryString["productTypeId"]))
                {
                    _Id = Convert.ToInt64(Request.QueryString["productTypeId"]);
                }

                lib_settings_data = this._ContentApi.GetLibrarySettings(0);

                SetLocalizedStrings();

                btnUpload.Attributes.Add("onclick", "return checkForEmptyTitleAndAlt(); return checkntoggle(document.getElementById(\'dvHoldMessage\'),document.getElementById(\'dvErrorMessage\'));");
                btnUpload.Text = this.GetMessage("upload txt");

                _ProductTypeData = _ProductType.GetItem(_Id);
        }