protected void modUpdateCommand(Object sender, GridViewUpdateEventArgs e)
        {
            Label lblDistrictIDEdit = (Label)GridView1.Rows[e.RowIndex].FindControl("lblDistrictIDEdit");
            TextBox txtDistrictTHEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtDistrictTHEdit");
            TextBox txtDistrictENEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtDistrictENEdit");
            DropDownList ddlAmphurIDEdit = (DropDownList)GridView1.Rows[e.RowIndex].FindControl("ddlAmphurIDEdit");
            DropDownList ddlProvinceIDEdit = (DropDownList)GridView1.Rows[e.RowIndex].FindControl("ddlProvinceIDEdit");
            TextBox txtPostCodeEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtPostCodeEdit");
            TextBox txtNoteEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtNoteEdit");

            ClassDistrict d = new ClassDistrict(Convert.ToInt32(lblDistrictIDEdit.Text)
                , txtDistrictTHEdit.Text
                , txtDistrictENEdit.Text
                , Convert.ToInt32(ddlAmphurIDEdit.SelectedValue)
                , Convert.ToInt32(ddlProvinceIDEdit.SelectedValue)
                , Convert.ToInt32(txtPostCodeEdit.Text)
                , txtNoteEdit.Text);

            if (d.CheckUseDistrictName())
            {
                d.UpdateDistrict();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('อัพเดทข้อมูลเรียบร้อย')", true);
                GridView1.EditIndex = -1;
                BindData1();
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ข้อมูลที่จะอัพเดท มีอยู่ในระบบแล้ว !')", true);
            }
        }
        protected void lbuSubmit_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtInsertDistrictTH.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ ชื่อตำบลภาษาไทย')", true);
                return;
            }

            if (string.IsNullOrEmpty(txtInsertDistrictEN.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ ชื่อตำบลภาษาอังกฤษ')", true);
                return;
            }
            if (ddlInsertAmphur.SelectedIndex == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาเลือก อำเภอ')", true);
                return;
            }
            if (ddlInsertProvince.SelectedIndex == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาเลือก จังหวัด')", true);
                return;
            }
            if (string.IsNullOrEmpty(txtInsertPostCode.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสไปรษณีย์')", true);
                return;
            }

            ClassDistrict d = new ClassDistrict();
            d.DISTRICT_TH = txtInsertDistrictTH.Text;
            d.DISTRICT_EN = txtInsertDistrictEN.Text;
            d.AMPHUR_ID = Convert.ToInt32(ddlInsertAmphur.SelectedValue);
            d.PROVINCE_ID = Convert.ToInt32(ddlInsertProvince.SelectedValue);
            d.POST_CODE = Convert.ToInt32(txtInsertPostCode.Text);
            d.NOTE = txtInsertNote.Text;

            if (d.CheckUseDistrictName())
            {
                d.InsertDistrict();
                BindData();
                ClearData();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('เพิ่มข้อมูลเรียบร้อย')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ข้อมูลที่จะเพิ่ม มีอยู่ในระบบแล้ว !')", true);
            }
        }