Ejemplo n.º 1
0
        private bool doesPropertyTypeAliasExist(GenericProperty gpData)
        {
            bool        hasAlias = cType.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
            ContentType ct       = cType;

            while (ct.MasterContentType > 0)
            {
                ct       = new ContentType(ct.MasterContentType);
                hasAlias = ct.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
            }
            return(!hasAlias);
        }
Ejemplo n.º 2
0
            private void AddPropertyType(object sender, System.EventArgs e)
            {
                if (NameTxt.Text.Trim() != "" && AliasTxt.Text.Trim() != "")
                {
                    string[] info = { NameTxt.Text, DataTypeDDL.SelectedItem.Value };
                    ctctrl.prnt.speechBubble(BasePages.BasePage.speechBubbleIcon.info, ui.Text("speechBubbles", "contentTypePropertyTypeCreated", null), ui.Text("speechBubbles", "contentTypePropertyTypeCreatedText", info, null));
                    _dt.AddPropertyType(cms.businesslogic.datatype.DataTypeDefinition.GetDataTypeDefinition(int.Parse(DataTypeDDL.SelectedValue)), AliasTxt.Text, NameTxt.Text);

                    if (int.Parse(TabDDL.SelectedValue) != 0)
                    {
                        _dt.SetTabOnPropertyType(_dt.getPropertyType(AliasTxt.Text), int.Parse(TabDDL.SelectedValue));
                    }
                    ctctrl.GenericPropertyTypes.Controls.Clear();
                    ctctrl.loadGenericPropertyTypesOnPane();
                    NameTxt.Text  = "";
                    AliasTxt.Text = "";
                    // fire event to tell that a new propertytype is created!!
                    ctctrl.OnPropertyTypeCreate(this, new System.EventArgs());
                }
                else
                {
                    ctctrl.prnt.speechBubble(BasePages.BasePage.speechBubbleIcon.error, ui.Text("error"), ui.Text("errors", "contentTypeAliasAndNameNotNull", null));
                }
            }