Esempio n. 1
0
        // โชว์ข้อมูลตามการเลือกรหัสสอบ
        private void BindExamByTestingNoAndPlaceCode(string testingNo, string placeCode)
        {
            BLL.ExamScheduleBiz biz = new BLL.ExamScheduleBiz();
            var exam = biz.GetExamByTestingNoAndPlaceCode(testingNo, placeCode);

            txtDetailExamCode.Text = exam.DataResponse.TESTING_NO;
            txtDetailDateExam.Text = exam.DataResponse.TESTING_DATE.ToString();
            txtDetailFee.Text      = exam.DataResponse.EXAM_FEE.ToString();
        }
Esempio n. 2
0
        private void EditMode(string testingNo, string placeCode)
        {
            BLL.ExamScheduleBiz biz = new BLL.ExamScheduleBiz();
            var exam = biz.GetExamByTestingNoAndPlaceCode(testingNo, placeCode);

            txtDetailExamCode.Text = exam.DataResponse.TESTING_NO;
            txtDetailDateExam.Text = exam.DataResponse.TESTING_DATE.ToString("dd/MM/yyyy");
            txtDetailFee.Text      = exam.DataResponse.EXAM_FEE.ToString();
            txtDetailFee.Text      = biz.GetExamFee().DataResponse;
            ddlDetailTimeExamCode.SelectedValue  = exam.DataResponse.TEST_TIME_CODE;
            ddlDetailYardGroupCode.SelectedValue = exam.DataResponse.EXAM_PLACE_GROUP_CODE;
            if (ddlDetailYardGroupCode.SelectedValue != "")
            {
                BLL.DataCenterBiz dbiz = new BLL.DataCenterBiz();
                var res = dbiz.GetExamPlaceByCompCode(ddlDetailYardGroupCode.SelectedIndex == 0 ? "" : ddlDetailYardGroupCode.SelectedItem.Value, ddlDetailYardGroupCode.SelectedItem.Value);
                BindToDDL(ddlDetailExamYardCode, res.DataResponse);
                ddlDetailExamYardCode.SelectedValue = exam.DataResponse.EXAM_PLACE_CODE;
            }
            ddlDetailOfficerCode.SelectedValue = exam.DataResponse.LICENSE_TYPE_CODE;
            txtDetailNumberOfSeat.Text         = biz.GetSeatAmount(ddlDetailExamYardCode.SelectedValue).DataResponse;
        }
Esempio n. 3
0
        private void SaveMode()
        {
            BLL.ExamScheduleBiz biz = new BLL.ExamScheduleBiz();

            if (string.IsNullOrEmpty(txtDetailExamCode.Text))
            {
                ExamSchedule ent = new ExamSchedule();

                ent.USER_ID = "AGDOI";
                ent.EXAM_PLACE_GROUP_CODE = ddlDetailYardGroupCode.SelectedValue;
                ent.EXAM_PLACE_CODE       = ddlDetailExamYardCode.SelectedValue;
                ent.TESTING_DATE          = Convert.ToDateTime(txtDetailDateExam.Text);
                ent.TEST_TIME_CODE        = ddlDetailTimeExamCode.SelectedValue;
                ent.LICENSE_TYPE_CODE     = ddlDetailOfficerCode.SelectedValue;
                ent.USER_DATE             = DateTime.Now;
                ent.EXAM_ADMISSION        = txtDetailNumberOfSeat.Text.ToShort();
                ent.EXAM_FEE    = txtDetailFee.Text.ToDecimal();
                ent.EXAM_STATUS = "E";
                ent.EXAM_APPLY  = 0;
                //if (base.UserProfile.MemberType == DTO.RegistrationType.OIC.GetEnumValue())
                //{
                //    ent.EXAM_OWNER = "B";
                //}
                //else if (base.UserProfile.MemberType == DTO.RegistrationType.TestCenter.GetEnumValue())
                //{
                //    ent.EXAM_OWNER = "C";
                //}
                //else
                //{
                //    ent.EXAM_OWNER = "A";
                //}
                if (Convert.ToDateTime(txtDetailDateExam.Text) > DateTime.Now.Date)
                {
                    var res = biz.InsertExam(ent);
                    if (res.IsError)
                    {
                        UCModalError.ShowMessageError = res.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                        UCModalSuccess.ShowModalSuccess();
                    }
                }
                else
                {
                    UCModalError.ShowMessageError = Resources.errorExamSchedule_001;
                    UCModalError.ShowModalError();
                }
            }
            else
            {
                string testingNo     = txtDetailExamCode.Text;
                string examPlaceCode = ddlDetailExamYardCode.SelectedValue;
                if (biz.CanChangeExam(testingNo, examPlaceCode).ResultMessage)
                {
                    ExamSchedule ent  = new ExamSchedule();
                    var          exam = biz.GetExamByTestingNoAndPlaceCode(testingNo, examPlaceCode);
                    ent.TESTING_NO            = txtDetailExamCode.Text;
                    ent.TESTING_DATE          = Convert.ToDateTime(txtDetailDateExam.Text);
                    ent.EXAM_FEE              = txtDetailFee.Text.ToShort();
                    ent.EXAM_STATUS           = "E";
                    ent.EXAM_FEE              = txtDetailFee.Text.ToShort();
                    ent.TEST_TIME_CODE        = ddlDetailTimeExamCode.SelectedValue;
                    ent.EXAM_PLACE_GROUP_CODE = ddlDetailYardGroupCode.SelectedValue;
                    if (ddlDetailYardGroupCode.SelectedValue != "")
                    {
                        ent.EXAM_PLACE_CODE = ddlDetailExamYardCode.SelectedValue;
                    }
                    ent.LICENSE_TYPE_CODE = ddlDetailOfficerCode.SelectedValue;
                    ent.EXAM_APPLY        = 0;
                    ent.EXAM_ADMISSION    = txtDetailNumberOfSeat.Text.ToShort();
                    //ent.EXAM_OWNER = "A";
                    biz.UpdateExam(ent);

                    DateTime dtExam   = Convert.ToDateTime(txtDetailDateExam.Text);
                    string   strMonth = string.Empty;
                    if (dtExam.Date.Month < 10)
                    {
                        strMonth = "0" + dtExam.Date.Month;
                    }
                    //var re = biz.GetExamByCriteria("", "", "", dtExam.Year.ToString() + strMonth, "", Convert.ToDateTime(txtDetailDateExam.Text));
                    //if (re.IsError)
                    //{
                    //    UCModalError.ShowMessageError = re.ErrorMsg;
                    //    UCModalError.ShowModalError();

                    //}

                    //UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                    //UCModalSuccess.ShowModalSuccess();

                    //gvExamSchedule.DataSource = re.DataResponse;
                    //gvExamSchedule.DataBind();


                    //gvTable.DataSource = re.DataResponse;
                    //gvTable.DataBind();
                }
                else
                {
                    UCModalError.ShowMessageError = SysMessage.CannotEditExamTestingNo;
                    UCModalError.ShowModalError();
                }
            }
        }