コード例 #1
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            if (mc == null)
            {
                if (OwnerClassName != String.Empty)
                {
                    MetaClass ownerClass = MetaDataWrapper.GetMetaClassByName(OwnerClassName);
                    ddlClass.Items.Add(new ListItem(CHelper.GetResFileString(ownerClass.FriendlyName), ownerClass.Name));
                    ddlClass.Enabled = false;
                }
                else
                {
                    foreach (MetaClass cls in MetaDataWrapper.GetMetaClassesSupportedCards())
                    {
                        ddlClass.Items.Add(new ListItem(cls.Name, cls.Name));
                    }
                }

                txtClassName.Attributes.Add("onblur", "SetName('" + txtClassName.ClientID + "','" + txtClassFriendlyName.ClientID + "','" + vldClassFriendlyName_Required.ClientID + "')" + "; SetName('" + txtClassName.ClientID + "','" + txtClassPluralName.ClientID + "','" + vldClassPluralName_Required.ClientID + "')");
            }
            else
            {
                MetaClass ownerClass = MetaDataWrapper.GetOwnerClass(mc);
                ddlClass.Items.Add(new ListItem(ownerClass.Name, ownerClass.Name));
                ddlClass.Enabled = false;

                txtClassName.Text    = mc.Name;
                txtClassName.Enabled = false;

                txtClassFriendlyName.Text = mc.FriendlyName;
                txtClassPluralName.Text   = mc.PluralName;
            }
        }
