Exemple #1
0
        private void frmAccountLedgerMaster_Load(object sender, EventArgs e)
        {
            try
            {
                ExtensionMethods.FormLoad(this, "Account Ledger Master");
                GotFocusEventRaised(this);
                ExtensionMethods.EnterKeyDownForTabEvents(this);

                LoadCombo();

                if (isOpenAsDialog)
                {
                    dgvAccountLedger.SelectionChanged += DgvAccountLedger_SelectionChanged;
                    AccountLedgerType master = applicationFacade.GetAccountLedgerTypeByName(ledgerType);
                    LoadDataGrid(master != null ? master.AccountLedgerTypeID : 0);
                }
                else
                {
                    LoadDataGrid(0);
                    dgvAccountLedger.CellDoubleClick += DgvAccountLedger_CellDoubleClick;
                    dgvAccountLedger.KeyDown         += DgvAccountLedger_KeyDown;
                }

                txtSearch.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }