コード例 #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if(TextBox1.Text!=""&&TextBox2.Text!="")
            {
                 var student = new Student {
                    Number=TextBox1.Text,
                    Name=TextBox2.Text,
                    Sex=DropDownList3.Text,
                    Age=TextBox3.Text,
                    Class=DropDownList1.Text+DropDownList2.Text,
                    Contact=TextBox4.Text,
                    Adress=TextBox5.Text
                };
                data.Student.InsertOnSubmit(student);
                data.SubmitChanges();
                Response.Write("<script language='javascript'>alert('录入成功!')</script>");

            }
            else
            {
                Response.Write("<script language='javascript'>alert('数据不合法,请重新输入!');history.back();</script>");
            }
        }
コード例 #2
0
 partial void UpdateStudent(Student instance);
コード例 #3
0
 partial void DeleteStudent(Student instance);
コード例 #4
0
 partial void InsertStudent(Student instance);