private void buttonDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (listViewDevelopment.SelectedItems.Count == 1)
         {
             Website_developmen website_Developmen = listViewDevelopment.SelectedItems[0].Tag as Website_developmen;
             Program.Sinaptik.Website_developmen.Remove(website_Developmen);
             Program.Sinaptik.SaveChanges();
             ShowDevelopmet();
         }
         comboBoxSites.SelectedItem     = null;
         comboBoxPrototip.SelectedItem  = null;
         comboBoxDesign.SelectedItem    = null;
         comboBoxVerstka.SelectedItem   = null;
         comboBoxMarketing.SelectedItem = null;
     }
     catch
     {
         comboBoxSites.SelectedItem     = null;
         comboBoxPrototip.SelectedItem  = null;
         comboBoxDesign.SelectedItem    = null;
         comboBoxVerstka.SelectedItem   = null;
         comboBoxMarketing.SelectedItem = null;
     }
 }
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (listViewDevelopment.SelectedItems.Count == 1)
            {
                Website_developmen website_Developmen = listViewDevelopment.SelectedItems[0].Tag as Website_developmen;
                website_Developmen.IdSites   = Convert.ToInt32(comboBoxSites.SelectedIndex.ToString());
                website_Developmen.Prototip  = comboBoxPrototip.Text;
                website_Developmen.Design    = comboBoxDesign.Text;
                website_Developmen.Verstka   = comboBoxVerstka.Text;
                website_Developmen.Marceting = comboBoxMarketing.Text;

                Program.Sinaptik.SaveChanges();
                ShowDevelopmet();
            }
        }
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     if (comboBoxSites.SelectedItem != null)
     {
         Website_developmen website_Developmen = new Website_developmen();
         website_Developmen.IdSites   = Convert.ToInt32(comboBoxSites.SelectedIndex.ToString());
         website_Developmen.Prototip  = comboBoxPrototip.Text;
         website_Developmen.Design    = comboBoxDesign.Text;
         website_Developmen.Verstka   = comboBoxVerstka.Text;
         website_Developmen.Marceting = comboBoxMarketing.Text;
         Program.Sinaptik.Website_developmen.Add(website_Developmen);
         Program.Sinaptik.SaveChanges();
         ShowDevelopmet();
     }
     else
     {
         MessageBox.Show("Данные не выбраны", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 private void listViewDevelopment_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listViewDevelopment.SelectedItems.Count == 1)
     {
         Website_developmen website_Developmen = listViewDevelopment.SelectedItems[0].Tag as Website_developmen;
         comboBoxSites.SelectedIndex     = comboBoxSites.FindString(website_Developmen.IdSites.ToString());
         comboBoxPrototip.SelectedIndex  = comboBoxPrototip.FindString(website_Developmen.Prototip.ToString());
         comboBoxDesign.SelectedIndex    = comboBoxDesign.FindString(website_Developmen.Design.ToString());
         comboBoxVerstka.SelectedIndex   = comboBoxVerstka.FindString(website_Developmen.Verstka.ToString());
         comboBoxMarketing.SelectedIndex = comboBoxMarketing.FindString(website_Developmen.Marceting.ToString());
     }
     else
     {
         comboBoxSites.SelectedItem     = null;
         comboBoxPrototip.SelectedItem  = null;
         comboBoxDesign.SelectedItem    = null;
         comboBoxVerstka.SelectedItem   = null;
         comboBoxMarketing.SelectedItem = null;
     }
 }