Ejemplo n.º 1
0
        private void LoadData()
        {
            try
            {
                Data.SalesTransactions clsTransactions = new Data.SalesTransactions();

                System.Data.DataTable dt;
                if (TerminalDetails.ShowOneTerminalSuspendedTransactions == false)
                {
                    dt = clsTransactions.ListSuspendedDataTable(TerminalDetails.BranchID, TerminalDetails.TerminalNo, 0, TerminalDetails.ShowOnlyPackedTransactions);
                }
                else
                {
                    dt = clsTransactions.ListSuspendedDataTable(TerminalDetails.BranchID, TerminalDetails.TerminalNo, mCashierID, TerminalDetails.ShowOnlyPackedTransactions);
                }
                clsTransactions.CommitAndDispose();

                this.dgStyle.MappingName = dt.TableName;
                dgItems.DataSource       = dt;
                dgItems.Select(0);
                dgItems.CurrentRowIndex = 0;
            }
            catch (IndexOutOfRangeException) { }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void LoadData()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                Data.SalesTransactions clsTransactions = new Data.SalesTransactions();

                DateTime dteTransactionDateFrom = DateTime.TryParse(txtTrxStartDate.Text, out dteTransactionDateFrom) ? dteTransactionDateFrom : DateTime.Now.AddDays(-2);
                DateTime dteTransactionDateTo   = DateTime.TryParse(txtTrxEndDate.Text + " 23:59:59", out dteTransactionDateTo) ? dteTransactionDateTo : DateTime.Now;

                Int64 iCashierID         = TerminalDetails.ShowOneTerminalSuspendedTransactions ? mCashierID : 0;
                System.Data.DataTable dt = new System.Data.DataTable();
                if (TransactionStatusToList == RetailPlus.TransactionStatus.Closed)
                {
                    dt = clsTransactions.ListClosedDataTable(TerminalDetails.BranchID, dteTransactionDateFrom, dteTransactionDateTo);
                }
                else
                {
                    dt = clsTransactions.ListSuspendedDataTable(TerminalDetails.BranchID, TerminalDetails.TerminalNo, iCashierID, TerminalDetails.ShowOnlyPackedTransactions);
                }
                clsTransactions.CommitAndDispose();

                this.dgStyle.MappingName = dt.TableName;
                dgItems.DataSource       = dt;
                dgItems.Select(0);
                dgItems.CurrentRowIndex = 0;

                Cursor.Current = Cursors.Default;
            }
            catch (IndexOutOfRangeException) { Cursor.Current = Cursors.Default; }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message, "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
        private void LoadData()
        {
            try
            {
                Data.SalesTransactions clsTransactions = new Data.SalesTransactions();

                System.Data.DataTable dt;
                if (TerminalDetails.ShowOneTerminalSuspendedTransactions == false)
                {
                    dt = clsTransactions.ListSuspendedDataTable(TerminalDetails.BranchID, TerminalDetails.TerminalNo, 0, TerminalDetails.ShowOnlyPackedTransactions);
                }
                else
                {
                    dt = clsTransactions.ListSuspendedDataTable(TerminalDetails.BranchID, TerminalDetails.TerminalNo, mCashierID, TerminalDetails.ShowOnlyPackedTransactions);
                }
                clsTransactions.CommitAndDispose();

                this.dgStyle.MappingName = dt.TableName;
                dgItems.DataSource = dt;
                dgItems.Select(0);
                dgItems.CurrentRowIndex = 0;
            }
            catch (IndexOutOfRangeException) { }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        private void LoadData()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                Data.SalesTransactions clsTransactions = new Data.SalesTransactions();

                DateTime dteTransactionDateFrom = DateTime.TryParse(txtTrxStartDate.Text, out dteTransactionDateFrom) ? dteTransactionDateFrom : DateTime.Now.AddDays(-2);
                DateTime dteTransactionDateTo = DateTime.TryParse(txtTrxEndDate.Text + " 23:59:59", out dteTransactionDateTo) ? dteTransactionDateTo : DateTime.Now;

                Int64 iCashierID = TerminalDetails.ShowOneTerminalSuspendedTransactions ? mCashierID : 0;
                System.Data.DataTable dt = new System.Data.DataTable();
                if (TransactionStatusToList == RetailPlus.TransactionStatus.Closed)
                    dt = clsTransactions.ListClosedDataTable(TerminalDetails.BranchID, dteTransactionDateFrom, dteTransactionDateTo);
                else
                    dt = clsTransactions.ListSuspendedDataTable(TerminalDetails.BranchID, TerminalDetails.TerminalNo, iCashierID, TerminalDetails.ShowOnlyPackedTransactions);
                clsTransactions.CommitAndDispose();

                this.dgStyle.MappingName = dt.TableName;
                dgItems.DataSource = dt;
                dgItems.Select(0);
                dgItems.CurrentRowIndex = 0;

                Cursor.Current = Cursors.Default;
            }
            catch (IndexOutOfRangeException) { Cursor.Current = Cursors.Default; }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message, "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }