protected void btnSAVE_Click(object sender, EventArgs e) { string sql = "Select * From STUDENT_GROUP Where GROUP_CODE='" + txtGROUP_CODE.Text + "'"; List <StdGroupData> chkDup = new StdGroup().getStdGroupManual(sql); if (chkDup.Count > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowBox", "alert('รหัสกลุ่มผู้เรียนซ้ำ!');", true); } else { StdGroupData data = new StdGroupData(); data.StdGroup_Code = txtGROUP_CODE.Text; data.StdGroup_Thai = txtGROUP_THAINAME.Text; data.StdGroup_Eng = txtGROUP_ENGNAME.Text; string result = ""; result = new StdGroup().insertSection(data); if (result == "OK") { Response.Redirect("list_Student_Group.aspx"); } } }
protected void btnSAVE_Click(object sender, EventArgs e) { StdGroupData data = new StdGroupData(); data.StdGroup_Code = txtGROUP_CODE.Text; data.StdGroup_Thai = txtGROUP_THAINAME.Text; data.StdGroup_Eng = txtGROUP_ENGNAME.Text; string result = ""; try { result = new StdGroup().updateSection(data); if (result == "OK") { Response.Redirect("list_Student_Group.aspx"); } else { Response.Redirect("list_Student_Group.aspx"); } } catch (Exception E) { //string response = E.Message.ToString(); //HttpContext.Current.Session["response"] = "Unit Test: " + response; //HttpContext.Current.Response.Redirect("err_response.aspx"); } }
protected void btnOK_Click(object sender, EventArgs e) { try { string result = new StdGroup().deleteSection(code); if (result == "OK") { Response.Redirect("list_Student_Group.aspx"); } else { Response.Redirect("list_Student_Group.aspx"); } } catch { Response.Redirect("list_Student_Group.aspx"); } }