예제 #1
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        int count = new PreInstitute().getCountPreInstitute(txtINSTITUTE_CODE.Text);

        if (count > 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowBox", "alert('รหัสสถานศึกษาซ้ำ! (" + txtINSTITUTE_CODE.Text + ")' );", true);
        }
        else
        {
            preInstituteData.Institute_Code          = txtINSTITUTE_CODE.Text;
            preInstituteData.Institute_Thainame      = txtINSTITUTE_THAINAME.Text;
            preInstituteData.Institute_Engname       = txtINSTITUTE_ENGNAME.Text;
            preInstituteData.Institute_Province_Code = ddlINSTITUTE_PROVINCE.SelectedValue;

            string result = new PreInstitute().insertPreInstitute(preInstituteData);

            if (result == "OK")
            {
                divBody.Visible    = false;
                divSuccess.Visible = true;
                divFail.Visible    = false;
            }
            else
            {
                divBody.Visible    = false;
                divSuccess.Visible = false;
                divFail.Visible    = true;
            }
        }
    }
예제 #2
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        PreInstituteData preInstituteSave = new PreInstituteData();

        preInstituteSave.Institute_Code          = txtINSTITUTE_CODE.Text;
        preInstituteSave.Institute_Thainame      = txtINSTITUTE_THAINAME.Text;
        preInstituteSave.Institute_Engname       = txtINSTITUTE_ENGNAME.Text;
        preInstituteSave.Institute_Province_Code = ddlINSTITUTE_PROVINCE.SelectedValue;

        String result = new PreInstitute().updatePreInstitute(preInstituteSave);

        Response.Redirect("list_Grad_Institute.aspx");
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string result = new PreInstitute().deletePreInstitute(Institute_Code);

        Response.Redirect("list_Grad_Institute.aspx");
    }