}             //ChengeTextBlock_MouseDown

        private void MainSupDockPanel_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.F2: {
                AddSuppliersWindow adsw = new AddSuppliersWindow();
                if (adsw.ShowDialog() == true)
                {
                    Suppliers temp = adsw.sup;
                    try {
                        using (SmallBusinessDBEntities context = new SmallBusinessDBEntities()) {
                            context.Suppliers.Add(temp);
                            context.SaveChanges();
                            MessageBox.Show("Изменения сохранены");
                            suppList.Add(temp);
                            SuppliersDataGrid.Items.Refresh();
                        }    //using
                    }        //try
                    catch (Exception ex) {
                        MessageBox.Show(ex.Message);
                    } //catch
                }     //if
            }         //case Key.F2
            break;

            default:
                break;
            } //switch
        }     //MainSupDockPanel_KeyDown
        }//SerchByCompanyNameTextBox_TextChanged

        private void ChengeTextBlock_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Suppliers item = (SuppliersDataGrid.SelectedItem as Suppliers);

            if (item != null)
            {
                AddSuppliersWindow asw = new AddSuppliersWindow(item);
                if (asw.ShowDialog() == true)
                {
                    Suppliers temp = asw.sup;

                    if (item.companyName != temp.companyName || item.contactName != temp.contactName)
                    {
                        try {
                            using (SmallBusinessDBEntities context = new SmallBusinessDBEntities()) {
                                var ppp = context.Suppliers.FirstOrDefault(s => s.supplierID == temp.supplierID);
                                //context.Groups.FirstOrDefault(s => s.groupID == temp.groupID).groupDescription = temp.groupDescription;
                                ppp.companyName = temp.companyName;
                                ppp.contactName = temp.contactName;

                                context.SaveChanges();
                                MessageBox.Show("Изменения сохранены");
                                ppp             = suppList.FirstOrDefault(s => s.supplierID == temp.supplierID);
                                ppp.companyName = temp.companyName;
                                ppp.contactName = temp.contactName;
                                SuppliersDataGrid.Items.Refresh();
                            }
                        }
                        catch (Exception ex) {
                            MessageBox.Show(ex.Message);
                        }
                    } //if
                }     //if
            }         //if
        }             //ChengeTextBlock_MouseDown