コード例 #1
0
 public void UpdateStudent(int id)
 {
     TryUpdateModel(currentStudent);
     using (var client = new StudentsManagerClient())
     {
         client.UpdateStudent(currentStudent.Id, currentStudent.FirstName, currentStudent.LastName, currentStudent.Age.ToString(), currentStudent.Sex);
     }
 }
コード例 #2
0
        protected void StudentForm_OnItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            string firstName = ((TextBox) this.StudentForm.FindControl("txtFirstName")).Text;
            string lastName = ((TextBox)this.StudentForm.FindControl("txtLastName")).Text;
            string sex = ((DropDownList) this.StudentForm.FindControl("ddlSex")).SelectedValue;
            string age = ((TextBox) this.StudentForm.FindControl("txtAge")).Text;

            using (var client = new StudentsManagerClient())
            {
                client.UpdateStudent(Id, firstName, lastName, age, sex);
            }
        }