Ejemplo n.º 1
0
        }//------------------

        //###########################################END TEXTBOX txtAmount EVENTS#####################################################

        //###########################################BUTTON btnSearchedAccountTitle EVENTS#####################################################
        //event is raised when the control is clicked
        private void btnSearchedAccountTitleClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                using (ChartOfAccountSearchedOnTextBoxList frmSearch = new ChartOfAccountSearchedOnTextBoxList(_userInfo, _cashieringManager))
                {
                    frmSearch.PrimaryIndex  = 4;
                    frmSearch.AdoptGridSize = false;
                    frmSearch.ShowDialog(this);

                    if (frmSearch.HasSelected)
                    {
                        _breakDownDepositInfo.AccountInfo = _cashieringManager.MiscellaneousChartOfAccountInfo =
                            _cashieringManager.GetChartOfAccountInformation(frmSearch.PrimaryId);

                        this.txtCreditEntry.Text = !String.IsNullOrEmpty(_breakDownDepositInfo.AccountInfo.AccountSysId) ?
                                                   _breakDownDepositInfo.AccountInfo.AccountCode + " - " + _breakDownDepositInfo.AccountInfo.AccountName : String.Empty;
                    }
                }

                this.Cursor = Cursors.Arrow;
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading");
            }
        }//----------------------
        }//------------------------

        //###########################################END BUTTON btnPrint EVENTS#####################################################

        #endregion

        #region Programmer's Defined Void Procedures
        //this procedure will show the search credit Entry
        private void ShowSearchCreditEntry(Boolean allowMultipleInsert)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                using (ChartOfAccountSearchedOnTextBoxList frmSearch = new ChartOfAccountSearchedOnTextBoxList(_userInfo, _cashieringManager))
                {
                    frmSearch.PrimaryIndex        = 4;
                    frmSearch.AdoptGridSize       = false;
                    frmSearch.AllowMultipleInsert = allowMultipleInsert;
                    frmSearch.ShowAllowMultipleInsert(true);
                    frmSearch.ShowDialog(this);

                    if (frmSearch.HasSelected)
                    {
                        _chartOfAccountInfo = _cashieringManager.GetChartOfAccountInformation(frmSearch.PrimaryId);

                        _accountCreditSysIdList += _chartOfAccountInfo.AccountSysId + ", ";

                        this.txtCreditEntry.Text += (!String.IsNullOrEmpty(_chartOfAccountInfo.AccountSysId) ? _chartOfAccountInfo.AccountName : String.Empty) + ", ";

                        _chartOfAccountInfo = new CommonExchange.ChartOfAccount();

                        allowMultipleInsert = frmSearch.AllowMultipleInsert;
                    }
                    else
                    {
                        allowMultipleInsert = false;
                    }
                }

                this.Cursor = Cursors.Arrow;
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading");
            }

            if (allowMultipleInsert)
            {
                this.ShowSearchCreditEntry(allowMultipleInsert);
            }
        }//----------------------------------