private void search_Click(object sender, EventArgs e) { POCO.Client client = clientBiz.Search(searchCNP.Text); clearFields(); if (client == null) { MessageBox.Show("Not Found!"); } else { this.firstName.Text = client.FirstName; this.clientId = client.ID; this.lastName.Text = client.LastName; this.CNP.Text = client.CNP; this.ICN.Text = client.ICN; this.address.Text = client.Address; } searchCNP.Clear(); }
private void refreshFields(POCO.Client client) { clearFields(); if (client == null) { MessageBox.Show("Not Found!"); } else { this.firstName.Text = client.FirstName; this.clientId = client.ID; this.lastName.Text = client.LastName; this.cnp.Text = client.CNP; this.icn.Text = client.ICN; this.address.Text = client.Address; foreach (var a in client.Accounts) { accountList.Rows.Add(new object[] { a.ID, a.Number, a.Type, a.Currency, a.Amount, a.CreationDate }); } searchCNP.Clear(); } }
private void reload() { POCO.Client client = business.Get(clientId); refreshFields(client); }
private void btnSearch_Click(object sender, EventArgs e) { POCO.Client client = business.Search(searchCNP.Text); refreshFields(client); }