Exemplo n.º 1
0
    private void InitGrid()
    {
        ExtAspNet.BoundField boundField1 = new ExtAspNet.BoundField();
        boundField1.DataField  = "hw";
        boundField1.HeaderText = "货位";
        grid.Columns.Add(boundField1);

        ExtAspNet.BoundField boundField2 = new ExtAspNet.BoundField();
        boundField2.DataField  = "b";
        boundField2.HeaderText = "盘点类型";
        grid.Columns.Add(boundField2);

        ExtAspNet.BoundField boundField3 = new ExtAspNet.BoundField();
        boundField3.DataField  = "pddh";
        boundField3.HeaderText = "盘点单号";
        grid.Columns.Add(boundField3);

        ExtAspNet.BoundField boundField4 = new ExtAspNet.BoundField();
        boundField4.DataField  = "pdtype";
        boundField4.HeaderText = "实际盘点类型";
        grid.Columns.Add(boundField4);

        ExtAspNet.BoundField boundField5 = new ExtAspNet.BoundField();
        boundField5.DataField  = "djzt";
        boundField5.HeaderText = "单据状态";
        grid.Columns.Add(boundField5);
    }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化窗体
        /// </summary>
        private void InitForm()
        {
            FieldItem FIdentity = null;

            if (ExtGrid == null)
            {
                return;
            }
            ExtGrid.Title = Entity <TEntity> .Meta.Table.Description;

            foreach (FieldItem item in InitFields(Entity <TEntity> .Meta.Fields))
            {
                if (item.IsIdentity)
                {
                    FIdentity = item;
                }
                ExtAspNet.BoundField boundField1 = new ExtAspNet.BoundField();
                //boundField1.DataToolTipField = item.Name;
                boundField1.DataField        = item.Name;
                boundField1.DataFormatString = "{0}";
                boundField1.HeaderText       = item.Description;
                ExtGrid.Columns.Add(boundField1);
            }

            #region 编辑操作
            if (Acquire(PermissionFlags.Update))
            {
                if (FIdentity != null)
                {
                    ExtAspNet.WindowField WindowField1 = new ExtAspNet.WindowField();
                    //                    <ext:WindowField Text="编辑" WindowID="Window1" Title="编辑" DataIFrameUrlFields="Id"
                    //            DataIFrameUrlFormatString="~/admin/menu_edit.aspx?id={0}" Width="50px" />
                    WindowField1.Text       = "编辑";
                    WindowField1.Title      = "编辑";
                    WindowField1.HeaderText = "编辑";
                    WindowField1.WindowID   = "Window1";
                    WindowField1.DataIFrameUrlFormatString = EditIFrameUrlFormatString;
                    WindowField1.Width = 50;
                    WindowField1.DataIFrameUrlFields = FIdentity.Name;
                    ExtGrid.Columns.Add(WindowField1);
                }
            }
            #endregion
            #region  除操作
            if (Acquire(PermissionFlags.Delete))
            {
                LinkButtonField DelField = new LinkButtonField();
                DelField.Text          = "删除";
                DelField.ConfirmIcon   = MessageBoxIcon.Question;
                DelField.ConfirmText   = "确定删除此" + Entity <TEntity> .Meta.Table.Description + "?";
                DelField.ConfirmTarget = Target.Top;
                DelField.HeaderText    = "删除";
                DelField.CommandName   = "Delete";
                DelField.Width         = 50;
                ExtGrid.Columns.Add(DelField);
            }
            #endregion
            if (FIdentity != null)
            {
                ExtGrid.DataKeyNames = new String[] { FIdentity.Name }
            }
            ;

            BindGrid();
        }