protected void AddStudent_Click(object sender, EventArgs e)
        {
            int studentId = 0;

            int.TryParse(StudentIdHiddenField.Value, out studentId);

            DA.student student = new DataAccess.student();
            student.fname   = FnameBox.Text;
            student.Surname = SnameBox.Text;
            student.bcode   = Int32.Parse(SemBox.Text);


            if (studentId > 0)
            {
                student.admno = studentId;

                DA.Manager.UpdateStudent(student);
            }
            else
            {
                DA.Manager.InsertStudent(student);
            }

            //After insert, redirect to update page
            Response.Redirect(String.Format("AddNewStudent.aspx?StudentId={0}", student.admno));
        }
示例#2
0
 partial void Deletestudent(student instance);
示例#3
0
 partial void Updatestudent(student instance);
示例#4
0
 partial void Insertstudent(student instance);