public void updateexam(exam item, int index) { exam a = years[selectedyear].getsubject(selectedsubject).getexam(index); a.setduration(item.getduration()); a.setmarks(item.getmarks()); a.setname(item.getname()); a.setoverallvalue(item.getoverallvalue()); a.setstartdate(item.getstartdate()); a.settotalmarks(item.gettotalmarks()); updateexams(); }
public examedit(ref exam it, int index) { InitializeComponent(); i = index; theexam = it; textBox1.Text = theexam.getname(); numericUpDown1.Value = theexam.getoverallvalue(); textBox2.Text = theexam.getmarks().ToString(); numericUpDown2.Value = (decimal)theexam.gettotalmarks(); dateTimePicker1.Value = theexam.getstartdate(); dateTimePicker2.Value = theexam.getstartdate() + theexam.getduration(); }