private void btnCreate_Click(object sender, EventArgs e)
        {
            AccountLedger acc = new AccountLedger(0, "");

            acc.ShowDialog();
            dataGridBind();
        }
Esempio n. 2
0
        private void cmbLedgerCR_Leave(object sender, EventArgs e)
        {
            _entities = new MicroAccountsEntities1();

            if (cmbLedgerCR.Text != string.Empty && cmbLedgerCR.SelectedIndex > 0)
            {
                var checkLedgername = _entities.tbl_AccLedger.Where(x => x.ledgerName == cmbLedgerCR.Text.Trim().ToString()).FirstOrDefault();

                if (checkLedgername == null)
                {
                    DialogResult myResult;
                    myResult = MessageBox.Show("No such party exists. Want to create new party?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    if (myResult == DialogResult.OK)
                    {
                        AccountLedger ledger = new AccountLedger(0, cmbLedgerCR.Text.Trim().ToString());
                        ledger.ShowDialog();

                        cmbLedgerCR.Focus();
                    }
                    else
                    {
                        cmbLedgerCR.Focus();
                    }
                }
            }
        }
        private void dgCustomerDetails_DoubleClick(object sender, EventArgs e)
        {
            if (dgCustomerDetails.CurrentRow.Index != -1)
            {
                var lID = Convert.ToInt32(dgCustomerDetails.CurrentRow.Cells[0].Value);

                AccountLedger acc = new AccountLedger(lID, "");
                acc.ShowDialog();
            }
        }
Esempio n. 4
0
        private void dgLedgerDetails_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                if (dgLedgerDetails.CurrentRow.Index != -1 && dgLedgerDetails.CurrentRow.Cells[1].Value != null)
                {
                    var lID = Convert.ToInt32(dgLedgerDetails.CurrentRow.Cells[0].Value);

                    AccountLedger acc = new AccountLedger(lID, "");
                    acc.ShowDialog();
                    dataGridBind();
                }
            }
            catch (Exception x)
            {
                MessageBox.Show("Something went wrong. Contact your system administrator");
            }
        }
Esempio n. 5
0
        private void dgLedgerDetails_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                if (dgLedgerDetails.CurrentRow.Index != -1 && dgLedgerDetails.CurrentRow.Cells[1].Value != null)
                {
                    var lID = Convert.ToInt32(dgLedgerDetails.CurrentRow.Cells[0].Value);

                    AccountLedger acc = new AccountLedger(lID, "");
                    acc.ShowDialog();
                    dataGridBind();
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.ToString());
            }
        }
Esempio n. 6
0
        private void txtLedgerName_Leave(object sender, EventArgs e)
        {
            try
            {
                _entities = new MicroAccountsEntities1();

                if (txtLedgerName.Text != string.Empty)
                {
                    var checkLedgername = _entities.tbl_AccLedger.Where(x => x.ledgerName == txtLedgerName.Text.Trim().ToString()).FirstOrDefault();

                    if (checkLedgername == null)
                    {
                        DialogResult myResult;
                        myResult = MessageBox.Show("No such party exists. Want to create new party?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                        if (myResult == DialogResult.OK)
                        {
                            AccountLedger ledger = new AccountLedger(0, txtLedgerName.Text.Trim().ToString());
                            ledger.ShowDialog();
                            ledgerNameAutoComplete();
                            txtLedgerName.Focus();
                        }
                        else
                        {
                            txtLedgerName.Focus();
                        }
                    }


                    decimal drLedgerId = Convert.ToDecimal(checkLedgername.Id);

                    CrDrDifference crdrDiff = new CrDrDifference();
                    string         valueAmt = crdrDiff.DifferenceCrDr(Convert.ToInt32(drLedgerId), 0);

                    lblBalance.Text = valueAmt;
                }
            }
            catch (Exception x)
            {
            }
        }