Ejemplo n.º 1
0
        public void PrintOwners()
        {
            var ownerController = new OwnerController();
            var owners          = ownerController.GetOwners();

            foreach (var owner in owners)
            {
                Console.WriteLine($"Właściciel {owner.Id} Imię : {owner.Name}, Nazwisko : {owner.Surname}, Telefon : {owner.PhoneNumber}");
            }
        }
Ejemplo n.º 2
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     if (txtSearchFirst.Text != null && txtSearchLast.Text != null)
     {
         try
         {
             List <Owner> ownList = ownControl.GetOwners(txtSearchFirst.Text, txtSearchLast.Text);
             cmbSelect.DataSource    = ownList;
             cmbSelect.DisplayMember = "ownerUnique";
             cmbSelect.ValueMember   = "OwnerID";
         }
         catch (Exception)
         {
             MessageBox.Show("An error has occured, please try again");
         }
     }
     else
     {
         MessageBox.Show("Please provide first and last name.");
     }
 }