Beispiel #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            GRUP grup = new GRUP();

            grup.NAZVANIE    = textBoxNAME.Text;
            grup.SPECIALNOST = textBoxSPE.Text;
            grup.GOD         = Convert.ToInt32(textBoxGOD.Text);
            Program.BD.GRUP.Add(grup);
            Program.BD.SaveChanges();
            showvis();
        }
Beispiel #2
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (ListViewG.SelectedItems.Count == 1)
            {
                GRUP grup = ListViewG.SelectedItems[0].Tag as GRUP;

                grup.NAZVANIE    = textBoxNAME.Text;
                grup.SPECIALNOST = textBoxSPE.Text;
                grup.GOD         = Convert.ToInt32(textBoxGOD.Text);
                Program.BD.SaveChanges();
                showvis();
            }
        }
Beispiel #3
0
 private void ListViewG_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ListViewG.SelectedItems.Count == 1)
     {
         GRUP grup = ListViewG.SelectedItems[0].Tag as GRUP;
         textBoxNAME.Text = grup.NAZVANIE;
         textBoxSPE.Text  = grup.SPECIALNOST;
         textBoxGOD.Text  = Convert.ToString(grup.GOD);
     }
     else
     {
         textBoxNAME.Text = "";
         textBoxSPE.Text  = "";
         textBoxGOD.Text  = "";
     }
 }