public RepositoryItemSelectDMGridTemplate(GroupElementType type, GridView gridView, string TableName, string columnField, string IDField, string DislayField, string getField, string[] NameFields,
            string[] Subjects, string FilterField, DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule, DelegationLib.DefinePermission permission, params string[] readOnlyField)
        {
            CotAo = columnField + getField + "_PLV";
            this.ShowPopupShadow = true;
            dmGridTemplate1 = new DMGrid();
            popupControl = new PopupContainerControl();
            this.CloseOnOuterMouseClick = false;
            this.PopupControl = popupControl;
            popupControl.Controls.Add(dmGridTemplate1);
            popupControl.Size = dmGridTemplate1.Size;
            this.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            this.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(RepositoryItemSelectDMGridTemplate_EditValueChanging);
            //dmGridTemplate1._init(type, TableName, IDField, DislayField, NameFields, Subjects, InitGridCol, Rule, permission, readOnlyField);
            this.Popup += new EventHandler(RepositoryItemSelectDMGridTemplate_Popup);
            this.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(popupContainerEdit1_CloseUp);
            this.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(popupContainerEdit1_Closed);
            this.KeyDown += new KeyEventHandler(popupContainerEdit1_KeyDown);
            this.DislayField = DislayField;
            this.FilterField = FilterField;

            gridView.GridControl.DataSourceChanged += delegate(object sender, EventArgs e)
            {
                if (gridView.GridControl.DataSource != null &&
                    !((DataTable)gridView.GridControl.DataSource).Columns.Contains(CotAo))
                {

                    DataTable dt = (DataTable)gridView.GridControl.DataSource;
                    dt.Columns.Add(new DataColumn(CotAo));
                    SetValueTable(ref dt, columnField, CotAo, TableName, "ID", getField);
                }
            };

            long idValue;

            gridView.CellValueChanging += delegate(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
            {
                if (e.Column.FieldName.Equals(CotAo))
                {
                    idValue = _getSelectedID();
                    if (e.RowHandle < 0)
                    {
                        gridView.EditingValue = idValue;
                        gridView.SetFocusedRowCellValue(gridView.Columns.ColumnByFieldName(columnField), idValue);
                    }
                    else
                    {
                        DataTable dt = ((DataTable)gridView.GridControl.DataSource);
                        DataRow row = dt.Rows[e.RowHandle];
                        row[columnField] = idValue;
                        row[CotAo] = e.Value;
                    }
                }
            };
            gridView.InitNewRow += delegate(object sender, InitNewRowEventArgs e)
            {
                gridView.SetRowCellValue(e.RowHandle, columnField,_getSelectedID());
            };
        }
 public PLGridViewUpdateHelp(GridControl gridCtrl, int NumPerPage, DMBasicGrid basic)
 {
     this.gridControl = gridCtrl;
     this.gridControl.UseEmbeddedNavigator = true;
     InvisibleAllNavigateButton();
     AddCustomButton();
     InitPager(NumPerPage);
     this.basic = basic;
 }
Beispiel #3
0
        /// <summary>
        /// Unique:     N Field
        /// Phân quyền: Có (Chưa xử lý), 
        /// Cho thêm    Có Nếu readOnlyField = null hoặc không truyền vào
        ///             Không Nếu readOnlyFiled !=null (chỉ cập nhật)
        /// VISIBLE_BIT:Không
        /// </summary>
        public DMGrid(string TableName, string IDField, string DislayField, string[] NameFields, string[] Subjects, 
            DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule,
            DelegationLib.DefinePermission permission,
            params string[] readOnlyField)
        {
            InitializeComponent();

            _init(GroupElementType.ONLY_INPUT, TableName, IDField, DislayField, NameFields, Subjects,
                InitGridCol, Rule,
                permission,
                readOnlyField);
        }
 public RepositoryItemSelectDMGridTemplate(GroupElementType type, GridView gridView, string TableName, string columnField, string IDField, string DislayField,string getField, string NameField, string Subject, string FilterField, DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule, params string[] readOnlyField)
     : this(type,gridView, TableName,columnField, IDField, DislayField, getField, new string[] { NameField }, new string[] { Subject },FilterField, InitGridCol, Rule, null, readOnlyField)
 {
 }
Beispiel #5
0
 /// <summary>
 /// Unique:         1 Field
 /// Phân quyền:     Không
 /// VISIBLE_BIT:    Không
 /// Cho thêm:       Có
 /// </summary>
 public DMGrid(string TableName, string IDField, string NameField, string Subject,
     DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule)
     : this(TableName, IDField, NameField, new string[] { NameField }, 
             new string[] { Subject }, InitGridCol, Rule, null)
 {
 }
Beispiel #6
0
        /// <summary>
        /// Unique:     N Field
        /// Phân quyền: Có (Chưa xử lý), 
        /// Cho thêm:   Có Nếu readOnlyField = null hoặc không truyền vào
        ///             Không Nếu readOnlyFiled !=null (chỉ cập nhật)
        /// VISIBLE_BIT:Không
        /// GroupElementType: Chọn kiểu chọn lựa ( Chỉ chọn , Chọn và Thêm )
        /// </summary>
        public void _init(GroupElementType type, 
            string TableName, string IDField, string DislayField, string[] NameFields, string[] Subjects,
            DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule,
            DelegationLib.DefinePermission permission,
            params string[] readOnlyField)
        {
            this.btnAdd.Image = FWImageDic.ADD_IMAGE20;
            this.btnDel.Image = FWImageDic.DELETE_IMAGE20;
            this.btnUpdate.Image = FWImageDic.EDIT_IMAGE20;
            this.btnSelect.Image = FWImageDic.CHOICE_IMAGE20;
            this.btnNoSelect.Image = FWImageDic.NO_CHOICE_IMAGE20;
            this.btnInfo.Image = FWImageDic.DETAIL_IMAGE20;
            this.btnClose.Image = FWImageDic.CLOSE_IMAGE20;
            this.btnSave.Image = FWImageDic.SAVE_IMAGE20;
            this.btnNoSave.Image = FWImageDic.NO_SAVE_IMAGE20;

            _DMCore = new DMBasicGrid(TableName, IDField, NameFields, Subjects, InitGridCol, Rule, permission);
            _DMCore.Dock = DockStyle.Fill;
            this.Controls.Add(_DMCore);
            if (popupContainer != null) _DMCore.SupportDoubleClick = false;

            this.Controls.Add(this.btnBar);
            this.IDField = IDField;
            this.DislayField = DislayField;
            btnExport = HelpGrid.addXuatRaFileItem(this.btnBar, this.Grid);
            btnPrint = HelpGrid.addInLuoiItem(this.btnBar, this.Grid);
            SetMode(type);
            EditMode(readOnlyField);
            Grid.KeyDown += new KeyEventHandler(Grid_KeyDown);
            Grid.DoubleClick += new EventHandler(Grid_DoubleClick);
            _DMCore.SetDMGridOwner(this);

            if (Grid is PLGridView)
            {
                ((PLGridView)Grid)._SetPermissionElement(btnPrint, btnExport);
            }
        }
Beispiel #7
0
 public static RepositoryItemSelectDMGridTemplate CotPLDMGrid(GridView gridView, GridColumn column, GroupElementType type, string TableName,
     string IDField, string DislayField, string getField, string[] NameFields,
     string[] Subjects, string FilterField,
     DMBasicGrid.InitGridColumns InitGridCol,
     DMBasicGrid.GetRule Rule, DelegationLib.DefinePermission permission,
     string ColumnField,
     DataSet dataTable0,
     params string[] readOnlyField)
 {
     column.FieldName = ColumnField + getField + "_PLV";
     RepositoryItemSelectDMGridTemplate dmGrid =
         new RepositoryItemSelectDMGridTemplate(type, gridView, TableName, ColumnField, IDField, DislayField, getField,
             NameFields, Subjects, FilterField, InitGridCol, Rule, permission, dataTable0, readOnlyField);
     column.ColumnEdit = dmGrid;
     gridView.OptionsBehavior.AutoExpandAllGroups = true;
     return dmGrid;
 }
Beispiel #8
0
 public void _init(GroupElementType type, DataTable DataSource, string IDField, string DislayField, string[] NameFields,
     string[] Subjects, DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule, DelegationLib.DefinePermission permission,
     PLDelegation.ProcessDataRow InsertFunc, PLDelegation.ProcessDataRow DeleteFunc, PLDelegation.ProcessDataRow UpdateFunc,
     params string[] editField)
 {
     dmGridTemplate1._init(type, DataSource, IDField, DislayField, NameFields, Subjects, InitGridCol, Rule, permission,
                             InsertFunc, DeleteFunc, UpdateFunc, editField);
     this.DislayField = DislayField;
 }
Beispiel #9
0
 public void _init(GroupElementType type, string TableName, string IDField, string DislayField, string[] NameFields,
     string[] Subjects, DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule, DelegationLib.DefinePermission permission, params string[] editField)
 {
     dmGridTemplate1._init(type, TableName, IDField, DislayField, NameFields, Subjects, InitGridCol, Rule, permission, editField);
     this.DislayField = DislayField;
 }