Ejemplo n.º 1
0
        private void closedCheckBox_Click(object sender, EventArgs e)
        {
            string       text;
            string       caption;
            DialogResult res;

            // If "opening" an account return.
            if (closedCheckBox.Checked == false)
            {
                return;
            }

            if (this.eADataSet.Account.FindByid(this.currentID).catagory != SpclAccountCat.ACCOUNT)
            {
                return;
            }

            decimal balance = DBquery.getAccBalance(currentID);
            int     count   = DBquery.getAccountErrorCount(currentID);

            if (balance == 0.0m && count == 0)
            {
                return;
            }

            caption = "Zero balance needed";

            text  = "This account has a balance of " + balance.ToString("C2") + ". \n";
            text += "This account has " + count.ToString() + " error(s). \n\n";
            text += "Please get the balance to zero and resolve the errors before closing.";

            res = MessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

            closedCheckBox.Checked = false;
        }