Exemplo n.º 1
0
    public void Process_AddProductType()
    {
        try
            {

                _ProductType = new ProductType(m_refContentApi.RequestInformationRef);
                _ProductTypeData = new ProductTypeData();

                _ProductTypeData.EntryClass = (EkEnumeration.CatalogEntryType)Enum.Parse(typeof(EkEnumeration.CatalogEntryType),Request.Form[drp_type.UniqueID]);
                _ProductTypeData.Title = Request.Form[txtTitle.UniqueID];
                _ProductTypeData.Description = Request.Form[txtDescription.UniqueID];
                _ProductTypeData.EditXslt = "";
                _ProductTypeData.SaveXslt = "";
                _ProductTypeData.Xslt1 = "";
                _ProductTypeData.Xslt2 = "";
                _ProductTypeData.Xslt3 = "";
                _ProductTypeData.Xslt4 = "";
                _ProductTypeData.Xslt5 = "";
                _ProductTypeData.XmlSchema = "";
                _ProductTypeData.XmlNameSpace = "";
                _ProductTypeData.XmlAdvConfig = "";
                _ProductTypeData.DefaultXslt = "0";
                _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"];
                }

                _ProductTypeData = _ProductType.Add(_ProductTypeData);
                Response.Redirect((string) ("../editdesign.aspx?action=EditPackage&type=product&id=" + _ProductTypeData.Id.ToString()), false);

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

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

                Display_AddProductType();

            }
            catch (Exception ex)
            {

                trError.Visible = true;
                litErrorMessage.Text = ex.Message.ToString();
                Display_AddProductType();

            }
    }