예제 #1
0
파일: Accounts.cs 프로젝트: HedinRakot/KVS
 /// <summary>
 /// Erstelle ein neues Erloeskonte
 /// </summary>
 /// <param name="CustomerId">Kundenid</param>
 /// <param name="AccountNumber">Kontonummer</param>
 /// <param name="dbContext">Datenbank Kontext</param>
 /// <returns>Erloeskonto</returns>
 public static Accounts CreateAccount(int? CustomerId, string AccountNumber, DataClasses1DataContext dbContext)
 {
     if (dbContext.Accounts.Any(q => q.CustomerId == CustomerId && q.AccountNumber == AccountNumber))
        {
        throw new Exception("Für diesen Kunden ist bereits dieses Konto eingetragen");
        }
        var account = new Accounts
        {
        AccountNumber = AccountNumber,
        CustomerId = CustomerId
        };
        dbContext.Accounts.InsertOnSubmit(account);
        dbContext.SubmitChanges();
        return account;
 }
예제 #2
0
 partial void UpdateAccounts(Accounts instance);
예제 #3
0
 partial void DeleteAccounts(Accounts instance);
예제 #4
0
 partial void InsertAccounts(Accounts instance);