private void OnEditing(object sender, RoutedEventArgs e)
        {
            if (data.SelectedItem == null)
            {
                return;
            }
            Contract          contract = list[data.SelectedIndex];
            WindowAddContract window   = new WindowAddContract(contract);

            if (window.ShowDialog() == true)
            {
                contract.Update();
            }
        }
 private void OnClickNew(object sender, RoutedEventArgs e)
 {
     try
     {
         Contract          contract = new Contract();
         WindowAddContract window   = new WindowAddContract(contract);
         if (window.ShowDialog() == true)
         {
             contract.Save();
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.ToString());
     }
 }