Пример #1
0
 // กำหนดค่าเริ่มต้นของจำนวนรับสมัคร โดยอ้างอิงจากสนามสอบ
 protected void ddlDetailExamYardCode_SelectedIndexChanged(object sender, EventArgs e)
 {
     BLL.ExamScheduleBiz biz = new BLL.ExamScheduleBiz();
     txtDetailNumberOfSeat.Text = biz.GetSeatAmount(ddlDetailExamYardCode.SelectedValue).DataResponse;
     ModSingleApplicant.Show();
     //IsCanRender = false;
 }
Пример #2
0
        protected void ddlDetailYardGroupCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetExamPlaceByCompCode(ddlDetailYardGroupCode.SelectedIndex == 0 ? "" : ddlDetailYardGroupCode.SelectedItem.Value, ddlDetailYardGroupCode.SelectedItem.Value);

            BindToDDL(ddlDetailExamYardCode, ls.DataResponse);
            ddlDetailExamYardCode.Items.Insert(0, SysMessage.DefaultSelecting);


            upn.Update();
            ModSingleApplicant.Show();
            //IsCanRender = false;
        }
Пример #3
0
        // ทุกๆครั้งที่เลือกรายการสอบแบบปฏิทิน
        protected void lnkExamNumber_Click(object sender, EventArgs e)
        {
            var gr            = (GridViewRow)((LinkButton)sender).NamingContainer;
            var strExamNumber = (LinkButton)gr.FindControl("lnkExamNumber");
            var strPlaceCode  = (Label)gr.FindControl("lblPlaceCode");

            BLL.ExamScheduleBiz biz = new BLL.ExamScheduleBiz();

            upn.Update();
            btnDelete.Visible = true;
            ModSingleApplicant.Show();
            EditMode(strExamNumber.Text, strPlaceCode.Text);
        }
Пример #4
0
        protected void btnConfirmExamList_Click(object sender, EventArgs e)
        {
            if (ddlTypeLicense.SelectedValue == "03" || ddlTypeLicense.SelectedValue == "04" || ddlTypeLicense.SelectedValue == "11" || ddlTypeLicense.SelectedValue == "12")
            {
                lblDetailCompanyCode.Visible = false;
                ddlCompanyCode.Visible       = false;
            }
            else
            {
                lblDetailCompanyCode.Visible = true;
                ddlCompanyCode.Visible       = true;
                GetCompany(ddlTypeLicense.SelectedValue);
            }

            ModSingleApplicant.Show();
        }
Пример #5
0
        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();
            }
        }
