protected void btnUpdate_Click(object sender, EventArgs e) { var validate = Validation.Validate(this, "b"); if (validate != "") { UCModalError1.ShowMessageError = validate; UCModalError1.ShowModalError(); } else { DTO.GroupSubject group = new DTO.GroupSubject(); group.ID = HID.Value.ToDecimal(); group.GROUP_NAME = txtUpdateGroupName.Text; group.EXAM_PASS = txtUpdatePass.Text.ToDecimal(); group.STATUS = "A"; var res = biz.UpdateSubjectGroup(group); if (res.ErrorMsg == null) { BindGrid(); UCModalSuccess1.ShowMessageSuccess = "แก้ไขข้อมูลสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } else { UCModalError1.ShowMessageError = "แก้ไขข้อมูลไม่สำเร็จ"; UCModalError1.ShowModalError(); } } }
protected void btnSaveCourse_Click(object sender, EventArgs e) { if (hidNewCourse.Value == "") { UCModalError1.ShowMessageError = "คุณยังไม่ได้เลือกหลักสูตรใหม่"; UCModalError1.ShowModalError(); } else if (hidNewCourse.Value == hidOldCourse.Value) { UCModalError1.ShowMessageError = "หลักสูตรที่คุณเลือกได้ถูกใช้อยู่แล้ว"; UCModalError1.ShowModalError(); } else { var res = biz.ActiveConditionGroup(hidNewCourse.Value, ddlType.SelectedValue); if (res.ErrorMsg == null) { UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } } }
protected void btnUpdate_Click(object sender, EventArgs e) { DTO.LicenseTypet licensetype = new DTO.LicenseTypet(); licensetype.AGENT_TYPE = ddlAgentTypeUpdate.SelectedValue; licensetype.INSURANCE_TYPE = ddlInsuranUpdate.SelectedValue; licensetype.LICENSE_TYPE_CODE = hdTypeCode.Value; licensetype.LICENSE_TYPE_NAME = txtUpdatename.Text; var res = biz.UpdateLicenseType(licensetype); if (res.ErrorMsg != null) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { txtLicenseName.Text = ""; BindDrop(); ddlInsuran.SelectedValue = ""; ddlAgentype.SelectedValue = ""; UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_002; UCModalSuccess1.ShowModalSuccess(); } ModalPopupUpdate.Hide(); }
protected void btnSave_Click(object sender, EventArgs e) { string validate = Validation.Validate(Page, "a"); if (validate != "") { UCModalError1.ShowMessageError = validate; UCModalError1.ShowModalError(); return; } GBHoliday holiday = new GBHoliday(); holiday.HL_DATE = Convert.ToDateTime(txtDateHoliday.Text); holiday.HL_DESC = txtNameHoliday.Text; var res = biz.AddHoliday(holiday); if (res.ErrorMsg == null) { UCModalSuccess1.ShowMessageSuccess = Resources.infoSetHoliday_001; UCModalSuccess1.ShowModalSuccess(); BindGrid(); txtDateHoliday.Text = ""; txtNameHoliday.Text = ""; } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } }
protected void btnsave_Click(object sender, EventArgs e) { if (list_add_association.Count == 0 && list_delete_association.Count == 0) { UCModalError1.ShowMessageError = "ไม่ข้อมูลการทำรายการของคุณ"; UCModalError1.ShowModalError(); } else { var res = biz.AddAssocitionApplove(list_add_association, list_delete_association, base.UserId);// ModalPopup.Hide(); GvCheckDoc.DataSource = biz.SelectApploveDocumentType("").DataResponse; GvCheckDoc.DataBind(); if (res.IsError) { UCModalError1.ShowMessageError = "บันทึกข้อมูลไม่สำเร็จ"; UCModalError1.ShowModalError(); } else { UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } } }
protected void btnSaveDoctype_Click(object sender, EventArgs e) { var list = new List <DTO.ApploveDocumnetType>(); foreach (GridViewRow row in GvCheckDoc.Rows) { Label lbldoccode = (Label)row.FindControl("lbldoccode"); CheckBox check = (CheckBox)row.FindControl("check"); ApploveDocumnetType doc = new ApploveDocumnetType(); doc.APPROVE_DOC_TYPE = lbldoccode.Text; if (check.Checked) { doc.ITEM_VALUE = "Y"; } else { doc.ITEM_VALUE = "N"; } list.Add(doc); } var res = biz.UpdateApploveDoctype(list, base.UserId);// if (res.IsError) { UCModalError1.ShowMessageError = "บันทึกข้อมูลไม่สำเร็จ"; UCModalError1.ShowModalError(); } else { UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } }
private void Search() { txtCount.Text = txtCount.Text == "0" ? txtCount.Text = "20" : txtCount.Text; txtPage.Text = txtPage.Text == "0" ? txtPage.Text = "1" : txtPage.Text; DTO.ResponseService <DTO.GBHoliday[]> res = biz.SearchHoliday(txtSearch.Text, txtPage.Text.ToInt(), txtCount.Text.ToInt()); if (res.ErrorMsg == null) { GVholiday.DataSource = res.DataResponse; GVholiday.DataBind(); if (res.DataResponse.Count() != 0) { lblCount.Text = res.DataResponse.First() == null ? "" : res.DataResponse.First().COUNT.ToString(); lblPage.Text = Math.Ceiling((double)res.DataResponse.First().COUNT / txtCount.Text.ToInt()).ToString(); pnPage.Visible = true; } else { pnPage.Visible = false; txtCount.Text = "20"; txtPage.Text = "1"; } } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } }
protected void btnAdd_Click(object sender, EventArgs e) { if (ddlMemberType.SelectedIndex > 0) { dvOIC.Visible = true; txtMemberType.Text = ddlMemberType.SelectedItem.Text; txtMemberType.Enabled = false; ddlMemberType.Enabled = false; if (ddlMemberType.SelectedIndex == 2) { lbl_licent.Visible = true; fulSignature.Visible = true; lblDescription.Visible = true; } else { lbl_licent.Visible = false; fulSignature.Visible = false; lblDescription.Visible = false; } } else { UCModalError1.ShowMessageError = SysMessage.PleaseChooesTypeMemberOIC; UCModalError1.ShowModalError(); } }
protected void btnExportExcel_Click(object sender, ImageClickEventArgs e) { int total = lblTotal.Text == "" ? 0 : lblTotal.Text.ToInt(); if (total > base.EXCEL_SIZE_Key) { UCModalError1.ShowMessageError = SysMessage.ExcelSizeError; UCModalError1.ShowModalError(); UpdatePanelSearch.Update(); } else { try { Dictionary <string, string> columns = new Dictionary <string, string>(); columns.Add("ลำดับที่", "RUN_NO"); columns.Add("ประเภทใบเสร็จ", "PETITION_TYPE_NAME"); columns.Add("เลขที่ใบเสร็จ", "RECEIPT_NO"); columns.Add("ชื่อ-นามสกุล", "FLNAME"); columns.Add("เลขบัตรประชาชน", "ID_CARD_NO"); columns.Add("วันที่สั่งจ่าย", "PAYMENT_DATE"); columns.Add("วันที่ชำระเงิน", "ORDER_DATE"); columns.Add("เลขที่ใบอนุญาต", "LICENSE_NO"); columns.Add("จำนวนเงิน", "AMOUNT"); columns.Add("จำนวนครั้งที่พิมพ์", "PRINT_TIMES"); ExportBiz export = new ExportBiz(); var biz = new BLL.PaymentBiz(); var res = biz.GetReportNumberPrintBill(txtIDCard.Text, ddlLicenseType.SelectedValue, txtFirstName.Text, txtLastName.Text, 1, base.EXCEL_SIZE_Key, false); export.CreateExcel(res.DataResponse, columns); } catch { } } }
protected void hplCancel_Click(object sender, EventArgs e) { try { var gr = (GridViewRow)((LinkButton)sender).NamingContainer; var lblTimeCode = (Label)gr.FindControl("lblPlaceCode"); string Key = lblTimeCode.Text; ExamScheduleBiz biz = new ExamScheduleBiz(); DTO.ResponseMessage <bool> DelP = biz.DelPlace(Key, base.UserId.ToString()); Boolean Del_time = DelP.ResultMessage; if (!Del_time) { UCModalSuccess1.ShowMessageSuccess = "บันทึกสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } else { UCModalError1.ShowMessageError = "ไม่สามารถบันทึกได้"; UCModalError1.ShowModalError(); } btn_Search_Click(sender, e); } catch { } }
protected void btnSave_Click(object sender, EventArgs e) { var validate = Validation.Validate(this, "a"); if (validate != "") { UCModalError1.ShowMessageError = validate; UCModalError1.ShowModalError(); } else { DTO.GroupSubject group = new DTO.GroupSubject(); group.GROUP_NAME = txtGroupName.Text.Trim(); group.EXAM_PASS = txtExamPass.Text.ToDecimal(); var res = biz.AddSubjectGroup(group); if (res.ErrorMsg == null) { txtExamPass.Text = string.Empty; txtGroupName.Text = string.Empty; BindGrid(); UCModalSuccess1.ShowMessageSuccess = "บันทีกข้อมูลสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } } }
protected void lbtAddQualification_Click(object sender, EventArgs e) { if (ddlQualification.SelectedValue == "") { UCModalError1.ShowMessageError = Resources.errorRegisGeneral_001; UCModalError1.ShowModalError(); return; } DTO.TranSpecial ts = new DTO.TranSpecial(); ts.SPECIAL_TYPE_CODE = ddlQualification.SelectedValue; ts.SPECIAL_TYPE_DESC = ddlQualification.SelectedItem.Text; if (ListTranSpecial.FirstOrDefault(x => x.SPECIAL_TYPE_CODE == ddlQualification.SelectedValue) == null) { ListTranSpecial.Add(ts); GvQualification.DataSource = ListTranSpecial; GvQualification.DataBind(); ddlQualification.SelectedValue = ""; } else { UCModalError1.ShowMessageError = Resources.errorRegisGeneral_002; UCModalError1.ShowModalError(); ddlQualification.SelectedValue = ""; } }
protected void btn_Save_Click(object sender, EventArgs e) { try { if (ddlPlaceGroup.SelectedValue != "") { if (txtSeat.Text.Trim() == "" || txtPlace.Text.Trim() == "" || txtCode.Text.Trim() == "") { UCModalError1.ShowMessageError = "กรุณาระบุข้อมูลให้ครบ"; UCModalError1.ShowModalError(); } else { if (txtSeat.Text.ToInt() > 30000) { UCModalError1.ShowMessageError = "สนามสอบแต่ละแห่งสามารถรองรับผู้สมัครสอบได้สูงสุด 30,000 คน เท่านั้น"; UCModalError1.ShowModalError(); } else { if (txtCode.Text.Length == 5) { Boolean addnew = true; if (txtCode.Enabled == false) { addnew = false; } ExamScheduleBiz biz = new ExamScheduleBiz(); DTO.ResponseMessage <bool> SaveOK = biz.SavePlace(ddlPlaceG.SelectedValue.ToString(), ddlProvince.SelectedValue.ToString(), txtCode.Text, txtPlace.Text, txtSeat.Text, chkFree.Checked, base.UserId.ToString(), addnew, ddlPlaceGroup.SelectedValue.ToString()); if (SaveOK.ResultMessage == true) { UCModalSuccess1.ShowMessageSuccess = SysMessage.SaveSucess; UCModalSuccess1.ShowModalSuccess(); btn_Search_Click(sender, e); btn_Cancle_Click(sender, e); UpdatePanelUpload.Update(); } else { UCModalError1.ShowMessageError = SaveOK.ErrorMsg; UCModalError1.ShowModalError(); } } else { UCModalError1.ShowMessageError = "รหัสสนามสอบต้องมีจำนวน 5 ตัวอักษรเท่านั้น"; UCModalError1.ShowModalError(); } } } } } catch { } }
protected void btnadd_Click(object sender, EventArgs e) { if (ddlType.SelectedValue == "") { UCModalError1.ShowMessageError = "กรุณาเลือกประเภทใบอนุญาต"; UCModalError1.ShowModalError(); } else { fieldSubject.Visible = true; } }
protected void btn_Add_Click(object sender, EventArgs e) { try { if (Convert.ToInt32(st_hr.SelectedValue) > Convert.ToInt32(en_hr.SelectedValue)) { UCModalError1.ShowMessageError = "เวลาเริ่มต้นมากกว่าเวลาสิ้นสุด"; UCModalError1.ShowModalError(); return; } else if (st_hr.SelectedValue.ToString() == en_hr.SelectedValue.ToString()) { UCModalError1.ShowMessageError = "เวลาเริ่มต้นเท่ากับเวลาสิ้นสุด"; UCModalError1.ShowModalError(); return; } ExamRoomBiz biz = new ExamRoomBiz(); DTO.ResponseMessage <bool> AddTime = biz.Add_Time(st_hr.SelectedValue.ToString(), st_min.SelectedValue.ToString(), en_hr.SelectedValue.ToString(), en_min.SelectedValue.ToString(), base.UserId.ToString()); Boolean add_time = AddTime.ResultMessage; if (add_time) { UCModalSuccess1.ShowMessageSuccess = "บันทึกสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } else { UCModalError1.ShowMessageError = "ไม่สามารถบันทึกได้"; UCModalError1.ShowModalError(); } btn_Add.Visible = false; btn_Search.Visible = true; //st_hr.SelectedIndex = 0; //st_min.SelectedIndex = 0; //en_hr.SelectedIndex = 0; //en_min.SelectedIndex = 0; st_hr.Enabled = true; st_min.Enabled = true; en_min.Enabled = true; en_hr.Enabled = true; btn_Search_Click(sender, e); UpdatePanelGridviewExamTime.Update(); } catch { } }
protected void lbtSave_Click(object sender, EventArgs e) { LinkButton lbtUpdate = (LinkButton)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lbtUpdate"); LinkButton lbtSave = (LinkButton)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lbtSave"); LinkButton lbtCancel = (LinkButton)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lbtCancel"); DropDownList ddlQuali = (DropDownList)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("ddlQualification"); Label lblname = (Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblName"); Label lblcode = (Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblCode"); if (ddlQuali.SelectedValue == "") { UCModalError1.ShowMessageError = Resources.errorRegisGeneral_001; UCModalError1.ShowModalError(); UpdatePanelUpload.Update(); } else if (lblcode.Text == ddlQuali.SelectedValue) { lblcode.Text = ddlQuali.SelectedValue; lblname.Text = ddlQuali.SelectedItem.Text; lblcode.Visible = true; lblname.Visible = true; ddlQuali.Visible = false; lbtUpdate.Visible = true; lbtSave.Visible = false; lbtCancel.Visible = false; } else if (ListTranSpecial.FirstOrDefault(x => x.SPECIAL_TYPE_CODE == ddlQuali.SelectedValue) == null) { ListTranSpecial.Remove(ListTranSpecial.FirstOrDefault(x => x.SPECIAL_TYPE_CODE == lblcode.Text)); ListTranSpecial.Add(new TranSpecial { SPECIAL_TYPE_CODE = ddlQuali.SelectedValue, SPECIAL_TYPE_DESC = ddlQuali.SelectedItem.Text }); lblcode.Text = ddlQuali.SelectedValue; lblname.Text = ddlQuali.SelectedItem.Text; lblcode.Visible = true; lblname.Visible = true; ddlQuali.Visible = false; lbtUpdate.Visible = true; lbtSave.Visible = false; lbtCancel.Visible = false; } else { UCModalError1.ShowMessageError = Resources.errorRegisGeneral_002; UCModalError1.ShowModalError(); UpdatePanelUpload.Update(); } }
protected void lbtDelete_Click(object sender, EventArgs e) { var res = biz.DeleteSubjectGroup(((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblId")).Text); if (res.ErrorMsg == null) { BindGrid(); UCModalSuccess1.ShowMessageSuccess = "ลบข้อมูลสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } else { UCModalError1.ShowMessageError = "ลบข้อมูลไม่สำเร็จ"; UCModalError1.ShowModalError(); } }
protected void btn_Add_Click(object sender, EventArgs e) { if (ddlPlaceG.SelectedIndex > 0 && ddlProvince.SelectedIndex > 0) { ModalExamSchedule.Show(); UplExamSchedule.Update(); tblName.Visible = true; //ddlProvince.Enabled = false; //ddlPlaceG.Enabled = false; //ddlPlaceGroup.Enabled = false; } else { UCModalError1.ShowMessageError = SysMessage.ChooseData; UCModalError1.ShowModalError(); } }
protected void lbtDelete_Click(object sender, EventArgs e) { string date = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lbldate")).Text; var res = biz.DeleteHoliday(date); if (res.ErrorMsg == null) { UCModalSuccess1.ShowMessageSuccess = Resources.infoSetHoliday_002; UCModalSuccess1.ShowModalSuccess(); BindGrid(); } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } }
protected void lbtDelete_Click(object sender, EventArgs e) { string licensecode = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblTypeCode")).Text; var res = biz.DeleteLicenseType(licensecode); if (res.ErrorMsg != null) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { BindDrop(); UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_003; UCModalSuccess1.ShowModalSuccess(); } }
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(); } }
protected void btnUpdate_Click(object sender, EventArgs e) { ModalPopupUpdate.Hide(); DTO.GBHoliday holiday = new GBHoliday(); holiday.HL_DATE = Convert.ToDateTime(lbldatate.Text); holiday.HL_DESC = txtUpdatename.Text; var res = biz.UpdateHoliday(holiday); if (res.ErrorMsg == null) { UCModalSuccess1.ShowMessageSuccess = Resources.infoSetHoliday_003; UCModalSuccess1.ShowModalSuccess(); } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } }
protected void btnSave_Click(object sender, EventArgs e) { DTO.LicenseTypet licensetype = new DTO.LicenseTypet(); licensetype.AGENT_TYPE = ddlAgentype.SelectedValue; licensetype.INSURANCE_TYPE = ddlInsuran.SelectedValue; licensetype.LICENSE_TYPE_NAME = txtLicenseName.Text; var res = biz.AddLicenseType(licensetype); if (res.ErrorMsg != null) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { txtLicenseName.Text = ""; BindDrop(); ddlInsuran.SelectedValue = ""; ddlAgentype.SelectedValue = ""; UCModalSuccess1.ShowMessageSuccess = ""; UCModalSuccess1.ShowModalSuccess(); } }
protected void btnSave_Click(object sender, EventArgs e) { Dictionary <string, string> dic = new Dictionary <string, string>(); foreach (GridViewRow item in GvLicense.Rows) { Label lbl_Id = (Label)item.FindControl("lbl_Id"); DropDownList ddl_select = (DropDownList)item.FindControl("ddl_select"); dic.Add(lbl_Id.Text, ddl_select.SelectedValue); } var res = biz.AddLincse0304(dic); if (res.IsError) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ"; UCModalSuccess1.ShowModalSuccess(); } }
protected void btnAdd_Click(object sender, EventArgs e) { if (ddlAsso.SelectedValue == "") { UCModalError1.ShowMessageError = "กรุณาเลือกสมาคม"; UCModalError1.ShowModalError(); ModalPopup.Show(); } else { if (list_association.FirstOrDefault(x => x.ASSOCIATION_CODE == ddlAsso.SelectedValue) == null) { list_association.Add(new ASSOCIATION_APPROVE { APPROVE_DOC_TYPE = hdTypeCode.Value, ASSOCIATION_CODE = ddlAsso.SelectedValue, ASSOCIATION_NAME = ddlAsso.SelectedItem.Text }); list_add_association.Add(new ASSOCIATION_APPROVE { APPROVE_DOC_TYPE = hdTypeCode.Value, ASSOCIATION_CODE = ddlAsso.SelectedValue }); if (list_delete_association.FirstOrDefault(x => x.ASSOCIATION_CODE == ddlAsso.SelectedValue && x.APPROVE_DOC_TYPE == hdTypeCode.Value) != null) { list_delete_association.Remove(list_delete_association.FirstOrDefault(x => x.ASSOCIATION_CODE == ddlAsso.SelectedValue && x.APPROVE_DOC_TYPE == hdTypeCode.Value)); } gvAsso.DataSource = list_association; gvAsso.DataBind(); ModalPopup.Show(); UCModalSuccess1.ShowMessageSuccess = "เพิ่มเข้าในรายการแล้ว"; UCModalSuccess1.ShowModalSuccess(); } else { ModalPopup.Show(); UCModalError1.ShowMessageError = "สมาคมที่คุณเลือกมีแล้วในรายการ"; UCModalError1.ShowModalError(); } } }
protected void BindData(Boolean Count) { try { #region page int Rpage = (txtNumberGvSearch.Text.Trim() == "") ? 0 : txtNumberGvSearch.Text.Trim().ToInt(); int resultPage = (Rpage == 0) ? 1 : txtNumberGvSearch.Text.Trim().ToInt(); resultPage = resultPage == 0 ? 1 : resultPage; if ((rowPerpage.Text.Trim() == null) || (rowPerpage.Text.Trim() == "") || (rowPerpage.Text.ToInt() == 0)) { rowPerpage.Text = PageSize.ToString(); } else { PageSize = Convert.ToInt32(rowPerpage.Text); } #endregion page ExamScheduleBiz biz = new ExamScheduleBiz(); if (Count) { #region Page var CountPage = biz.GetExamPlaceAndDetailFromProvinceAndGroupCode(ddlProvince.SelectedValue.ToString(), ddlPlaceG.SelectedValue.ToString(), ddlPlaceGroup.SelectedValue.ToString(), resultPage, PageSize, true); if (CountPage.DataResponse != null) { if (CountPage.DataResponse.Tables[0].Rows.Count > 0) { Int64 totalROWs = Convert.ToInt32(CountPage.DataResponse.Tables[0].Rows[0]["CCount"].ToString()); VisibleGV(gvPlace, totalROWs, Convert.ToInt32(rowPerpage.Text), true); if (Rpage == 0) { NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage); } } else { VisibleGV(gvPlace, 0, Convert.ToInt32(rowPerpage.Text), true); if (Rpage == 0) { NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage); } txtTotalPage.Text = "1"; } } #endregion Page } if (ddlPlaceG.SelectedIndex > 0 && ddlProvince.SelectedIndex > 0 && ddlPlaceGroup.SelectedValue != "") { DTO.ResponseService <DataSet> Place = biz.GetExamPlaceAndDetailFromProvinceAndGroupCode(ddlProvince.SelectedValue.ToString(), ddlPlaceG.SelectedValue.ToString(), ddlPlaceGroup.SelectedValue.ToString(), resultPage, PageSize, false); if (Place != null) { gvPlace.DataSource = Place.DataResponse; gvPlace.DataBind(); gvPlace.Visible = true; //int rowcount = res.DataResponse.Tables[0].Rows.Count; //lblTotal.Text = rowcount.ToString(); div_totalPage.Visible = true; lblTotal.Visible = true; btn_Add.Visible = true; if (gvPlace.Visible == true) { PanalPage.Visible = true; } else { PanalPage.Visible = false; } } //btnPreviousGvSearch.Visible = true; //txtNumberGvSearch.Visible = true; //btnNextGvSearch.Visible = true; //div_totalPage.Visible = true; } else { UCModalError1.ShowMessageError = SysMessage.ChooseData; UCModalError1.ShowModalError(); btn_Add.Visible = false; if (gvPlace.Visible == true) { PanalPage.Visible = true; } else { PanalPage.Visible = false; } } } catch { } }
protected void btnOk_Click(object sender, EventArgs e) { BLL.RegistrationBiz biz = new BLL.RegistrationBiz(); BLL.PersonBiz bizPerson = new BLL.PersonBiz(); var detail = biz.GetRegistrationsByCriteria(txtFirstName.Text, txtLastName.Text, null, null, txtIDNumber.Text, null, txtEmail.Text, null, Session["RegStatus"].ToString(), 1, 20, "2"); DataSet ds = detail.DataResponse; #region Get MemberType From Control @Nattapong string RegMemType = string.Empty; if (txtMemberType.Text != "") { switch (txtMemberType.Text) { case "บุคคลทั่วไป": RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue()); break; case "บุคคลทั่วไป/ตัวแทน/นายหน้า": RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue()); break; case "บริษัทประกัน": RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue()); break; case "บริษัท": RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue()); break; case "สมาคม": RegMemType = Convert.ToString((int)DTO.MemberType.Association.GetEnumValue()); break; } } #endregion if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; var id = dt.AsEnumerable().Select(s => s.Field <string>("ID")); List <string> ls = new List <string>(); for (int i = 0; i < dt.Rows.Count; i++) { string strID = Convert.ToString(dt.Rows[i]["ID"]); ls.Add(strID); } if (ddlStatusApproval.SelectedValue.Equals("2")) { //var res = biz.RegistrationApprove(ls, "อนุมัติกลุ่ม"); string userid = UserProfile.Id; var res = biz.RegistrationApprove(ls, txtResultReg.Text, userid, RegMemType); if (res.IsError) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { //UCModalSuccess.ShowMessageSuccess = "ทำรายการเรียบร้อย"; //UCModalSuccess.ShowModalSuccess(); ////Response.Redirect("~/Register/regSearchOfficerOIC.aspx"); //btnOk.Enabled = false; //btnCancel.Text = "ย้อนกลับ"; string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess); ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true); } } else if (ddlStatusApproval.SelectedValue.Equals("3")) { //string userid = UserProfile.Id; string userid = Session["PersonalIDCard"].ToString(); var res = biz.RegistrationNotApprove(ls, txtResultReg.Text.ToString(), userid); if (res.IsError) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { //UCModalSuccess.ShowMessageSuccess = "ทำรายการเรียบร้อย"; //UCModalSuccess.ShowModalSuccess(); ////Response.Redirect("~/Register/regSearchOfficerOIC.aspx"); //btnOk.Enabled = false; //btnCancel.Text = "ย้อนกลับ"; string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess); ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true); } } else if (ddlStatusApproval.SelectedValue.Equals("")) { UCModalError1.ShowMessageError = Resources.errorEdit_Reg_Person_004; UCModalError1.ShowModalError(); } } }
private void SaveListExam() { string group = string.Empty; ApplicantBiz biz = new ApplicantBiz(); string strAmount = biz.GetQuantityBillPerPageByConfig(); if (ListApplicant.Count != 0 && ListApplicant.Count <= Convert.ToInt32(strAmount)) { List <DTO.ApplicantTemp> lst = new List <ApplicantTemp>(); for (int i = 0; i < ListApplicant.Count; i++) { DTO.ApplicantTemp app = new ApplicantTemp(); app.TESTING_NO = ListApplicant[i].ExamNumber; app.TESTING_DATE = ListApplicant[i].ExamDate; app.EXAM_PLACE_CODE = ListApplicant[i].ExamPlaceCode; app.APPLY_DATE = DateTime.Today; app.INSUR_COMP_CODE = ListApplicant[i].InSurCompCode; app.USER_ID = UserProfile.Id; // base.UserId; 140324110012352 app.ID_CARD_NO = UserProfile.IdCard; // base.IdCard; 4199682095940 app.APPLY_DATE = ListApplicant[i].ApplyDate; app.TEST_TIME_CODE = ListApplicant[i].TestTimeCode; app.RUN_NO = Convert.ToString(i + 1); lst.Add(app); } string passGroup = string.Empty; //Check // var checkBeforeSubmit = biz.GeneralValidateApplicantSingleBeforeSubmit(lst); //if (checkBeforeSubmit.ResultMessage == true) //{ // UCModalError1.ShowMessageError = "รอบสอบที่คุณเลือกในรายการมีรายการที่คุณได้สมัครสอบแล้ว"; // UCModalError1.ShowModalError(); //} // //else //{ var res = biz.InsertSingleApplicant(lst, base.UserId); if (res.IsError) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { ListApplicant = new List <AddApplicant>(); this.ModalListExam.Hide(); Session["lstApplicant"] = null; UCModalSuccess1.ShowMessageSuccess = SysMessage.SuccessInsertApplicant; UCModalSuccess1.ShowModalSuccess(); group = res.DataResponse; passGroup = group + " " + base.UserId; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopupSingle('" + passGroup + "')", true); } //} } else { UCModalError1.ShowMessageError = "กรุณาตรวจสอบจำนวนรายการที่สอบ"; UCModalError1.ShowModalError(); ModalListExam.Show(); } }
protected void btnDetailSubmit_Click(object sender, EventArgs e) { var arrComp = ddlCompanyCode.SelectedValue.Split('[', ']'); if (ddlCompanyCode.Visible == true) { if (ddlCompanyCode.SelectedValue == "0") { UCModalError1.ShowMessageError = "กรุณาเลือกรหัสบริษัทประกันภัย"; UCModalError1.ShowModalError(); ModSingleApplicant.Show(); } else { ListApplicant.Add(new DTO.AddApplicant { ExamNumber = Session["ExamNumber"].ToString(), ExamDate = (Convert.ToDateTime(Session["ExamDate"])), ExamTime = Session["ExamTime"].ToString(), ExamPlaceGroup = Session["ExamPlaceGroup"].ToString(), ExamPlace = Session["ExamPlace"].ToString(), Province = Session["Province"].ToString(), Seat = Session["Seat"].ToString(), LicenseTypeName = Session["LicenseTypeName"].ToString(), ExamFee = Session["ExamFee"].ToString(), AgentType = Session["AgentType"].ToString(), ExamPlaceCode = Session["PlaceCode"].ToString(), InSurCompCode = arrComp[1], TestTimeCode = Session["TestTimeCode"].ToString(), ApplyDate = DateTime.Now }); gvListExam.DataSource = ListApplicant; gvListExam.DataBind(); ModSingleApplicant.Hide(); ModalListExam.Show(); } } else { ListApplicant.Add(new DTO.AddApplicant { ExamNumber = Session["ExamNumber"].ToString(), ExamDate = (Convert.ToDateTime(Session["ExamDate"])), ExamTime = Session["ExamTime"].ToString(), ExamPlaceGroup = Session["ExamPlaceGroup"].ToString(), ExamPlace = Session["ExamPlace"].ToString(), Province = Session["Province"].ToString(), Seat = Session["Seat"].ToString(), LicenseTypeName = Session["LicenseTypeName"].ToString(), ExamFee = Session["ExamFee"].ToString(), AgentType = Session["AgentType"].ToString(), ExamPlaceCode = Session["PlaceCode"].ToString(), TestTimeCode = Session["TestTimeCode"].ToString(), ApplyDate = DateTime.Now }); gvListExam.DataSource = ListApplicant; gvListExam.DataBind(); ModSingleApplicant.Hide(); ModalListExam.Show(); } }
protected void btnSave_Click(object sender, EventArgs e) { var validate = Validation.Validate(this, "a"); if (validate != "") { UCModalError1.ShowMessageError = validate; UCModalError1.ShowModalError(); } else { DTO.ConditionGroup conditiongroup = new DTO.ConditionGroup(); List <DTO.Subjectr> subject = new List <DTO.Subjectr>(); conditiongroup.LICENSE_TYPE_CODE = ddlType.SelectedValue; conditiongroup.NOTE = txtNote.Text; conditiongroup.START_DATE = Convert.ToDateTime(txtStartDate.Text); conditiongroup.USER_ID = base.UserId; conditiongroup.USER_DATE = DateTime.Now; if (check.Checked) { conditiongroup.STATUS = "A"; } else { conditiongroup.STATUS = "I"; } if (txtEndDate.Text != "") { conditiongroup.END_DATE = Convert.ToDateTime(txtEndDate.Text); if (conditiongroup.START_DATE > conditiongroup.END_DATE) { UCModalError1.ShowMessageError = "วันที่มีผลบังคับใช้ต้องมากกว่าถึงวันที่"; UCModalError1.ShowModalError(); return; } } else { conditiongroup.END_DATE = null; } foreach (GridViewRow item in GvGroup.Rows) { subject.Add(new DTO.Subjectr { LICENSE_TYPE_CODE = ddlType.SelectedValue, SUBJECT_CODE = ((Label)(item.FindControl("lblSubjectCode"))).Text, MAX_SCORE = ((Label)(item.FindControl("lblMaxScore"))).Text.ToShort(), GROUP_ID = ((Label)(item.FindControl("lblGroup"))).Text.ToDecimal() }); } conditiongroup.Subject = subject; var res = biz.AddExamGroup(conditiongroup); if (res.ErrorMsg == null) { txtEndDate.Text = string.Empty; txtStartDate.Text = string.Empty; check.Checked = false; UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลเรียบร้อย"; UCModalSuccess1.ShowModalSuccess(); gvSearch.DataSource = biz.GetSubjectGroupSearch(ddlType.SelectedValue, 1, 100).DataResponse; gvSearch.DataBind(); txtNote.Text = ""; fieldSubject.Visible = false; } else { if (res.ErrorMsg == "1") { UCModalError1.ShowMessageError = "วันที่มีผลบังคับใช้ต้องมากกว่าหรือเท่ากับหลักสูตรล่าสุด"; UCModalError1.ShowModalError(); } else if (res.ErrorMsg == "2") { UCModalError1.ShowMessageError = "วันที่มีผลบังคับใช้ต้องน้อยกว่าหรือเท่าถึงวันที่ของหลักสูตรล่าสุด"; UCModalError1.ShowModalError(); } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } } } }