示例#1
0
        protected void btn_register_Click(object sender, EventArgs e)
        {
            StudentsOperation students = new StudentsOperation();
            studentmodel      model    = new studentmodel()
            {
                fname         = fname.Text,
                lname         = lname.Text,
                email         = email.Text,
                mobile        = mobile.Text,
                qualification = qualification.Text,
                address       = address.Text,
                gender        = gen.Checked == true ? "Male" : gen1.Checked == true ? "Female" : gen2.Checked == true ? "Transgender" : "Unknown"
            };

            bool result = students.CreateStudent(model);

            if (result == true)
            {
                lblmsg.Text = "Student created successfully...";
                System.Threading.Thread.Sleep(5000);
                Response.Redirect("Show-All-Students.aspx");
            }
            else
            {
                lblmsg.Text = "Student not created !";
            }
        }
 public Show_All_Students()
 {
     operation = new StudentsOperation();
 }