Пример #1
0
        private void BindData()
        {
            string str = MetaIdentifierType.Field.ToString();

            ddlScope.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Scope" + str).ToString(), str));
            str = MetaIdentifierType.Class.ToString();
            ddlScope.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Scope" + str).ToString(), str));
            str = MetaIdentifierType.Global.ToString();
            ddlScope.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Scope" + str).ToString(), str));

            str = MetaIdentifierPeriodType.None.ToString();
            ddlCounterReset.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "CounterReset" + str).ToString(), str));
            str = MetaIdentifierPeriodType.Year.ToString();
            ddlCounterReset.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "CounterReset" + str).ToString(), str));
            str = MetaIdentifierPeriodType.Quarter.ToString();
            ddlCounterReset.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "CounterReset" + str).ToString(), str));
            str = MetaIdentifierPeriodType.Month.ToString();
            ddlCounterReset.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "CounterReset" + str).ToString(), str));
            str = MetaIdentifierPeriodType.Day.ToString();
            ddlCounterReset.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "CounterReset" + str).ToString(), str));
            if (IdName != string.Empty)
            {
                MetaFieldType mft = MetaDataWrapper.GetIdentifierByName(IdName);
                if (mft != null)
                {
                    txtName.Text         = mft.Name;
                    txtName.ReadOnly     = true;
                    txtName.CssClass     = "text-readonly";
                    txtFriendlyName.Text = mft.FriendlyName;
                    if (mft.Attributes.ContainsKey(McDataTypeAttribute.IdentifierType) && mft.Attributes[McDataTypeAttribute.IdentifierType] != null)
                    {
                        ddlScope.SelectedValue = mft.Attributes[McDataTypeAttribute.IdentifierType].ToString();
                    }
                    ddlScope.Enabled = false;
                    if (mft.Attributes.ContainsKey(McDataTypeAttribute.IdentifierPeriodType) && mft.Attributes[McDataTypeAttribute.IdentifierPeriodType] != null)
                    {
                        ddlCounterReset.SelectedValue = mft.Attributes[McDataTypeAttribute.IdentifierPeriodType].ToString();
                    }
                    if (mft.Attributes.ContainsKey(McDataTypeAttribute.IdentifierMask) && mft.Attributes[McDataTypeAttribute.IdentifierMask] != null)
                    {
                        txtMask.Text = mft.Attributes[McDataTypeAttribute.IdentifierMask].ToString();
                    }
                    if (mft.Attributes.ContainsKey(McDataTypeAttribute.IdentifierMaskDigitLength) && mft.Attributes[McDataTypeAttribute.IdentifierMaskDigitLength] != null)
                    {
                        txtCounterLen.Text = mft.Attributes[McDataTypeAttribute.IdentifierMaskDigitLength].ToString();
                    }
                }
            }
        }
Пример #2
0
        protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                MetaFieldType type = MetaDataWrapper.GetIdentifierByName(e.CommandArgument.ToString());

                if (!MetaIdentifier.IsUsed(type))
                {
                    MetaIdentifier.Remove(type);
                }

                BindData();
            }
            if (e.CommandName == "Edit")
            {
                Response.Redirect("~/Apps/MetaDataBase/Pages/Admin/IdentifierEdit.aspx?type=" + e.CommandArgument.ToString() + "&back=list");
            }
        }