public static void ShowAccountDetails(Account account) { Console.WriteLine("AccountId: {0}", account.Id); Console.WriteLine("ParentId: {0}", account.ParentId); Console.WriteLine("Name: {0}", account.Name); Console.WriteLine("StatusID: {0}", account.StatusId); Console.WriteLine("Status: {0}", account.Status); Console.WriteLine("Created: {0}", account.Created); }
static void CreateAccountExample(T70Context context) { var accountRepo = context.Repository<Account>(new { }); var account = new Account { ParentId = PARENT_ID, Name = "TestSubAccount" }; accountRepo.Add(account); Console.WriteLine("Added account {0}: {1}", account.Id, account.Name); }
public void A_AccountAdd() { var context = new T70Context(); var accountRepo = context.Repository<Account>(new { }); var account = new Account { ParentId = PARENT_ID, Name = RanGen.Str }; accountRepo.Add(account); LookupTable.AccountId = account.Id; //try //{ // accountRepo.Add(account); // Assert.IsInstanceOf(typeof(Account), account); //} //catch //{ // Assert.Fail("Test failed. Can't create Account"); //} }
static void UpdateAccountExample(T70Context context) { var accountRepo = context.Repository<Account>(new { ParentId = PARENT_ID }); var account = new Account { Id = ACCOUNT_ID, Name = "UpdatedTestAccount" }; accountRepo.Update(account); var updateAccount = accountRepo.Get(ACCOUNT_ID); ShowAccountDetails(updateAccount); Console.WriteLine(); }
public void E_AccountUpdate() { var context = new T70Context(); var accountRepo = context.Repository<Account>(new { ParentId = PARENT_ID }); var account = new Account { Id = LookupTable.AccountId, Name = RanGen.Str }; accountRepo.Update(account); }
public void G_AccountDelete() { var context = new T70Context(); var accountRepo = context.Repository<Account>(new { ParentId = PARENT_ID }); var account = new Account { Id = LookupTable.AccountId }; accountRepo.Delete(account); }