Example #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            ASYTP asytpSet = new ASYTP();

            asytpSet.Name_ASYTP = textBoxASYTP.Text;
            Program.HaloPolymer.ASYTP.Add(asytpSet);
            Program.HaloPolymer.SaveChanges();
            ShowASYTP();
        }
Example #2
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (listViewASYTP.SelectedItems.Count == 1)
     {
         ASYTP asytpSet = listViewASYTP.SelectedItems[0].Tag as ASYTP;
         asytpSet.Name_ASYTP = textBoxASYTP.Text;
         Program.HaloPolymer.SaveChanges();
         ShowASYTP();
     }
 }
Example #3
0
 private void listViewASYTP_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listViewASYTP.SelectedItems.Count == 1)
     {
         ASYTP asytpSet = listViewASYTP.SelectedItems[0].Tag as ASYTP;
         textBoxASYTP.Text = asytpSet.Name_ASYTP;
     }
     else
     {
         textBoxASYTP.Text = "";
     }
 }
Example #4
0
 private void buttonDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (listViewASYTP.SelectedItems.Count == 1)
         {
             ASYTP asytpSet = listViewASYTP.SelectedItems[0].Tag as ASYTP;
             Program.HaloPolymer.ASYTP.Remove(asytpSet);
             Program.HaloPolymer.SaveChanges();
             ShowASYTP();
         }
         textBoxASYTP.Text = "";
     }
     catch
     {
         MessageBox.Show("Невозможно удалить, эта запись используется!", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }