コード例 #1
0
        public static void DeleteAccount(int corpID, long ownerID)
        {
            PublicCorp corp = PublicCorps.GetCorp(corpID);
            if (corp != null)
            {
                corp.OwnerID = ownerID;
                corp.ReloadBankAccountDetails();

                if (corp.BankAccountID > 0)
                {
                    DeleteTransactions(GetAccountTransactions(corp.BankAccountID));

                    EMMADataSet.BankAccountRow account = null;
                    EMMADataSet.BankAccountDataTable table = new EMMADataSet.BankAccountDataTable();

                    bankAccountTableAdapter.FillByID(table, corp.BankAccountID);
                    account = table.FindByAccountID(corp.BankAccountID);

                    if (account != null)
                    {
                        account.Delete();
                        bankAccountTableAdapter.Update(table);
                    }
                }
            }
        }
コード例 #2
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);
        }