Пример #6
0
        // ทุกๆครั้งที่เลือกรายการสอบแบบปฏิทิน
        protected void lnkExamNumber_Click(object sender, EventArgs e)
        {
            var gr                    = (GridViewRow)((LinkButton)sender).NamingContainer;
            var strPlaceCode          = (Label)gr.FindControl("lblPlaceCode");
            var lblExamNumber         = (Label)gr.FindControl("ExamNumberNo");
            var lblExamDate           = (Label)gr.FindControl("lblExamDate");
            var lblExamTime           = (Label)gr.FindControl("lblExamTime");
            var lblExamPlaceGroup     = (Label)gr.FindControl("lblGroupExamYard");
            var lblExamPlace          = (Label)gr.FindControl("lblPlaceName");
            var lblProvince           = (Label)gr.FindControl("lblProvice");
            var lblSeat               = (Label)gr.FindControl("lblExamAdmission");
            var lblLicenseTypeName    = (Label)gr.FindControl("lblLicenseTypeName");
            var lblExamFee            = (Label)gr.FindControl("lblExamFee");
            var lblAgentType          = (Label)gr.FindControl("lblAgentType");
            var lblPlaceCode          = (Label)gr.FindControl("lblPlaceCode");
            var lblTestTimeCode       = (Label)gr.FindControl("lblTestTimeCode");
            var lblLicenseTypeCode    = (Label)gr.FindControl("lblLicenseTypeCode");
            var lblProvineCode        = (Label)gr.FindControl("lblProvinceCode");
            var lblExamPlaceGroupCode = (Label)gr.FindControl("lblExamPlaceGroupCode");
            var lblExamOwnerName      = (Label)gr.FindControl("lblExamOwnerName");

            if (ListApplicant.Find(x => x.ExamDate == Convert.ToDateTime(lblExamDate.Text) && x.ExamTime == lblExamTime.Text) != null)
            {
                UCModalError1.ShowMessageError = "ได้มีการสมัครในวันและเวลาสอบนี้แล้วไม่สามารถสมัครสอบได้ กรุณาทำการสมัครสอบในวันพรุ่งนี้";
                UCModalError1.ShowModalError();
            }
            else if (ListApplicant.Find(x => x.ExamNumber == lblExamNumber.Text) == null)
            {
                txtDetailExamCode.Text        = lblExamNumber.Text;
                txtDetailDateExam.Text        = lblExamDate.Text;
                txtTestTime.Text              = lblExamTime.Text;
                txtExamPlaceName.Text         = lblExamPlaceGroup.Text;
                txtProvincePopup.Text         = lblProvince.Text;
                txtLicenseTypeName.Text       = lblLicenseTypeName.Text;
                txtDetailPlaceCode.Text       = lblExamPlace.Text;
                txtExamOwner.Text             = lblExamOwnerName.Text;
                Session["ExamNumber"]         = lblExamNumber.Text;
                Session["ExamDate"]           = lblExamDate.Text;
                Session["ExamTime"]           = lblExamTime.Text;
                Session["ExamPlaceGroup"]     = lblExamPlaceGroup.Text;
                Session["ExamPlace"]          = lblExamPlace.Text;
                Session["Province"]           = lblProvince.Text;
                Session["Seat"]               = lblSeat.Text;
                Session["LicenseTypeName"]    = lblLicenseTypeName.Text;
                Session["ExamFee"]            = lblExamFee.Text;
                Session["AgentType"]          = lblAgentType.Text;
                Session["PlaceCode"]          = lblPlaceCode.Text;
                Session["ExamPlaceCode"]      = strPlaceCode.Text;
                Session["TestingNo"]          = lblExamNumber.Text;
                Session["TestingDate"]        = lblExamDate.Text;
                Session["TestTimeCode"]       = lblTestTimeCode.Text;
                Session["LicenseTypeCode"]    = lblLicenseTypeCode.Text;
                Session["ProvinceCode"]       = lblProvineCode.Text;
                Session["ExamPlaceGroupCode"] = lblExamPlaceGroupCode.Text;

                var list = new List <DTO.ApplicantTemp>();
                list.Add(new ApplicantTemp()
                {
                    APPLICANT_CODE  = 0,
                    TESTING_NO      = lblExamNumber.Text,
                    TESTING_DATE    = Convert.ToDateTime(lblExamDate.Text),
                    EXAM_PLACE_CODE = lblPlaceCode.Text,
                    APPLY_DATE      = DateTime.Today,
                    USER_ID         = UserProfile.Id,
                    ID_CARD_NO      = UserProfile.IdCard
                });

                DateTime     dtTestingDate      = Convert.ToDateTime(lblExamDate.Text);
                ApplicantBiz biz                = new ApplicantBiz();
                DTO.ResultValidateApplicant res = biz.ValidateApplicantBeforeSaveList(lblExamNumber.Text, UserProfile.IdCard, dtTestingDate, lblTestTimeCode.Text, strPlaceCode.Text, lblExamTime.Text, ListApplicant);

                if (res.IsConfirm)
                {
                    ModalPopupExtenderListExam.Show();
                    lblConfirmExam.Text = res.ValidateMessage;
                    return;
                }

                if (!res.IsCanExam)
                {
                    UCModalError1.ShowMessageError = res.ValidateMessage;
                    UCModalError1.ShowModalError();
                    return;
                }

                var checkBeforeSubmit = biz.GeneralValidateApplicantSingleBeforeSubmit(list);
                if (checkBeforeSubmit.ResultMessage == true)
                {
                    UCModalError1.ShowMessageError = "สมัครสอบซ้ำ";
                    UCModalError1.ShowModalError();
                }
                else
                {
                    if (ddlTypeLicense.SelectedValue == "03" || ddlTypeLicense.SelectedValue == "04" || ddlTypeLicense.SelectedValue == "11" || ddlTypeLicense.SelectedValue == "12")
                    {
                        lblDetailCompanyCode.Visible = false;
                        ddlCompanyCode.Visible       = false;
                    }
                    else
                    {
                        lblDetailCompanyCode.Visible = true;
                        ddlCompanyCode.Visible       = true;
                        GetCompany(ddlTypeLicense.SelectedValue);
                    }
                    ModSingleApplicant.Show();
                }
            }
            else
            {
                ModalListExam.Show();
                UCModalError1.ShowMessageError = "รอบสอบนี้คุณได้เลือกเข้าไปในรายการแล้ว";
                UCModalError1.ShowModalError();
            }
        }
Пример #7
0
 // เพิ่มใบสมัครสอบ
 protected void btnInsert_Click(object sender, EventArgs e)
 {
     ModSingleApplicant.Show();
     ClearValue();
     NewMode();
 }
Пример #8
0
 protected void btnModal_Click(object sender, EventArgs e)
 {
     ModSingleApplicant.Show();
 }