public A1_POCO.ClientPOCO Get(int clientId)
        {
            Client     c      = datasource.getClientbyId(clientId);
            ClientPOCO client = new ClientPOCO();

            client.Address   = c.Address;
            client.CNP       = c.CNP;
            client.FirstName = c.FirstName;
            client.ICN       = c.ICN;
            client.ID        = c.ID;
            client.LastName  = c.LastName;

            client.Accounts = new List <AccountPOCO>();

            foreach (var account in c.Accounts)
            {
                AccountPOCO a = new AccountPOCO();

                a.ID           = account.ID;
                a.Amount       = account.Amount;
                a.ClientID     = account.ClientID;
                a.CreationDate = account.CreationDate;
                a.Currency     = account.Currency;
                a.Number       = account.Number;
                a.Type         = account.Type;

                client.Accounts.Add(a);
            }

            return(client);
        }
        private void btn_newAccount_Click(object sender, EventArgs e)
        {
            //new
            AccountPOCO account = new AccountPOCO();

            account.ClientID = clientId;

            Form accountForm = new NewAccountForm(account);

            accountForm.ShowDialog();

            accountLogic.Save(account);

            reload();
        }
Exemple #3
0
 public NewAccountForm(AccountPOCO account)
 {
     InitializeComponent();
     this.account = account;
 }