コード例 #1
0
        private void Find_btn_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            var loanData = new PawnExtInquiry()
            {
                byDate    = dateOption_rb.Checked,
                startDate = dateCalendarStart.SelectedDate,
                endDate   = dateCalendarEnd.SelectedDate,
                userID    = userID_tb.Text,
                sortBy    = (PawnExtInquiry.sortField_enum)sortBy_cb.SelectedIndex,
                sortDir   = (PawnExtInquiry.sortDir_enum)sortDir_cb.SelectedIndex
            };


            int.TryParse(fromTicket_tb.Text, out loanData.lowTicketNumber);
            int.TryParse(toTicket_tb.Text, out loanData.highTicketNumber);

            double.TryParse(lowLoanAmt_tb.Text, out loanData.lowAmount);
            double.TryParse(highLoanAmt_tb.Text, out loanData.highAmount);

            DataSet s = null;

            try
            {
                s = loanData.getData();

                if (s.IsNullOrEmpty())
                {
                    throw new BusinessLogicException(ReportConstants.NODATA);
                }
            }
            catch (BusinessLogicException blex)
            {
                MessageBox.Show(blex.Message);
                return;
            }
            //this.NavControlBox.Action = NavBox.NavAction.HIDEANDSHOW;
            Cursor.Current = Cursors.Default;

            this.Visible = false;
            var resultsDisplay = new ExtensionSearchResults(s, loanData, "EXT_INFO");

            resultsDisplay.ShowDialog();

            if (resultsDisplay.DialogResult == DialogResult.Cancel)
            {
                this.Close();
            }
            else
            {
                this.Visible = true;
            }
        }
コード例 #2
0
        public ExtensionSearchResults(DataSet s, PawnExtInquiry criteria, string dataTableName) :
            base(s, criteria, dataTableName)
        {
            #region Data Grid Initialization


            var dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
            var dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();

            this.Shop      = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ticket    = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.cust_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.DateTime  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.LnAmount  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.UserID    = new System.Windows.Forms.DataGridViewTextBoxColumn();

            this.resultsGrid_dg.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                this.Shop,
                this.ticket,
                this.cust_name,
                this.DateTime,
                this.LnAmount,
                this.UserID
            });

            //
            // Shop
            //
            this.Shop.DataPropertyName = "STORENUMBER";
            this.Shop.HeaderText       = "Shop";
            this.Shop.Name             = "Shop";
            this.Shop.ReadOnly         = true;
            this.Shop.Width            = 50;
            //
            // ticket
            //
            this.ticket.DataPropertyName = "TICKET_NUMBER";
            this.ticket.HeaderText       = "Current Tkt #";
            this.ticket.Name             = "ticket";
            this.ticket.ReadOnly         = true;
            this.ticket.Width            = 83;
            //
            // cust_name
            //
            this.cust_name.DataPropertyName = "CUST_NAME";
            this.cust_name.HeaderText       = "Name";
            this.cust_name.Name             = "cust_name";
            this.cust_name.ReadOnly         = true;
            this.cust_name.Width            = 270;
            //
            // DateTime
            //
            this.DateTime.DataPropertyName   = "CREATIONDATE";
            dataGridViewCellStyle3.Format    = "g";
            dataGridViewCellStyle3.NullValue = null;
            this.DateTime.DefaultCellStyle   = dataGridViewCellStyle3;
            this.DateTime.HeaderText         = "Extension Date/Time";
            this.DateTime.Name     = "DateTime";
            this.DateTime.ReadOnly = true;
            this.DateTime.Width    = 175;
            //
            // LnAmount
            //
            this.LnAmount.DataPropertyName   = "REF_AMT";
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
            dataGridViewCellStyle4.Format    = "C2";
            dataGridViewCellStyle4.NullValue = null;
            this.LnAmount.DefaultCellStyle   = dataGridViewCellStyle4;
            this.LnAmount.HeaderText         = "Extension Amount";
            this.LnAmount.Name     = "LnAmount";
            this.LnAmount.ReadOnly = true;
            //
            // UserID
            //
            this.UserID.DataPropertyName = "ENT_ID";
            this.UserID.HeaderText       = "UserID";
            this.UserID.Name             = "UserID";
            this.UserID.ReadOnly         = true;
            this.UserID.Width            = 75;

            this.resultsGrid_dg.CellContentClick += resultsGrid_dg_CellContentClick;
            this.Print_btn.Enabled = true;
            this.Print_btn.Click  += Print_btn_Click;
            #endregion
        }