示例#1
0
        protected void hplView_Click(object sender, EventArgs e)
        {
            var gr = (GridViewRow)((LinkButton)sender).NamingContainer;

            var TestingNo     = (Label)gr.FindControl("lblTestingNoGv");
            var ApplicantCode = (Label)gr.FindControl("lblApplicantCodeGv");
            var ExamPlaceCode = (Label)gr.FindControl("lblExamPlaceCodeGv");

            var biz = new BLL.PaymentBiz();
            var res = biz.GetApplicantNoPayById(ApplicantCode.Text, TestingNo.Text, ExamPlaceCode.Text);


            if (res.IsError)
            {
                var errorMsg = res.ErrorMsg;

                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                PnlDetail.Visible = true;
                DataSet app = res.DataResponse;

                DataTable dt = app.Tables[0];

                DataRow dr = dt.Rows[0];

                DTO.ApplicantNoPay anp = dr.MapToEntity <DTO.ApplicantNoPay>();

                txtDetailTitle.Text        = anp.TITLE_NAME;
                txtDetailName.Text         = anp.NAMES;
                txtDetailSurName.Text      = anp.LASTNAME;
                txtDetailIdNumber.Text     = anp.ID_CARD_NO;
                rblDetailSex.SelectedValue = anp.SEX;

                if (anp.BIRTH_DATE != null)
                {
                    txtDetailBirthDay.Text = anp.BIRTH_DATE.Value.ToString("dd/MM/yyyy");
                }

                txtDetailEducation.Text  = anp.EDUCATION_NAME;
                txtDetailExamDate.Text   = anp.TESTING_DATE.ToString("dd/MM/yyyy");
                txtDetailRegExamID.Text  = anp.APPLICANT_CODE.ToString();
                txtDetailExamNumber.Text = anp.TESTING_NO;

                lblDetailCandidateNoPay.Visible = true;
                detaiLL.Visible = true;
                var bizsub = new BLL.DataCenterBiz();

                if (anp.EXAM_PLACE_CODE != null)
                {
                    var resexam = bizsub.GetPlaceExamNameById(anp.EXAM_PLACE_CODE);

                    if (resexam.IsError)
                    {
                        var errorMsg = resexam.ErrorMsg;

                        UCModalError.ShowMessageError = resexam.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        txtDetailPlaceExam.Text = resexam.DataResponse;
                    }
                }
                else
                {
                    txtDetailPlaceExam.Text = "";
                }

                if (anp.ACCEPT_OFF_CODE != null)
                {
                    var resacceptoff = bizsub.GetAcceptOffNameById(anp.ACCEPT_OFF_CODE);

                    if (resacceptoff.IsError)
                    {
                        var errorMsg = resacceptoff.ErrorMsg;

                        UCModalError.ShowMessageError = resacceptoff.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        txtDetailAssociationExamID.Text = resacceptoff.DataResponse;
                    }
                }
                else
                {
                    txtDetailAssociationExamID.Text = "";
                }

                if (anp.INSUR_COMP_CODE != null)
                {
                    var resCompany = bizsub.GetCompanyNameByIdToText(anp.INSUR_COMP_CODE);

                    if (resCompany.IsError)
                    {
                        var errorMsg = resCompany.ErrorMsg;

                        UCModalError.ShowMessageError = resCompany.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        txtInsuranceCompany.Text = resCompany.DataResponse;
                    }
                }
                else
                {
                    txtInsuranceCompany.Text = "";
                }

                lblDetailCandidateNoPay.Enabled = false;
                detaiLL.Visible = true;
                // PnlDetail.Enabled = false;

                UpdatePanelGv.Update();
            }
        }