Beispiel #1
0
        /// <summary>
        /// Loads the data into grid.
        /// </summary>
        protected void LoadDataIntoGrid()
        {
            IList <ActionForm> dataSource = new List <ActionForm>();

            dataSource.Add(new ActionForm(1, "Thêm mới"));
            dataSource.Add(new ActionForm(2, "Sửa"));
            dataSource.Add(new ActionForm(3, "Xóa"));
            dataSource.Add(new ActionForm(4, "Xem"));
            dataSource.Add(new ActionForm(5, "Nhân bản"));
            dataSource.Add(new ActionForm(6, "In"));
            dataSource.Add(new ActionForm(7, "Đăng nhập"));
            dataSource.Add(new ActionForm(8, "Đăng xuất"));


            _rsActionView = new GridView();
            _rsActionView.OptionsView.ColumnAutoWidth = false;
            _rsAction = new RepositoryItemGridLookUpEdit
            {
                NullText      = "",
                View          = _rsActionView,
                TextEditStyle = TextEditStyles.Standard,
            };
            _rsAction.View.OptionsView.ShowFilterPanelMode = ShowFilterPanelMode.Never;
            _rsAction.View.OptionsView.ShowIndicator       = false;
            _rsAction.PopupFormSize = new Size(10, 150);
            _rsAction.View.BestFitColumns();

            _rsAction.DataSource = dataSource;
            _rsActionView.PopulateColumns(dataSource);

            var gridColumnsCollection = new List <XtraColumn>();

            gridColumnsCollection.Add(new XtraColumn
            {
                ColumnName     = "Id",
                ColumnCaption  = "Mã nguồn vốn",
                ColumnVisible  = false,
                ColumnPosition = 1
            });
            gridColumnsCollection.Add(new XtraColumn
            {
                ColumnName     = "Name",
                ColumnCaption  = "Thao tác",
                ColumnVisible  = true,
                ColumnWith     = 180,
                ColumnPosition = 2
            });

            XtraColumnCollectionHelper <ActionForm> .ShowXtraColumnInGridView(gridColumnsCollection, _rsActionView);


            _rsAction.DataSource    = dataSource;
            _rsAction.DisplayMember = "Name";
            _rsAction.ValueMember   = "Id";

            _audittingLogsPresenter.Display();
            _refTypesPresenter.Display();
            _userProfilesPresenter.Display();
        }
        protected override void LoadDataIntoGridDetail(string refId)
        {
            var buTransfer = _model.GetBUTransferVoucher(refId, true);

            if (buTransfer == null)
            {
                return;
            }

            bindingSourceDetail.DataSource = buTransfer.BUTransferDetailPurchases.OrderBy(c => c.SortOrder).ToList();
            gridViewDetail.PopulateColumns(buTransfer.BUTransferDetailPurchases);

            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "InventoryItemId", ColumnCaption = "Mã VT,HH", ColumnVisible = true, ColumnWith = 120, ColumnPosition = 1, AllowEdit = true, RepositoryControl = _gridLookUpEditInventoryItem
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "Description", ColumnCaption = "Diễn giải", ColumnVisible = true, ColumnWith = 250, ColumnPosition = 2
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "StockId", ColumnCaption = "Kho", ColumnVisible = true, ColumnWith = 150, ColumnPosition = 3, AllowEdit = true, RepositoryControl = _gridLookUpEditStock
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "DebitAccount", ColumnCaption = "TK nợ", ColumnVisible = true, ColumnWith = 120, ColumnPosition = 4, AllowEdit = true
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "CreditAccount", ColumnCaption = "TK có", ColumnVisible = true, ColumnWith = 120, ColumnPosition = 5, AllowEdit = true
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "Unit", ColumnCaption = "ĐVT", ColumnVisible = true, ColumnWith = 120, ColumnPosition = 6, AllowEdit = true,
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "Quantity", ColumnCaption = "Số lượng", ColumnVisible = true, ColumnWith = 120, ColumnPosition = 7, AllowEdit = true, IsNumeric = true
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "UnitPrice", ColumnCaption = "Đơn giá", ColumnVisible = true, ColumnWith = 120, ColumnPosition = 8, AllowEdit = true, IsNumeric = true
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "Amount", ColumnCaption = "Thành tiền", ColumnVisible = true, ColumnWith = 120, ColumnPosition = 9, AllowEdit = true, IsNumeric = true
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "TaxAmount", ColumnCaption = "Giá trị nhập kho", ColumnVisible = true, ColumnWith = 150, ColumnPosition = 10, AllowEdit = true, IsNumeric = true
            });

            XtraColumnCollectionHelper <BUTransferDetailPurchaselModel> .ShowXtraColumnInGridView(ColumnsCollection, gridViewDetail);
        }
        protected override void LoadDataIntoGridDetail(string refId)
        {
            var buTransfer = _model.GetBUTransferVoucher(refId, true);

            if (buTransfer == null)
            {
                return;
            }

            bindingSourceDetail.DataSource = buTransfer.BUTransferDetailFixedAssets.OrderBy(c => c.SortOrder).ToList();
            gridViewDetail.PopulateColumns(buTransfer.BUTransferDetailFixedAssets);

            var columnsCollection = new List <XtraColumn>();

            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "Description", ColumnVisible = true, ColumnWith = 320, ColumnCaption = "Diễn giải", ColumnPosition = 1,
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "DebitAccount", ColumnVisible = true, ColumnWith = 100, ColumnCaption = "TK Nợ", ColumnPosition = 2
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "CreditAccount", ColumnVisible = true, ColumnWith = 100, ColumnCaption = "TK Có", ColumnPosition = 3
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "Amount", ColumnVisible = true, ColumnWith = 120, ColumnCaption = "Số tiền", ColumnPosition = 4, IsNumeric = true
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "BudgetSourceId", ColumnVisible = true, ColumnWith = 200, ColumnCaption = "Nguồn", ColumnPosition = 5, RepositoryControl = _gridLookUpEditBudgetSource
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "BudgetChapterCode", ColumnVisible = true, ColumnWith = 150, ColumnCaption = "Chương", ColumnPosition = 6
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "BudgetSubKindItemCode", ColumnVisible = true, ColumnWith = 150, ColumnCaption = "Khoản", ColumnPosition = 7
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "BudgetSubItemCode", ColumnVisible = true, ColumnWith = 150, ColumnCaption = "Tiểu mục", ColumnPosition = 8
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = "BudgetItemCode", ColumnVisible = true, ColumnWith = 150, ColumnCaption = "Mục", ColumnPosition = 9
            });

            XtraColumnCollectionHelper <BUTransferDetailFixedAssetlModel> .ShowXtraColumnInGridView(ColumnsCollection, gridViewDetail);
        }
        protected override void LoadDataIntoGridDetail(string refId)
        {
            var pUInvoice = _model.GetPUInvoice(refId, true);

            if (pUInvoice == null)
            {
                return;
            }

            var source = pUInvoice.PUInvoiceDetailFixedAssets ?? new List <PUInvoiceDetailFixedAssetModel>();

            bindingSourceDetail.DataSource = source.OrderBy(c => c.SortOrder).ToList();;
            gridViewDetail.PopulateColumns(source);

            var columnsCollection = new List <XtraColumn>();

            ColumnsCollection.Add(new XtraColumn {
                ColumnName = nameof(PUInvoiceDetailFixedAssetModel.FixedAssetId), ColumnVisible = true, ColumnWith = 150, ColumnCaption = "Mã tài sản", ColumnPosition = 1, RepositoryControl = _gridLookUpEditFixedAsset
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = nameof(PUInvoiceDetailFixedAssetModel.Description), ColumnVisible = true, ColumnWith = 320, ColumnCaption = "Diễn giải", ColumnPosition = 2,
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = nameof(PUInvoiceDetailFixedAssetModel.DepartmentId), ColumnVisible = true, ColumnWith = 200, ColumnCaption = "Phòng ban", ColumnPosition = 3, RepositoryControl = _gridLookUpEditDepartment
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = nameof(PUInvoiceDetailFixedAssetModel.DebitAccount), ColumnVisible = true, ColumnWith = 100, ColumnCaption = "TK Nợ", ColumnPosition = 4
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = nameof(PUInvoiceDetailFixedAssetModel.CreditAccount), ColumnVisible = true, ColumnWith = 100, ColumnCaption = "TK Có", ColumnPosition = 5
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = nameof(PUInvoiceDetailFixedAssetModel.Amount), ColumnVisible = true, ColumnWith = 120, ColumnCaption = "Số tiền", ColumnPosition = 6, IsNumeric = true
            });
            ColumnsCollection.Add(new XtraColumn {
                ColumnName = nameof(PUInvoiceDetailFixedAssetModel.BankAccount), ColumnVisible = true, ColumnWith = 200, ColumnCaption = "Tài khoản NH, KB", ColumnPosition = 5, RepositoryControl = _gridLookUpEditBank
            });

            XtraColumnCollectionHelper <PUInvoiceDetailFixedAssetModel> .ShowXtraColumnInGridView(ColumnsCollection, gridViewDetail);
        }