protected void lbtDelete_Click(object sender, EventArgs e) { DTO.Subjectr subject = new DTO.Subjectr(); subject.LICENSE_TYPE_CODE = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblLicenCode")).Text; subject.SUBJECT_CODE = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblSubjectCode")).Text; var res = biz.DeleteSubject(subject); if (res.ErrorMsg != null) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { BinGrid(); UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_003; UCModalSuccess1.ShowModalSuccess(); } }
public DTO.ResponseService <string> DeleteSubject(DTO.Subjectr subject) { return(svc.DeleteSubject(subject)); }
public DTO.ResponseService <string> AddSubject(DTO.Subjectr subject) { return(svc.AddSubject(subject)); }
protected void btnSave_Click(object sender, EventArgs e) { if (btnSave.Text == "บันทึก") { string validate = Validation.Validate(Page, "a"); if (validate != "") { UCModalError1.ShowMessageError = validate; UCModalError1.ShowModalError(); } else { DTO.Subjectr subject = new DTO.Subjectr(); subject.LICENSE_TYPE_CODE = ddlType.SelectedValue; subject.SUBJECT_NAME = txtSubjectName.Text; subject.SUBJECT_CODE = txtSubjectCode.Text; subject.GROUP_ID = ddlGroup.SelectedValue.ToShort(); // subject.EXAM_PASS = txtPass.Text.ToShort(); subject.MAX_SCORE = txtMaxScore.Text.ToShort(); subject.USER_ID = base.UserId; var res = biz.AddSubject(subject); if (res.ErrorMsg != null) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { BinGrid(); UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_001; UCModalSuccess1.ShowModalSuccess(); txtSubjectCode.Text = ""; txtSubjectName.Text = ""; txtMaxScore.Text = ""; // txtPass.Text = ""; ddlGroup.SelectedValue = ""; } } } else //แก้ไขข้อมูล { string validate = Validation.Validate(Page, "a"); if (validate != "") { UCModalError1.ShowMessageError = validate; UCModalError1.ShowModalError(); } else { DTO.Subjectr subject = new DTO.Subjectr(); subject.LICENSE_TYPE_CODE = ddlType.SelectedValue; subject.SUBJECT_NAME = txtSubjectName.Text; subject.SUBJECT_CODE = LabelSubjectId.Text; subject.MAX_SCORE = txtMaxScore.Text.ToShort(); // subject.EXAM_PASS = txtPass.Text.ToShort(); // subject.GROUP_ID = ddlGroup.SelectedValue.ToShort(); var res = biz.UpdateSubject(subject); if (res.ErrorMsg != null) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { BinGrid(); UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_002; UCModalSuccess1.ShowModalSuccess(); } } } }