Esempio n. 1
0
        protected void btnSubmitGradPROG_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtInsertGradPROGID.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสสาขาวิชาที่จบการศึกษาสูงสุด')", true);
                return;
            }
            if (string.IsNullOrEmpty(txtInsertGradPROGName.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ ชื่อสาขาวิชาที่จบการศึกษาสูงสุด')", true);
                return;
            }
            ClassGradProgram gp = new ClassGradProgram();

            gp.GRAD_PROG_ID   = txtInsertGradPROGID.Text;
            gp.GRAD_PROG_NAME = txtInsertGradPROGName.Text;

            if (gp.CheckUseGradProgramID())
            {
                gp.InsertGradProgram();
                BindData();
                ClearData();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('เพิ่มข้อมูลเรียบร้อย')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('มีรหัสสาขาวิชาที่จบการศึกษาสูงสุดนี้ อยู่ในระบบแล้ว !')", true);
            }
        }
Esempio n. 2
0
        void BindData1()
        {
            ClassGradProgram gp = new ClassGradProgram();
            DataTable        dt = gp.GetGradProgramSearch(txtSearchGradPROGID.Text, txtSearchGradPROGName.Text);

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
Esempio n. 3
0
        void BindData()
        {
            ClassGradProgram gp = new ClassGradProgram();
            DataTable        dt = gp.GetGradProgram("", "");

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
Esempio n. 4
0
        protected void btnSearchRefresh_Click(object sender, EventArgs e)
        {
            ClearData();
            ClassGradProgram gp = new ClassGradProgram();
            DataTable        dt = gp.GetGradProgram("", "");

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
Esempio n. 5
0
        protected void modDeleteCommand(Object sender, GridViewDeleteEventArgs e)
        {
            string           id = GridView1.DataKeys[e.RowIndex].Value.ToString();
            ClassGradProgram gp = new ClassGradProgram();

            gp.GRAD_PROG_ID = id;
            gp.DeleteGradProgram();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ลบข้อมูลเรียบร้อย')", true);

            GridView1.EditIndex = -1;
            BindData1();
        }
Esempio n. 6
0
        protected void modUpdateCommand(Object sender, GridViewUpdateEventArgs e)
        {
            TextBox txtGradPROGIDEdit   = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtGradPROGIDEdit");
            TextBox txtGradPROGNameEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtGradPROGNameEdit");

            ClassGradProgram gp = new ClassGradProgram(txtGradPROGIDEdit.Text
                                                       , txtGradPROGNameEdit.Text);

            gp.UpdateGradProgram();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('อัพเดทข้อมูลเรียบร้อย')", true);
            GridView1.EditIndex = -1;
            BindData1();
        }
Esempio n. 7
0
 protected void btnSearchGradPROG_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtSearchGradPROGID.Text) && string.IsNullOrEmpty(txtSearchGradPROGName.Text))
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณากรอก คำค้นหา')", true);
         return;
     }
     else
     {
         ClassGradProgram gp = new ClassGradProgram();
         DataTable        dt = gp.GetGradProgramSearch(txtSearchGradPROGID.Text, txtSearchGradPROGName.Text);
         GridView1.DataSource = dt;
         GridView1.DataBind();
         SetViewState(dt);
     }
 }