protected void Add_Click(object sender, EventArgs e) { var currentStudent = new Student(); currentStudent.Namediscipline = TextBox1.Text; currentStudent.Hours = TextBox2.Text; currentStudent.Professor = TextBox3.Text; currentStudent.Assessment = TextBox4.Text; currentStudent.Date = TextBox5.Text; new DataAccess().Insert(currentStudent); }
protected void Add_Click(object sender, EventArgs e) { DateTime date1 = DateTime.Now; var currentStudent = new Student(); //tb1.Text = tb.InnerText; currentStudent.FName = tb.InnerText; currentStudent.FName += " "; currentStudent.FName += date1; new DataAccess().Insert(currentStudent); tb.InnerText = ""; }
public void Insert(Student student) { var collection = GetCollection(); collection.Insert(student); }