public void create_generalAccount() { GeneralAccount generalAccount = CreateGeneralAccount(); GeneralAccountRepository repository = new GeneralAccountRepository(); repository.Add(generalAccount); }
/// <summary> /// accout region /// </summary> /// <param name="generalAccountDto"></param> public string AddGeneralAccount(GeneralAccountDto generalAccountDto) { try { int code = generalAccountDto.Code; GeneralAccountRepository repository = new GeneralAccountRepository(); if ((repository.ActiveContext.GeneralAccounts.Count(ga => ga.Code == code)) == 0) { GeneralAccount generalAccount = new GeneralAccount(); generalAccountDto.Id = Guid.NewGuid(); generalAccount.InjectFrom <UnflatLoopValueInjection>(generalAccountDto); repository.Add(generalAccount); return("has successfully created"); } return("this record with this code is there"); } catch (Exception exception) { return(exception.Message); } }
public void Create_Complex_Account1() { GeneralAccountRepository context = new GeneralAccountRepository(); Person person = PersonTest.CreatePerson(); // Customer customer = PersonTest.CreateCustomer(person); Lawyer lawyer = PersonTest.CreateLawyer(person); GeneralAccount generalAccount = CreateGeneralAccount(); IndexAccount indexAccount = CreateIndexAccount(); Account account = CreateAccount(); // account.Customers.Add(customer); account.Lawyers.Add(lawyer); indexAccount.BankAccounts.Add(account); generalAccount.IndexAccounts.Add(indexAccount); context.Add(generalAccount); //context.AddIndexAccount(indexAccount); //context.GeneralAccounts.Add(generalAccount); // context.SaveChanges(); }
/// <summary> /// accout region /// </summary> /// <param name="generalAccountDto"></param> public string AddGeneralAccount(GeneralAccountDto generalAccountDto) { try { int code = generalAccountDto.Code; GeneralAccountRepository repository = new GeneralAccountRepository(); if ((repository.ActiveContext.GeneralAccounts.Count(ga => ga.Code == code)) == 0) { GeneralAccount generalAccount = new GeneralAccount(); generalAccountDto.Id = Guid.NewGuid(); generalAccount.InjectFrom<UnflatLoopValueInjection>(generalAccountDto); repository.Add(generalAccount); return "has successfully created"; } return "this record with this code is there"; } catch (Exception exception) { return exception.Message; } }