private void ModifyButton_Click(object sender, RoutedEventArgs e)
        {
            var addModifyWindow = new AddModifyVendorWindow(_vendor, false);

            addModifyWindow.ShowDialog();
            if (addModifyWindow.DialogResult.HasValue && addModifyWindow.DialogResult.Value)
            {
                DisplayVendor();
                MessageBox.Show("Vendor succesfully updated ...");
            }
            else
            {
                ClearControls();
                GetVendor(_vendor.VendorId);
            }
        }
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            _vendor     = new Vendor();
            DataContext = _vendor;

            var addModifyWindow = new AddModifyVendorWindow(_vendor, true);

            addModifyWindow.ShowDialog();

            if (addModifyWindow.DialogResult.HasValue && addModifyWindow.DialogResult.Value == true)
            {
                DisplayVendor();
                MessageBox.Show("Vendor succesfully inserted...");
            }
            else
            {
                MessageBox.Show("User clicked Cancel");
            }
        }
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     AddModifyVendorWindow wpfAddModify = new AddModifyVendorWindow();
     wpfAddModify.addVendor = true;
     vendor = new Vendor();
     DataContext = vendor;
     wpfAddModify.vendor = vendor;
     wpfAddModify.ShowDialog();
     if (wpfAddModify.DialogResult.HasValue && wpfAddModify.DialogResult.Value)
     {
         vendor = wpfAddModify.vendor;
         this.DisplayVendor();
         MessageBox.Show("Vendor succesfully inserted ...");
     }
     else
     {
         MessageBox.Show("User clicked Cancel");
     }
     
 }
        private void btnModify_Click(object sender, RoutedEventArgs e)
        {
            AddModifyVendorWindow wpfAddModify;           
            wpfAddModify = new AddModifyVendorWindow();
           wpfAddModify.addVendor = false;
           wpfAddModify.vendor = vendor;  

            wpfAddModify.ShowDialog();
            if (wpfAddModify.DialogResult.HasValue && wpfAddModify.DialogResult.Value == true)
            {
                vendor = wpfAddModify.vendor;
                this.DisplayVendor();
                MessageBox.Show("Vendor succesfully updated ...");
            }
            else
            {
                this.ClearControls();
                this.GetVendor(vendor.VendorID);
            }
        }