Пример #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            tClass x = new tClass();

            x.f年級   = txtGrade.Text;
            x.f班號   = txtClass.Text;
            x.f導師姓名 = txtName.Text;
            x.f學級年度 = txtYear.Text;

            dbDemoDataContext db = new dbDemoDataContext();

            db.tClass.InsertOnSubmit(x);
            db.SubmitChanges();
            lblMsg.Visible = true;
            lblMsg.Text    = "新增資料成功";
        }
Пример #2
0
        protected void btnAdd2_Click(object sender, EventArgs e)
        {
            tParents x = new tParents();

            x.f家長姓名 = txtName2.Text;
            x.f家長生日 = txtBirthday2.Text;
            x.f家長密碼 = txtPassword2.Text;
            x.f身份區分 = exampleFormControlSelect2.Text;

            dbDemoDataContext db = new dbDemoDataContext();

            db.tParents.InsertOnSubmit(x);
            db.SubmitChanges();
            lblMsg2.Visible = true;
            lblMsg2.Text    = "新增資料成功";
        }
Пример #3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            tStudent x = new tStudent();

            x.f學生姓名 = txtName.Text;
            x.f學生生日 = txtBirthday.Text;
            x.f學生密碼 = txtPassword.Text;
            x.f學生性別 = ddlGender.Text;
            x.f身份區分 = exampleFormControlSelect1.Text;

            dbDemoDataContext db = new dbDemoDataContext();

            db.tStudent.InsertOnSubmit(x);
            db.SubmitChanges();
            lblMsg.Visible = true;
            lblMsg.Text    = "新增資料成功";
        }
Пример #4
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            //SqlDataSource sds = new SqlDataSource();
            //sds.ConnectionString = @"Data Source=104.46.226.187\LetNoBook,1433;Initial Catalog=letnobookDB;Persist Security Info=True;User ID=test;Password=1234";
            //sds.InsertCommand = getInsertsql();
            //sds.Insert();
            //lblMsg.Visible = true;
            //lblMsg.Text = "新增資料成功";
            tTeacher x = new tTeacher();

            x.f老師姓名 = txtName.Text;
            x.f老師生日 = datepicker.Text;
            x.f老師密碼 = txtPassword.Text;
            x.f老師性別 = ddlGender.Text;
            x.f身份區分 = exampleFormControlSelect1.Text;

            dbDemoDataContext db = new dbDemoDataContext();

            db.tTeacher.InsertOnSubmit(x);
            db.SubmitChanges();
            lblMsg.Visible = true;
            lblMsg.Text    = "新增資料成功";
        }