Exemplo n.º 1
0
Arquivo: BALLL.cs Projeto: COVERT/SDAM
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (ListViewBALL.SelectedItems.Count == 1)
     {
         BALL ball = ListViewBALL.SelectedItems[0].Tag as BALL;
         ball.IDSTUDENT = Convert.ToInt32(comboBoxSUDENT.SelectedIndex.ToString().Split()[0]);
         ball.IDDISS    = Convert.ToInt32(comboBoxDIS.SelectedIndex.ToString().Split()[0]);
         ball.BALL1     = Convert.ToInt32(textBoxBALL.Text);
         Program.BD.SaveChanges();
         vis();
     }
 }
Exemplo n.º 2
0
Arquivo: BALLL.cs Projeto: COVERT/SDAM
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            if (comboBoxDIS.SelectedItem != null && comboBoxSUDENT.SelectedItem != null)
            {
                BALL ball = new BALL();

                ball.IDSTUDENT = Convert.ToInt32(comboBoxSUDENT.SelectedIndex.ToString().Split()[0]);
                ball.IDDISS    = Convert.ToInt32(comboBoxDIS.SelectedIndex.ToString().Split()[0]);
                ball.BALL1     = Convert.ToInt32(textBoxBALL.Text);
                Program.BD.BALL.Add(ball);
                Program.BD.SaveChanges();
                vis();
            }
            else
            {
                MessageBox.Show("данные не выбраны", "ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 3
0
Arquivo: BALLL.cs Projeto: COVERT/SDAM
 private void ListViewBALL_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ListViewBALL.SelectedItems.Count == 1)
     {
         BALL ball = ListViewBALL.SelectedItems[0].Tag as BALL;
         comboBoxSUDENT.Text = ball.SUDENT.LASTNAME;
         comboBoxSUDENT.Text = ball.SUDENT.NAME;
         comboBoxSUDENT.Text = Convert.ToString(ball.SUDENT.IDGRUP);
         comboBoxDIS.Text    = ball.DISS.PREPOD;
         comboBoxDIS.Text    = ball.DISS.SEMESTOR;
         comboBoxDIS.Text    = Convert.ToString(ball.DISS.GOD);
         textBoxBALL.Text    = Convert.ToString(ball.BALL1);
     }
     else
     {
         comboBoxSUDENT.Text = "";
         comboBoxSUDENT.Text = "";
         comboBoxSUDENT.Text = "";
         comboBoxDIS.Text    = "";
         comboBoxDIS.Text    = "";
         comboBoxDIS.Text    = "";
         textBoxBALL.Text    = "";
     }
 }