Beispiel #1
0
        public UpdateOLA(Hoofdvenster hoofdvenster)
        {
            InitializeComponent();
            logic = new Logica();
            CmbDocent.DataSource    = logic.GetDocents();
            CmbDocent.DisplayMember = "fullname";

            CmbOPO.DataSource    = logic.GetAllOPOs();
            CmbOPO.DisplayMember = "Naam";

            if (hoofdvenster.GetIndex().Equals("Edit"))
            {
                edit                    = true;
                GetVorigeDocent         = (Docent)hoofdvenster.GetDocent();;
                GetVorigeOpo            = hoofdvenster.GetValues().SelectedItems[0].SubItems[2].Text;
                TxtCode.Text            = hoofdvenster.GetValues().SelectedItems[0].SubItems[0].Text;
                TxtCode.ReadOnly        = true;
                TxtNaam.Text            = hoofdvenster.GetValues().SelectedItems[0].SubItems[1].Text;
                NudStudiepunten.Value   = Convert.ToInt32(hoofdvenster.GetValues().SelectedItems[0].SubItems[3].Text);
                CmbOPO.SelectedIndex    = CmbOPO.FindStringExact(hoofdvenster.GetValues().SelectedItems[0].SubItems[2].Text);
                CmbDocent.SelectedIndex = CmbDocent.FindStringExact(hoofdvenster.GetCmb());
                docent                  = (Docent)CmbDocent.SelectedItem;
                opo = (OPO)CmbOPO.SelectedItem;
            }
        }
        private void buttonOK_Click(object sender, EventArgs e)
        {
            OPO newopo = new OPO((int)logic.opos.Count + 1, (string)textBoxCode.Text, (string)textBoxName.Text, (int)numericUpDownSTP.Value, logic.lecturers.ToArray()[comboBoxResp.SelectedIndex], (Fase)comboBoxFase.SelectedItem, (Semester)comboBoxSemester.SelectedItem);

            logic.AddOPO(newopo);
            this.Close();
        }
Beispiel #3
0
 public void AddOPO(OPO opo)
 {
     using (var context = new DatabaseContext())
     {
         opo.coordinator = null;
         context.OPOs.Add(opo);
         context.SaveChanges();
     }
 }
Beispiel #4
0
 public void AddOla(string code, string naam, int studiepunten, Docent docent, OPO opo)
 {
     datalaag.AddOla(code, naam, studiepunten, docent, opo);
 }
Beispiel #5
0
 public void InsertOPO(OPO opo)
 {
     opos.Add(opo);
     dataContext.SaveChanges();
 }