Exemplo n.º 1
0
            ///////////////////////////////////////////////////////////////////////
            //   Internal Events
            ///////////////////////////////////////////////////////////////////////
            private void AccountTypeDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e)
            {
                stayOut = true;
                AccountTypeRow newRow = e.Row as AccountTypeRow;

                newRow.id   = this.newID++;
                newRow.name = "";

                stayOut = false;
            }
Exemplo n.º 2
0
        private int myImportAccountType(string typeName)
        {
            if (String.IsNullOrEmpty(typeName))
            {
                return(SpclAccountType.NULL);
            }

            // Replace the known bad Quicken names.
            switch (typeName)
            {
            case "Bank":
                typeName = "Checking";
                break;

            case "CCard":
                typeName = "Credit Card";
                break;

            case "Oth L":
                typeName = "Loan";
                break;
            }

            // Search for an exsisting Account type with the same name
            foreach (AccountTypeRow row in this.AccountType)
            {
                if (row.name == typeName)
                {
                    return(row.id);
                }
            }

            // else it was not found
            AccountTypeRow newRow = this.AccountType.NewAccountTypeRow();

            newRow.name = typeName;

            this.AccountType.AddAccountTypeRow(newRow);

            return(newRow.id);
        }