コード例 #1
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void InsertStudent()
 {
     var lastName = tbLastName.Text;
     var firstName = tbFirstName.Text;
     var middleName = tbMiddleName.Text;
     var birthday = DateTime.Parse(tbBirthday.Text);
     var student = new Student(firstName, lastName, middleName, birthday, int.Parse(DropDownList1.SelectedValue));
     _students.Add(student);
     _studentAccessor.Insert(student);
     GridView3.DataBind();
 }
コード例 #2
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void InsertStudent()
 {
     var lastName = ((TextBox)DetailsView1.Rows[0].Cells[1].Controls[0]).Text;
     var firstName = ((TextBox)DetailsView1.Rows[1].Cells[1].Controls[0]).Text;
     var middleName = ((TextBox)DetailsView1.Rows[2].Cells[1].Controls[0]).Text;
     var birthday = DateTime.Parse(((TextBox)DetailsView1.Rows[3].Cells[1].Controls[0]).Text);
     var student = new Student(firstName, lastName, middleName, birthday, 13);
     _students.Add(student);
     _studentAccessor.Insert(student);
     GridView3.DataBind();
 }