예제 #1
0
        public static void StoreAccount(PublicCorp data, int reportGroupID, long ownerID)
        {
            EMMADataSet.BankAccountRow account = null;
            EMMADataSet.BankAccountDataTable table = new EMMADataSet.BankAccountDataTable();
            bool newRow = false;

            if (data.BankAccountID != 0)
            {
                bankAccountTableAdapter.FillByID(table, data.BankAccountID);
                account = table.FindByAccountID(data.BankAccountID);
            }

            if (account == null)
            {
                account = table.NewBankAccountRow();
                newRow = true;
            }

            account.PublicCorpID = data.ID;
            account.ReportGroupID = reportGroupID;
            account.Balance = 0;
            account.OwnerID = ownerID;
            if (newRow)
            {
                table.AddBankAccountRow(account);
            }
            bankAccountTableAdapter.Update(table);
        }