Esempio n. 1
0
        private void BaddClient_Click(object sender, RoutedEventArgs e)
        {
            var             client = new Client();
            AddClientWindow add    = new AddClientWindow(client);

            add.Owner = this;
            var result = add.ShowDialog();

            if (result == true)
            {
                bd.Clients.Add(client);
                bd.SaveChanges();
                add.Close();
            }
            else
            {
                add.Close();
            }

            LvClients.ItemsSource = vm.ListCln;
        }
Esempio n. 2
0
        private void MiChange_Click(object sender, RoutedEventArgs e)
        {
            string clientS  = LvClients.SelectedItem.ToString();
            int    k        = clientS.IndexOf('.');
            int    clientId = Int32.Parse(clientS.Substring(0, k));
            Client client   = bd.Clients.Find(clientId);

            AddClientWindow add = new AddClientWindow(client);

            add.Owner = this;
            var result = add.ShowDialog();

            if (result == true)
            {
                bd.SaveChanges();
                add.Close();
                UpdatingInformationClient();
                LvClients.ItemsSource = vm.ListCln;
            }
            else
            {
                add.Close();
            }
        }