コード例 #2
0
ファイル: MetaClassInfo.ascx.cs プロジェクト: alex765022/IBN
        private void BindData(MetaClass mc)
        {
            MoreInfoRow.Visible = false;

            // Labels
            ClassNameLabel.Text = mc.Name;

            FriendlyNameLabel.Text = CHelper.GetResFileString(mc.FriendlyName);

            FriendlyNameLink.Text        = CHelper.GetResFileString(mc.FriendlyName);
            FriendlyNameLink.NavigateUrl = String.Format(CultureInfo.InvariantCulture,
                                                         "~/Apps/MetaUIEntity/Pages/EntityList.aspx?ClassName={0}",
                                                         mc.Name);

            // Ibn 4.7 fix
            if (mc.Name.ToLower().IndexOf("timetracking") >= 0)
            {
                FriendlyNameLabel.Visible = true;
                FriendlyNameLink.Visible  = false;
            }
            else
            {
                FriendlyNameLabel.Visible = false;
                FriendlyNameLink.Visible  = true;
            }

            PluralNameLabel.Text = CHelper.GetResFileString(mc.PluralName);
            if (mc.Attributes.ContainsKey(MetaClassAttribute.IsBridge))
            {
                TypeLabel.Text          = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Bridge").ToString();
                ClassTypeImage.ImageUrl = "~/images/IbnFramework/metainfo/bridge.gif";
                if (mc.Attributes.ContainsKey(MetaClassAttribute.IsSystem))
                {
                    ClassTypeImage.ImageUrl = "~/images/IbnFramework/metainfo/bridge_sys.gif";
                }
            }
            else if (mc.Attributes.ContainsKey(MetaClassAttribute.IsCard))
            {
                TypeLabel.Text          = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "BusinessObjectExtension").ToString();
                ClassTypeImage.ImageUrl = "~/images/IbnFramework/metainfo/card.gif";
                if (mc.Attributes.ContainsKey(MetaClassAttribute.IsSystem))
                {
                    ClassTypeImage.ImageUrl = "~/images/IbnFramework/metainfo/card_sys.gif";
                }
            }
            else
            {
                TypeLabel.Text          = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Info").ToString();
                ClassTypeImage.ImageUrl = "~/images/IbnFramework/metainfo/metaclass.gif";
                if (mc.Attributes.ContainsKey(MetaClassAttribute.IsSystem))
                {
                    ClassTypeImage.ImageUrl = "~/images/IbnFramework/metainfo/metaclass_sys.gif";
                }
            }

            // O.R.: we don't use this attribute

            /*
             * // Public or Private (Department or User)
             * if (mc.Attributes.ContainsKey(MetaDataWrapper.OwnerTypeAttr))
             *      TypeLabel.Text += String.Format(" ({0})", mc.Attributes[MetaDataWrapper.OwnerTypeAttr].ToString());
             */

            // Owner class for Card
            MetaClass ownerClass = MetaDataWrapper.GetOwnerClass(mc);

            if (ownerClass != null)
            {
                MoreInfoValue.Text = String.Format("<a href='MetaClassView.aspx?class={0}'>{1}</a>", ownerClass.Name, CHelper.GetResFileString(ownerClass.FriendlyName));

                MoreInfoRow.Visible = true;
                MoreInfoLabel.Text  = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "TableOwner").ToString() + ":";
            }

            // Cards for owner class
            if (mc.SupportsCards)
            {
                MetaClass[] cards = mc.GetCards();
                if (cards.Length > 0)
                {
                    MoreInfoRow.Visible = true;
                    MoreInfoLabel.Text  = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Cards").ToString() + ":";

                    string sCards = "";
                    foreach (MetaClass card in cards)
                    {
                        if (sCards != "")
                        {
                            sCards += ", ";
                        }

                        sCards += String.Format("<a href='MetaClassView.aspx?class={0}'>{1}</a>", card.Name, CHelper.GetResFileString(card.FriendlyName));
                    }
                    MoreInfoValue.Text = sCards;
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        /// <param name="mc">The mc.</param>
        private void BindData(MetaClass mc)
        {
            trMoreInfo.Visible = false;

            // Labels
            lblClassName.Text = mc.Name;

            lblFriendlyName.Text = CHelper.GetResFileString(mc.FriendlyName);
            lblPluralName.Text   = CHelper.GetResFileString(mc.PluralName);
            if (mc.Attributes.ContainsKey(MetaClassAttribute.IsBridge))
            {
                lblType.Text         = GetGlobalResourceObject("GlobalMetaInfo", "Bridge").ToString();
                imClassType.ImageUrl = "../../images/metainfo/bridge.gif";
                if (mc.Attributes.ContainsKey(MetaClassAttribute.IsSystem))
                {
                    imClassType.ImageUrl = "../../images/metainfo/bridge_sys.gif";
                }
            }
            else if (mc.Attributes.ContainsKey(MetaClassAttribute.IsCard))
            {
                lblType.Text         = GetGlobalResourceObject("GlobalMetaInfo", "BusinessObjectExtension").ToString();
                imClassType.ImageUrl = "../../images/metainfo/card.gif";
                if (mc.Attributes.ContainsKey(MetaClassAttribute.IsSystem))
                {
                    imClassType.ImageUrl = "../../images/metainfo/card_sys.gif";
                }
            }
            else
            {
                lblType.Text         = GetGlobalResourceObject("GlobalMetaInfo", "Info").ToString();
                imClassType.ImageUrl = "../../images/metainfo/metaclass.gif";
                if (mc.Attributes.ContainsKey(MetaClassAttribute.IsSystem))
                {
                    imClassType.ImageUrl = "../../images/metainfo/metaclass_sys.gif";
                }
            }

            // Public or Private (Department or User)
            if (mc.Attributes.ContainsKey(MetaDataWrapper.OwnerTypeAttr))
            {
                lblType.Text += String.Format(" ({0})", mc.Attributes[MetaDataWrapper.OwnerTypeAttr].ToString());
            }

            // Owner class for Card
            MetaClass ownerClass = MetaDataWrapper.GetOwnerClass(mc);

            if (ownerClass != null)
            {
                lblMoreInfo.Text = String.Format("<a href='MetaClassView.aspx?class={0}'>{1}</a>", ownerClass.Name, ownerClass.Name);

                trMoreInfo.Visible    = true;
                lblMoreInfoLabel.Text = GetGlobalResourceObject("GlobalMetaInfo", "TableOwner").ToString() + ":";
            }

            // Cards for owner class
            if (mc.SupportsCards)
            {
                MetaClass[] cards = mc.GetCards();
                if (cards.Length > 0)
                {
                    trMoreInfo.Visible    = true;
                    lblMoreInfoLabel.Text = GetGlobalResourceObject("GlobalMetaInfo", "Cards").ToString() + ":";

                    string sCards = "";
                    foreach (MetaClass card in cards)
                    {
                        if (sCards != "")
                        {
                            sCards += ", ";
                        }

                        sCards += String.Format("<a href='MetaClassView.aspx?class={0}'>{1}</a>", CHelper.GetResFileString(card.FriendlyName), card.Name);
                    }
                    lblMoreInfo.Text = sCards;
                }
            }
        }