Пример #1
0
 private void ListViewClient_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listViewClient.SelectedItems.Count == 1)
     {
         ClientSet clientSet = listViewClient.SelectedItems[0].Tag as ClientSet;
         textBoxLastName.Text   = clientSet.LastName;
         textBoxFirstName.Text  = clientSet.FirstName;
         textBoxMiddleName.Text = clientSet.MiddleName;
         textBoxPhone.Text      = clientSet.Phone;
         textBoxEmail.Text      = clientSet.Email;
         comboBoxAutopart.Text  = clientSet.IdAutopart.ToString() + "."
                                  + clientSet.AutopartSet.NameAutopart + " - " + clientSet.AutopartSet.CarSet.CarBrand;
     }
     else
     {
         textBoxLastName.Text          = "";
         textBoxFirstName.Text         = "";
         textBoxMiddleName.Text        = "";
         textBoxPhone.Text             = "";
         textBoxEmail.Text             = "";
         comboBoxAutopart.SelectedItem = null;
     }
 }