예제 #1
0
        //點選查詢鈕時的事件
        protected void Button4_Click(object sender, EventArgs e)
        {
            string newStuID = this.Text_Student_ID.Text;

            this.GridView1.DataSource = HwDBExecutor.ReadStudent(newStuID);
            this.GridView1.DataBind();
        }
예제 #2
0
        //點選刪除鈕時的事件
        protected void Button2_Click(object sender, EventArgs e)
        {
            this.Response.Write("");
            string newStuID = this.Text_Student_ID.Text;

            HwDBExecutor.Delete(newStuID);
        }
        //點選查詢鈕時的事件
        protected void ButtonRead_Click(object sender, EventArgs e)
        {
            string newRecID = this.TextBoxRecordID.Text;

            this.GridView1.DataSource = HwDBExecutor.ReadRegister(newRecID);
            this.GridView1.DataBind();
        }
        //點選刪除鈕時的事件
        protected void ButtonDelete_Click(object sender, EventArgs e)
        {
            this.Response.Write("");
            string newRecID = this.TextBoxRecordID.Text;

            HwDBExecutor.DeleteFromRegister(newRecID);
        }
        //點選更新鈕時的事件
        protected void ButtonUpdate_Click(object sender, EventArgs e)
        {
            string newRecID = this.TextBoxRecordID.Text;
            string newStuID = this.TextBoxStudentID.Text;
            string newCouID = this.TextBoxCourseID.Text;

            HwDBExecutor.UpdateToRegister(newRecID, newStuID, newCouID);
        }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //畫面讀取時的事件
     if (!IsPostBack)
     {
         this.GridView1.DataSource = HwDBExecutor.ReadTable1Data();
         this.GridView1.DataBind();
     }
 }
예제 #7
0
        //點選更新鈕時的事件
        protected void Button3_Click(object sender, EventArgs e)
        {
            string   newStuID = this.Text_Student_ID.Text;
            string   newName  = this.Text_Name.Text;
            Calendar newBir   = this.Calendar_Birthday;
            string   newBir2  = newBir.SelectedDate.ToString("yyyy/MM/dd");
            string   newAddr  = this.Text_Address.Text;
            string   newEmail = this.Text_Email.Text;
            string   newCell  = this.Text_CellPhone.Text;
            string   newPass  = this.Text_Password.Text;
            string   newExp   = this.RadioButtonList2.Text;
            string   newEud   = this.RadioButtonList1.Text;
            string   newSch   = this.DropDownList_School.Text;

            HwDBExecutor.Update(newStuID, newName, newBir2, newAddr, newEmail, newCell, newPass, newExp, newEud, newSch);
        }
 //畫面讀取時的事件
 protected void Page_Load(object sender, EventArgs e)
 {
     this.GridView1.DataSource = HwDBExecutor.ReadTable2Data();
     this.GridView1.DataBind();
 }