示例#1
0
        private void LoadGridView()
        {
            DateTime dateFrom           = Conversion.TryCastDate(this.dateFromDateTextBox.Text);
            DateTime dateTo             = Conversion.TryCastDate(this.dateToDateTextBox.Text);
            string   office             = this.officeInputText.Value;
            string   party              = this.partyInputText.Value;
            string   priceType          = string.Empty;
            string   user               = this.userInputText.Value;
            string   referenceNumber    = this.referenceNumberInputText.Value;
            string   statementReference = this.statementReferenceInputText.Value;
            string   bookName           = TransactionBookHelper.GetInvariantTransactionBookName(this.Book, this.SubBook);

            if (this.priceTypeInputText != null)
            {
                priceType = this.priceTypeInputText.Value;
            }

            int userId   = this.UserId;
            int officeId = this.OfficeId;

            GridViewColumnHelper.AddColumns(this.productViewGridView, this.SubBook);

            if (this.IsNonGlTransaction)
            {
                this.productViewGridView.DataSource = NonGlStockTransaction.GetView(this.Catalog, userId, bookName, officeId, dateFrom,
                                                                                    dateTo, office, party, priceType, user, referenceNumber, statementReference);
                this.productViewGridView.DataBind();
                return;
            }

            if (this.Book == TranBook.Sales && this.SubBook == SubTranBook.Receipt)
            {
                this.productViewGridView.DataSource = CustomerReceipts.GetView(this.Catalog, userId, officeId, dateFrom, dateTo,
                                                                               office, party, user, referenceNumber, statementReference);
                this.productViewGridView.DataBind();
                return;
            }


            this.productViewGridView.DataSource = GLStockTransaction.GetView(this.Catalog, userId, bookName, officeId, dateFrom,
                                                                             dateTo, office, party, priceType, user, referenceNumber, statementReference);
            this.productViewGridView.DataBind();
        }