private void AddChild()
    {
        string groupCode = WebUtil.Param("groupCode");

        if (!string.IsNullOrEmpty(groupCode))
        {
            DictionaryItem item = DictionaryItem.Retrieve(_session, groupCode);
            if (item == null)
            {
                WebUtil.ShowMsg(this, "传入的组代码找不到");
                this.txtStringValue.Disabled = true;
                return;
            }

            this.trGroupCode.Visible = true;
            this.txtGroupCode.Text   = groupCode;
            this.txtGroupName.Text   = item.Name;
        }
    }
Beispiel #2
0
    protected void OnCommandHandler(object sender, CommandEventArgs e)
    {
        using (_session = new Session())
        {
            if (e.CommandName == "DeleteSubItem")
            {
                string         itemCode = e.CommandArgument.ToString();
                DictionaryItem item     = DictionaryItem.Retrieve(_session, itemCode);
                if (item != null)
                {
                    if (item.Delete(_session))
                    {
                        QueryAndBindData(this.magicPagerMain.CurrentPageIndex, this.magicPagerMain.PageSize, true);
                    }
                }

                WebUtil.ShowMsg(this, "删除成功!");
            }
        }
        WebUtil.ShowMsg(this, e.CommandName);
    }
    private void LoadData()
    {
        hidItemCode.Value = WebUtil.Param("itemCode");
        string itemCode = WebUtil.Param("itemCode");

        DictionaryItem dictionaryItem = null;

        dictionaryItem = DictionaryItem.Retrieve(_session, itemCode);

        if (dictionaryItem != null)
        {
            txtCode.Text      = hidItemCode.Value;
            txtCode.Enabled   = false;
            txtGroupCode.Text = dictionaryItem.GroupCode;
            txtName.Text      = dictionaryItem.Name;
            this.rdlItemType.Items.Clear();
            EnumUtil.BindEnumData2ListControl <DictionaryItemType>(this.rdlItemType, false, dictionaryItem.ItemType);
            rdlItemType.SelectedValue  = dictionaryItem.ItemType.ToString();
            txtNumberValue.Text        = Cast.String(dictionaryItem.NumberValue, "0");
            txtStringValue.Value       = dictionaryItem.StringValue;
            ddlBoolValue.SelectedValue = dictionaryItem.BoolValue.ToString();
            txtNote.Value = dictionaryItem.Note;
        }
    }