Beispiel #1
0
 protected void btnAddIn_Click(object sender, EventArgs e)
 {
     try
     {
         if (Manage_App.ToArray().Count() > 0)
         {
             BLL.ApplicantBiz abiz = new ApplicantBiz();
             var res = abiz.SaveExamAppRoom(Manage_App.ToArray(), ddlroom.Text, selectRoom.Text, "", false, base.UserId);
             if (res.ResultMessage)//save OK
             {
                 ClickView(selectRoom.Text);
                 UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                 UCModalSuccess.ShowModalSuccess();
             }
             else
             {
                 UCModalError.ShowMessageError = res.ErrorMsg;
                 UCModalError.ShowModalError();
             }
             Manage_App = null;
             UpdatePanelSearch.Update();
         }
         else
         {
             UCModalError.ShowMessageError = "กรุณาเลือกผู้สมัครสอบก่อนทำรายการ";
             UCModalError.ShowModalError();
         }
     }
     catch
     {
     }
 }
        protected void hplView_Click(object sender, EventArgs e)
        {
            var gr = (GridViewRow)((LinkButton)sender).NamingContainer;

            var HeadNo    = (Label)gr.FindControl("lblHeadNoGv");
            var PaymentNo = (Label)gr.FindControl("lblPaymentNoGv");

            MPDetail.Show();
            lblpaymentNo.Text = HeadNo.Text;
            var biz = new BLL.PaymentBiz();
            var res = biz.GetRecriptByHeadRequestNoAndPaymentNo(HeadNo.Text, PaymentNo.Text);


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

                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                GVPopupReceipt.DataSource = res.DataResponse;
                GVPopupReceipt.DataBind();
                UpdatePanelSearch.Update();
            }
        }
        protected void btnDownload_Click(object sender, EventArgs e)
        {
            var   gr             = (GridViewRow)((LinkButton)sender).NamingContainer;
            Label lblPaymentNoGv = (Label)gr.FindControl("lblPaymentNoGv");
            Label lblHeadNoGv    = (Label)gr.FindControl("lblHeadNoGv");
            Label lblOrderGv     = (Label)gr.FindControl("lblOrderPayGv");
            Label lblPathFile    = (Label)gr.FindControl("lblPathFile");
            var   data2          = new List <DTO.SubPaymentDetail>();

            data2.Add(new DTO.SubPaymentDetail
            {
                HEAD_REQUEST_NO = lblHeadNoGv.Text,
                PAYMENT_NO      = lblPaymentNoGv.Text,
                Click           = "Download"
            });
            var    biz         = new BLL.PaymentBiz();
            var    resDownload = biz.PrintDownloadCount(data2.ToArray(), "", base.UserId);
            string SumPath     = lblPathFile.Text + "-D";

            Session["FileName"] = SumPath;

            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "เอกสาร",
                                                       "window.open('../UserControl/SavePdfFileFromStream.aspx');", true);



            UpdatePanelSearch.Update();
        }
Beispiel #4
0
 protected void btnGetOut_Click(object sender, EventArgs e)
 {
     try
     {
         if (Manage_App.ToArray().Count() > 0)
         {
             BLL.ApplicantBiz abiz = new ApplicantBiz();
             var res = abiz.CancleExamApplicantManage(Manage_App.ToArray(), selectRoom.Text);
             if (res.ResultMessage == false)
             {
                 UCModalError.ShowMessageError = res.ErrorMsg;
                 UCModalError.ShowModalError();
             }
             else
             {
                 ClickView("");
                 UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                 UCModalSuccess.ShowModalSuccess();
             }
             Manage_App = null;
             UpdatePanelSearch.Update();
         }
         else
         {
             UCModalError.ShowMessageError = "กรุณาเลือกผู้สมัครสอบก่อนทำรายการ";
             UCModalError.ShowModalError();
         }
     }
     catch
     {
     }
 }
Beispiel #5
0
        public void GetAttatchRegisterationFiles()
        {
            ApplicantBiz biz = new BLL.ApplicantBiz();

            DTO.ResponseService <DTO.AttachFileApplicantChangeEntity[]> res = biz.GetAttatchFilesAppChangeByIDCard(idcard.Trim(), Convert.ToInt32(lblChangeid.Text));
            //var list = res.DataResponse.ToList();
            if (res.DataResponse.Count() > 0)
            {
                IList <BLL.AttachFilesIAS.AttachFile> ls = BLL.AttachFilesIAS.AttachFileMapper.ConvertToAttachFilesApplicantView(res.DataResponse.ToList());
                ucAttachFileControl1.AttachFiles = ls.ToList();
                //this.GetAttachFilesType();
                this.GetAttachFilesAllType();
                ucAttachFileControl1.GridAttachFiles.DataSource = ls.ToList();
                ucAttachFileControl1.GridAttachFiles.DataBind();

                ucAttachFileControl1EnabledFalse();
            }
            else
            {
                this.GetAttachFilesAllType();
                ucAttachFileControl1.GridAttachFiles.DataSource = null;
                ucAttachFileControl1.GridAttachFiles.DataBind();
            }

            UpdatePanelSearch.Update();
        }
Beispiel #6
0
 protected void btnNextGvSearch_Click(object sender, EventArgs e)
 {
     NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "N", txtTotalPage);
     BindDataInGridView(false);
     Hide_show(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage.Text.ToInt());
     UpdatePanelSearch.Update();
 }
Beispiel #7
0
 protected void btnExportExcel2_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         int total = lblTotalrecord2.Text == "" ? 0 : lblTotalrecord2.Text.ToInt();
         if (total > base.EXCEL_SIZE_Key)
         {
             UCModalError.ShowMessageError = SysMessage.ExcelSizeError;
             UCModalError.ShowModalError();
             UpdatePanelSearch.Update();
         }
         else
         {
             Dictionary <string, string> columns = new Dictionary <string, string>();
             columns.Add("ลำดับ", "RUN_NO");
             columns.Add("เลขบัตรประชาชน", "ID_CARD_NO");
             columns.Add("หมายเลขกลุ่ม", "UPLOAD_GROUP_NO");
             columns.Add("หมายเลข", "SEQ_NO");
             columns.Add("วันที่พิจารณา", "APPROVED_DATE");
             columns.Add("ผู้พิจารณา", "NAME");
             BLL.LicenseBiz biz = new BLL.LicenseBiz();
             export.CreateExcel(biz.GetListLicenseDetailVerify(Session["UploadGroupNoGv"].ToString(), "N", 1, base.EXCEL_SIZE_Key).DataResponse.Tables[0], columns, base.UserProfile);
         }
     }
     catch { }
 }
Beispiel #8
0
        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 btnCloseProp_Click(object sender, EventArgs e)
 {
     lsOderInvoice.Clear();
     MPDetail.Hide();
     GetDataInGridView();
     UpdatePanelSearch.Update();
 }
 // protected string ExpDate = ConfigurationManager.AppSettings["
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     GvInvoicePopup.Visible    = true;
     GvInvoicePopup.DataSource = lsOderInvoice.ToList();
     GvInvoicePopup.DataBind();
     MPDetail.Show();
     remark.Visible = true;
     UpdatePanelSearch.Update();
 }
Beispiel #11
0
        protected void btnExportExcel_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                int total = lblTotal.Text == "" ? 0 : Regex.Replace(lblTotal.Text, "[^0-9]", "").ToInt();
                if (total > base.EXCEL_SIZE_Key)
                {
                    UCModalError.ShowMessageError = SysMessage.ExcelSizeError;
                    UCModalError.ShowModalError();
                    UpdatePanelSearch.Update();
                }
                else
                {
                    ExportBiz export = new ExportBiz();
                    Dictionary <string, string> columns = new Dictionary <string, string>();
                    columns.Add("ลำดับ", "RUN_NO");
                    columns.Add("ประเภทการชำระ", "PETITION_TYPE_NAME");
                    columns.Add("บัตรประชาชน", "ID_CARD_NO");
                    columns.Add("ชื่อ", "FIRST_NAME");
                    columns.Add("นามสกุล", "LASTNAME");
                    columns.Add("เลขที่ใบสั่งจ่าย", "group_request_no");
                    columns.Add("รหัสรอบสอบ", "TESTING_NO");
                    columns.Add("วันที่ออกใบสั่งจ่าย", "CREATED_DATE");
                    columns.Add("วันที่ชำระเงิน", "payment_date");
                    columns.Add("เลขที่ใบเสร็จ", "RECEIPT_NO");

                    List <HeaderExcel> header = new List <HeaderExcel>();
                    header.Add(new HeaderExcel
                    {
                        NameColumnsOne  = "หน่วยงานจัดสอบ ",
                        ValueColumnsOne = ddlGroupExam.SelectedItem.Text,
                        NameColumnsTwo  = "สนามสอบ ",
                        ValueColumnsTwo = ddlExamPlaceCode.SelectedItem.Text
                    });

                    header.Add(new HeaderExcel
                    {
                        NameColumnsOne  = "วันที่สั่งจ่าย(เริ่ม) ",
                        ValueColumnsOne = txtStartDate.Text,
                        NameColumnsTwo  = "วันที่สั่งจ่าย(สิ้นสุด) ",
                        ValueColumnsTwo = txtEndDate.Text
                    });

                    var biz = new BLL.PaymentBiz();
                    var res = biz.GetPaymentDetailByGroup(base.UserProfile.MemberType, ddlGroupExam.SelectedValue.ToString(),
                                                          ddlExamPlaceCode.SelectedValue.ToString(), Convert.ToDateTime(txtStartDate.Text), Convert.ToDateTime(txtEndDate.Text), 1, base.EXCEL_SIZE_Key, false, base.UserProfile.CompCode);
                    export.CreateExcel(res.DataResponse.Tables[0], columns, header, base.UserProfile);
                }
            }
            catch { }
        }
Beispiel #12
0
        protected void btnExportExcel_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                int total = lblTotalrecord.Text == "" ? 0 : lblTotalrecord.Text.ToInt();
                if (total > base.EXCEL_SIZE_Key)
                {
                    UCModalError.ShowMessageError = SysMessage.ExcelSizeError;
                    UCModalError.ShowModalError();
                    UpdatePanelSearch.Update();
                }
                else
                {
                    Dictionary <string, string> columns = new Dictionary <string, string>();
                    columns.Add("ลำดับ", "RUN_NO");
                    columns.Add("เลขที่ใบคำขออนุญาต", "UPLOAD_GROUP_NO");
                    columns.Add("ชื่อไฟล์", "FILENAME");
                    columns.Add("วันที่นำส่ง", "TRAN_DATE");
                    columns.Add("รูปแบบการขอใบอนุญาต", "PETITION_TYPE_NAME");
                    columns.Add("ประเภทการขอใบอนุญาต", "LICENSE_TYPE_NAME");
                    columns.Add("รายการทั้งหมด", "LOTS");

                    List <HeaderExcel> header = new List <HeaderExcel>();
                    header.Add(new HeaderExcel
                    {
                        NameColumnsOne  = "ประเภท ",
                        ValueColumnsOne = ddlLicenseType.SelectedItem.Text
                    });
                    header.Add(new HeaderExcel
                    {
                        NameColumnsOne  = "ตั้งแต่วันที่ ",
                        ValueColumnsOne = txtStartDate.Text,
                        NameColumnsTwo  = "ถึงวันที่ ",
                        ValueColumnsTwo = txtEndDate.Text
                    });



                    BLL.LicenseBiz        biz     = new BLL.LicenseBiz();
                    Func <string, string> GetCrit = anyString =>
                    {
                        return(string.IsNullOrEmpty(anyString) ? string.Empty : anyString);
                    };
                    string   strLicenseType = GetCrit(ddlLicenseType.SelectedValue);
                    DateTime dtStartDate    = Convert.ToDateTime(GetCrit(txtStartDate.Text == "" ? "" : txtStartDate.Text));
                    DateTime dtEndDate      = Convert.ToDateTime(GetCrit(txtEndDate.Text == "" ? "" : txtEndDate.Text));
                    export.CreateExcel(biz.GetResultLicenseVerifyHead(strLicenseType, dtStartDate, dtEndDate, base.UserProfile.CompCode, "N", 1, base.EXCEL_SIZE_Key).DataResponse.Tables[0], columns, header, base.UserProfile);
                }
            }
            catch { }
        }
Beispiel #13
0
 protected void btnNextGvSearch_Click(object sender, EventArgs e)
 {
     if (ddlStatus.SelectedItem.Text != "เลือก")
     {
         NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "N", txtTotalPage);
         BindData(false);
         Hide_show(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage.Text.ToInt());
         UpdatePanelSearch.Update();
     }
     else
     {
         UCModalError.ShowMessageError = "กรุณาเลือกสถานะ";
         UCModalError.ShowModalError();
     }
 }
Beispiel #14
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     txtNumberGvSearch.Text = "0";
     UpdatePanelSearch.Update();
     BindDataInGridView(true);
     if (gvSearch.Rows.Count > 0)
     {
         //btnExportExcel.Visible = true; //milk
         btnExportExcel.Visible = false;
     }
     else
     {
         btnExportExcel.Visible = false;
     }
 }
Beispiel #15
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (Convert.ToDateTime(txtStartDate.Text) > Convert.ToDateTime(txtEndDate.Text))
            {
                UCModalError.ShowMessageError = Resources.errorApplicantNoPay_004;
                UCModalError.ShowModalError();
                PnlDetailSearchGridView.Visible = false;
            }
            else
            {
                string errortxt = "";
                if (ddlType.SelectedIndex == 0)
                {
                    errortxt = "- กรุณาเลือกสังกัด";
                }
                if (ddlGroupExam.SelectedIndex == 0)
                {
                    errortxt = errortxt == "" ? "- กรุณาเลือกหน่วยงานจัดสอบ/สมาคม" : errortxt + "<br /> " + "- กรุณาเลือกหน่วยงานจัดสอบ/สมาคม";
                }
                if (ddlExamPlaceCode.SelectedIndex == 0)
                {
                    errortxt = errortxt == "" ? "- กรุณาเลือกสนามสอบ" : errortxt + "<br /> " + "- กรุณาเลือกสนามสอบ";
                }

                if (errortxt != "")
                {
                    UCModalError.ShowMessageError = errortxt;
                    UCModalError.ShowModalError();
                }
                else
                {
                    PnlDetailSearchGridView.Visible = true;
                    txtNumberGvSearch.Text          = "0";
                    UpdatePanelSearch.Update();
                    BindDataInGridView(true);
                }

                //if (gvSearch.Rows.Count > 0)
                //{
                //    btnExportExcel.Visible = true;
                //}
                //else
                //{
                //    btnExportExcel.Visible = false;
                //}
            }
        }
Beispiel #16
0
        protected void gvSearch2_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                UpdatePanelSearch.Update();
                if (e.Row.RowType == DataControlRowType.Header)
                {
                    check_all_head = (CheckBox)e.Row.FindControl("checkall");
                }
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Label    AppCode     = (Label)e.Row.FindControl("lblappcode");
                    CheckBox checkselect = (CheckBox)e.Row.FindControl("chkSelect");
                    var      l           = Manage_App.FirstOrDefault(x => x == AppCode.Text);
                    if (l != null)
                    {
                        checkselect.Checked = true;
                    }
                    else
                    {
                        checkselect.Checked = false;
                        b_check             = false;
                    }
                }
                if (e.Row.RowType == DataControlRowType.Footer)
                {
                    if (b_check)
                    {
                        check_all_head.Checked = true;
                    }
                }

                if (gvSearch2.Rows.Count > 0)
                {
                    gvSearch2.HeaderRow.FindControl("checkall").Visible = true;
                }
                else
                {
                    gvSearch2.HeaderRow.FindControl("checkall").Visible = false;
                }
            }
            catch
            {
            }
        }
Beispiel #17
0
        private void GetTempBankTransDetail(string strGroupID, string strID)
        {
            BLL.PaymentBiz biz = new BLL.PaymentBiz();
            var            res = biz.GetTempBankTransDetail(strGroupID, strID);

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                txtCompanyName.Text   = res.DataResponse.COMPANY_NAME;
                txtEffectiveDate.Text = PaymentHtmlHelper.ResolveDate(res.DataResponse.EFFECTIVE_DATE);
                txtServiceCode.Text   = res.DataResponse.SERVICE_CODE;
                if (res.DataResponse.BankType == "H")
                {
                    txtTotal.Text  = PaymentHtmlHelper.PhaseKTBMoney(res.DataResponse.TOTAL_CREDIT_AMOUNT);
                    txtAmount.Text = PaymentHtmlHelper.PhaseKTBMoney(res.DataResponse.AMOUNT);
                }
                else if (res.DataResponse.BankType == "1")
                {
                    txtTotal.Text  = PaymentHtmlHelper.PhaseCityBankMoney(res.DataResponse.TOTAL_CREDIT_AMOUNT);
                    txtAmount.Text = PaymentHtmlHelper.PhaseCityBankMoney(res.DataResponse.AMOUNT);
                }

                txtBankCode.Text          = res.DataResponse.BANK_CODE;
                txtCompanyAccount.Text    = res.DataResponse.COMPANY_ACCOUNT;
                txtPaymentDate.Text       = PaymentHtmlHelper.ResolveDate(res.DataResponse.PAYMENT_DATE);
                txtPaymentTime.Text       = res.DataResponse.PAYMENT_TIME;
                txtCustomerName.Text      = res.DataResponse.CUSTOMER_NAME;
                txtCustomerNoRef1.Text    = res.DataResponse.CUSTOMER_NO_REF1;
                txtRef2.Text              = res.DataResponse.REF2;
                txtRef3.Text              = res.DataResponse.REF3;
                txtBranchNo.Text          = res.DataResponse.BRANCH_NO;
                txtTellerNo.Text          = res.DataResponse.TELLER_NO;
                txtKindOfTransaction.Text = res.DataResponse.KIND_OF_TRANSACTION;
                txtTranSactionCode.Text   = res.DataResponse.TRANSACTION_CODE;
                txtChequeNo.Text          = res.DataResponse.CHEQUE_NO;

                txtChequeBankCode.Text = res.DataResponse.CHEQUE_BANK_CODE;
                UpdatePanelSearch.Update();
            }
        }
Beispiel #18
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var biz = new BLL.DataCenterBiz();

            var res = biz.SaveConfigPrint(PrintPayment);

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                UCModalSuccess.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ";
                UCModalSuccess.ShowModalSuccess();
                BindData();
                UpdatePanelSearch.Update();
            }
        }
Beispiel #19
0
 protected void Hide_show(Button PreName, TextBox txtNum, Button NextName, string N_or_P, int MaxP)
 {
     if (txtNum.Text.ToInt() == 1)
     {
         PreName.Visible = false;
     }
     else
     {
         PreName.Visible = true;
     }
     UpdatePanelSearch.Update();
     if (txtNum.Text.ToInt() == MaxP)
     {
         NextName.Visible = false;
     }
     else
     {
         NextName.Visible = true;
     }
 }
Beispiel #20
0
        protected void hplDelete_Click(object sender, EventArgs e)
        {
            var gr        = (GridViewRow)((LinkButton)sender).NamingContainer;
            var PaidGroup = (Label)gr.FindControl("lblGroupRequsetNo");
            var biz       = new BLL.PaymentBiz();
            var res       = biz.CancelGroupRequestNo(PaidGroup.Text);

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
                BindDataInGridView(true);
            }
            else
            {
                BindDataInGridView(true);
                UCModalSuccess.ShowMessageSuccess = Resources.errorSysMessage_CreatePaymentSuccess;
                UCModalSuccess.ShowModalSuccess();
            }
            UpdatePanelSearch.Update();
        }
Beispiel #21
0
        private void ClickView(string TESTING_NO)
        {
            try
            {
                Manage_App = null;
                if (TESTING_NO != "")
                {
                    selectRoom.Text = TESTING_NO;
                }

                txtNumberGvSearch2.Text = "0";
                divGv2.Visible          = true;
                if (ddlEvent.SelectedValue == "in")
                {
                    GetRoom();
                }
                BindDataInGridView2(true);
                UpdatePanelSearch.Update();
            }
            catch
            {
            }
        }
 protected void btnExportExcel_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         int total = lblTotalrecord.Text == "" ? 0 : lblTotalrecord.Text.ToInt();
         if (total > base.EXCEL_SIZE_Key)
         {
             this.MasterSite.ModelError.ShowMessageError = SysMessage.ExcelSizeError;
             this.MasterSite.ModelError.ShowModalError();
             UpdatePanelSearch.Update();
         }
         else
         {
             ExportBiz export = new ExportBiz();
             var       biz    = new BLL.PaymentBiz();
             string    IdParameter;
             if (base.UserProfile.MemberType == 1)
             {
                 IdParameter = base.UserProfile.Id;
             }
             else
             {
                 IdParameter = base.UserProfile.CompCode;
             }
             Dictionary <string, string> columns = new Dictionary <string, string>();
             columns.Add("ลำดับ", "RUN_NO");
             columns.Add("ใบสั่งจ่ายย่อย", "HEAD_REQUEST_NO");
             columns.Add("ประเภทใบสั่งจ่าย", "PETITION_TYPE_NAME");
             columns.Add("จำนวนคน", "PERSON_NO");
             columns.Add("จำนวนเงิน", "SUBPAYMENT_AMOUNT");
             columns.Add("วันที่จ่ายย่อย", "SUBPAYMENT_DATE");
             var res = biz.GetGroupPayment(IdParameter, Convert.ToDateTime(txtStartPaidSubDate.Text), Convert.ToDateTime(txtEndPaidSubDate.Text), Convert.ToString(base.UserProfile.MemberType), txtID.Text, 1, base.EXCEL_SIZE_Key, "N");
             export.CreateExcel(res.DataResponse, columns);
         }
     }
     catch { }
 }
Beispiel #23
0
        protected void hplView_Click(object sender, EventArgs e)
        {
            var gr = (GridViewRow)((LinkButton)sender).NamingContainer;


            Label PetitionCode = (Label)gr.FindControl("lblPetitionCode");
            Label LicenseCode  = (Label)gr.FindControl("lblLicenseCode");
            Label RenewTime    = (Label)gr.FindControl("lblRenewTime");
            Label IdCard       = (Label)gr.FindControl("lblIdCard");
            Label lblLicenseno = (Label)gr.FindControl("lblLicenseno");

            this.LicenseTypeCode         = LicenseCode.Text;
            this.PettionTypeCode         = PetitionCode.Text;
            this.CurrentLicenseRenewTime = RenewTime.Text == "" ? "0" : RenewTime.Text;
            this.CheckApprove            = "ApproveL";
            this.Mode = DTO.LicensePropMode.General.GetEnumValue().ToString();
            LicenseBiz biz = new LicenseBiz();


            #region gvGeneral
            DTO.ResponseService <DTO.ValidateLicense[]> result = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 1);


            // this.GridviewGeneral = result.DataResponse.ToList();
            if (result.DataResponse.Count() > 0)
            {
                gvGeneral.Visible    = true;
                gvGeneral.DataSource = result.DataResponse;
                gvGeneral.DataBind();

                //Create Head Genaral
                if (gvGeneral.Controls.Count > 0)
                {
                    AddSuperHeader(gvGeneral);
                    checkHead = "T";
                }
                else
                {
                    //AddSuperHeader(gvTrainResult);
                }
            }
            else
            {
                gvGeneral.Visible = false;
            }

            #endregion

            #region gvExamResult
            DTO.ResponseService <DTO.ValidateLicense[]> result2 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 2);
            if (result2.DataResponse.Count() > 0)
            {
                gvExamResult.DataSource = result2.DataResponse;
                gvExamResult.DataBind();
                gvExamResult.Visible = true;
                // this.GridviewExamResult = result2.DataResponse.ToList();

                //Create Head Genaral
                if (gvGeneral.Controls.Count > 0)
                {
                    //AddSuperHeader(gvExamResult);
                }
                else
                {
                    if (checkHead != "T")
                    {
                        AddSuperHeader(gvExamResult);
                        checkHead = "T";
                    }
                }
            }
            else
            {
                gvExamResult.Visible = false;
            }


            #endregion

            #region gvEducation
            DTO.ResponseService <DTO.ValidateLicense[]> result3 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 3);
            if (result3.DataResponse.Count() > 0)
            {
                gvEducation.DataSource = result3.DataResponse;
                gvEducation.DataBind();
                gvEducation.Visible = true;
                // this.GridviewEducation = result3.DataResponse.ToList();

                //Create Head Genaral
                if (gvExamResult.Controls.Count > 0)
                {
                    //AddSuperHeader(gvEducation);
                }
                else
                {
                    if (checkHead != "T")
                    {
                        AddSuperHeader(gvEducation);
                        checkHead = "T";
                    }
                }
            }
            else
            {
                gvEducation.Visible = false;
            }

            #endregion

            #region gvTrainResult
            DTO.ResponseService <DTO.ValidateLicense[]> result4 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 4);
            if (result4.DataResponse.Count() > 0)
            {
                gvTrainResult.DataSource = result4.DataResponse;
                gvTrainResult.DataBind();
                gvTrainResult.Visible = true;
                //  this.GridviewTrainResult = result4.DataResponse.ToList();

                //Create Head Genaral
                if (gvEducation.Controls.Count > 0)
                {
                    //AddSuperHeader(gvTrainResult);
                }
                else
                {
                    if (checkHead != "T")
                    {
                        AddSuperHeader(gvTrainResult);
                        checkHead = "T";
                    }
                }
            }
            else
            {
                gvTrainResult.Visible = false;
            }
            #endregion

            #region gvOther
            DTO.ResponseService <DTO.ValidateLicense[]> result5 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 5);
            if (result5.DataResponse.Count() > 0)
            {
                gvOther.DataSource = result5.DataResponse;
                gvOther.DataBind();
                gvOther.Visible = true;
                //  this.GridviewOther = result5.DataResponse.ToList();

                //Create Head Genaral
                if (gvTrainResult.Controls.Count > 0)
                {
                    //AddSuperHeader(gvOther);
                }
                else
                {
                    if (checkHead != "T")
                    {
                        AddSuperHeader(gvOther);
                        checkHead = "T";
                    }
                }
            }
            else
            {
                gvOther.Visible = false;
            }
            #endregion

            UpdatePanelSearch.Update();
            MPDetailLicense.Show();
        }
Beispiel #24
0
        private void chkValidatePropLicenseApp(GridView gv, string mode)
        {
            LicenseBiz biz = new LicenseBiz();

            foreach (GridViewRow row in gv.Rows)
            {
                Label lblID         = (Label)row.FindControl("lblID");
                Label lblItemName   = (Label)row.FindControl("lblItemName");
                Image impCorrect    = (Image)row.FindControl("impCorrect");
                Image impdisCorrect = (Image)row.FindControl("impdisCorrect");

                //Single License
                if (mode.Equals(DTO.LicensePropMode.General.GetEnumValue().ToString()))
                {
                    // var result = text.Where(l => l.Equals(lblItemName.Text.Trim())).FirstOrDefault();

                    if (gv.ID.Equals("gvGeneral"))
                    {
                        impCorrect.Visible    = true;
                        impdisCorrect.Visible = true;
                        //1	บรรลุนิติภาวะ
                        //6	มีภูมิลำเนาในประเทศไทย
                        //7	ไม่เป็นคนวิกลจริตหรือจิตฟั่นเฟือนไม่สมประกอบ
                        //8	ไม่เคยต้องโทษจำคุกโดยคำพิพากษาถึงที่สุดให้จำคุก ในความผิดเกี่ยวกับทรัพย์ที่กระทำโดยทุจริต เว้นแต่พ้นโทษมาแล้วไม่น้อยกว่าห้าปีก่อนวันขอรับใบอนุญาต
                        //9	ไม่เป็นบุคคลล้มละลาย
                        //11 ไม่เป็นตัวแทนประกันชีวิต
                        //13 ไม่เคยถูกเพิกถอนใบอนุญาตเป็นตัวแทนประกันชีวิต หรือใบอนุญาตเป็นนายหน้าประกันชีวิต ระยะเวลาห้าปีก่อนวันขอรับใบอนุญาต
                        switch (lblID.Text)
                        {
                        case "1":
                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "6":
                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "7":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "8":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "9":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "10":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "11":
                            if (this.LicenseTypeCode.Equals("03"))
                            {
                                impCorrect.Visible    = true;
                                impdisCorrect.Visible = false;
                            }


                            else if (this.LicenseTypeCode.Equals("04"))
                            {
                                impCorrect.Visible    = true;
                                impdisCorrect.Visible = false;
                            }
                            else
                            {
                                impdisCorrect.Visible = true;
                                impCorrect.Visible    = false;
                            }


                            break;

                        case "12":


                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;



                            break;

                        case "13":

                            impCorrect.Visible = true;

                            impdisCorrect.Visible = false;

                            break;

                        case "15":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;

                            break;

                        case "16":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;

                            break;

                        case "19":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;


                            break;

                        case "22":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;


                            break;
                        }
                        UpdatePanelSearch.Update();
                    }
                    else if (gv.ID.Equals("gvExamResult"))
                    {
                        //2	ผลสอบ
                        impCorrect.Visible    = true;
                        impdisCorrect.Visible = true;
                        switch (lblID.Text)
                        {
                        case "2":

                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;

                            break;
                        }
                        UpdatePanelSearch.Update();
                    }
                    else if (gv.ID.Equals("gvEducation"))
                    {
                        impCorrect.Visible    = true;
                        impdisCorrect.Visible = true;
                        //3	สำเร็จการศึกษาไม่ต่ำกว่าปริญญาตรี วิชาการประกันชีวิตไม่ต่ำกว่าชั้นปริญญาตรีหรือเทียบเท่าไม่น้อยกว่า 6 หน่วยกิต
                        switch (lblID.Text)
                        {
                        case "3":
                            impdisCorrect.Visible = true;
                            impCorrect.Visible    = false;
                            break;

                        case "17":
                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;
                        }
                        UpdatePanelSearch.Update();
                    }
                    else if (gv.ID.Equals("gvTrainResult"))
                    {
                        impCorrect.Visible    = true;
                        impdisCorrect.Visible = true;
                        //4	ผลอบรม
                        switch (lblID.Text)
                        {
                        case "4":
                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;
                        }
                        UpdatePanelSearch.Update();
                    }
                    else if (gv.ID.Equals("gvOther"))
                    {
                        impCorrect.Visible    = true;
                        impdisCorrect.Visible = true;
                        //5	    รูปถ่าย
                        //14	มีการชำระค่าธรรมเนียมค่าขอรับใบอนุญาต
                        //18	มีการชำระค่าธรรมเนียมค่ขอต่ออายุใบอนุญาต
                        switch (lblID.Text)
                        {
                        case "5":
                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "14":
                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;

                        case "18":
                            impCorrect.Visible    = true;
                            impdisCorrect.Visible = false;
                            break;
                        }
                        UpdatePanelSearch.Update();
                    }
                }
            }
        }
Beispiel #25
0
        protected void hplViewDoc_Click(object sender, EventArgs e)
        {
            pnlAttach.Visible = false;
            var gv             = (GridViewRow)((LinkButton)sender).NamingContainer;
            var strNumber      = (Label)gv.FindControl("lblIDNumberGv");
            var strGroupNumber = (Label)gv.FindControl("lblGroupIDNumberGv");
            var status         = (Label)gv.FindControl("lblStatus");

            hdfNumber.Value      = strNumber.Text;
            hdfGroupNumber.Value = strGroupNumber.Text;
            var biz = new BLL.LicenseBiz();
            var res = biz.GetLicenseVerifyDetail(strGroupNumber.Text, strNumber.Text);

            pnlDetail.Visible = true;

            txtFirstName.Text       = res.DataResponse.NAMES == "" ? "" : res.DataResponse.NAMES;
            txtLastName.Text        = res.DataResponse.LASTNAME == "" ? "" : res.DataResponse.LASTNAME;
            txtIDNumber.Text        = res.DataResponse.ID_CARD_NO == "" ? "" : res.DataResponse.ID_CARD_NO;
            txtTitle.Text           = res.DataResponse.TITLE_NAME == "" ? "" : res.DataResponse.TITLE_NAME;
            txtDateLicense.Text     = Convert.ToString(res.DataResponse.LICENSE_DATE) == "" ? "" : string.Format("{0:dd/MM/yyyy}", res.DataResponse.LICENSE_DATE);
            txtExpireDate.Text      = Convert.ToString(res.DataResponse.LICENSE_EXPIRE_DATE) == "" ? "" : string.Format("{0:dd/MM/yyyy}", res.DataResponse.LICENSE_EXPIRE_DATE);
            txtNumberLicense.Text   = res.DataResponse.LICENSE_NO == "" ? "" : res.DataResponse.LICENSE_NO;
            txtEmail.Text           = res.DataResponse.EMAIL == "" ? "" : res.DataResponse.EMAIL;
            txtTimeMove.Text        = res.DataResponse.RENEW_TIMES == "" ? "" : res.DataResponse.RENEW_TIMES;
            txtCompCode.Text        = res.DataResponse.OLD_COMP_CODE == "" ? "" : res.DataResponse.OLD_COMP_CODE;
            txtFee.Text             = Convert.ToString(res.DataResponse.FEES) == "" ? "" : Convert.ToString(res.DataResponse.FEES);
            txtCurrentAddress.Text  = res.DataResponse.CURRENT_ADDRESS == "" ? "" : res.DataResponse.CURRENT_ADDRESS;
            txtRegisterAddress.Text = res.DataResponse.LOCAL_ADDRESS == "" ? "" : res.DataResponse.LOCAL_ADDRESS;
            txtDateAccept.Text      = Convert.ToString(res.DataResponse.AR_DATE) == "" ? "" : Convert.ToString(res.DataResponse.AR_DATE);

            var message = SysMessage.DefaultSelecting;

            BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz();
            ddlProvinceCurrentAddress.SelectedValue = res.DataResponse.CURRENT_PROVINCE_CODE;
            var lsPC = dataCenter.GetAmpur(message, ddlProvinceCurrentAddress.SelectedValue);

            BindToDDL(ddlDistrictCurrentAddress, lsPC);
            foreach (var item in lsPC)
            {
                if (item.Id == res.DataResponse.CURRENT_AMPUR_CODE)
                {
                    ddlDistrictCurrentAddress.SelectedValue = res.DataResponse.CURRENT_AMPUR_CODE;
                }
            }

            var lsTC = dataCenter.GetTumbon(message, ddlProvinceCurrentAddress.SelectedValue, ddlDistrictCurrentAddress.SelectedValue);

            BindToDDL(ddlParishCurrentAddress, lsTC);
            foreach (var item in lsTC)
            {
                if (item.Id == res.DataResponse.CURRENT_TUMBON_CODE)
                {
                    ddlParishCurrentAddress.SelectedValue = res.DataResponse.CURRENT_TUMBON_CODE;
                }
            }

            ddlProvinceRegisterAddress.SelectedValue = res.DataResponse.LOCAL_PROVINCE_CODE;
            var lsPR = dataCenter.GetAmpur(message, ddlProvinceRegisterAddress.SelectedValue);

            BindToDDL(ddlDistrictRegisterAddress, lsPR);
            foreach (var item in lsPR)
            {
                if (item.Id == res.DataResponse.LOCAL_AMPUR_CODE)
                {
                    ddlDistrictRegisterAddress.SelectedValue = res.DataResponse.LOCAL_AMPUR_CODE;
                }
            }

            var lsTR = dataCenter.GetTumbon(message, ddlProvinceRegisterAddress.SelectedValue, ddlDistrictRegisterAddress.SelectedValue);

            BindToDDL(ddlParishRegisterAddress, lsTR);
            foreach (var item in lsTR)
            {
                if (item.Id == res.DataResponse.LOCAL_TUMBON_CODE)
                {
                    ddlParishRegisterAddress.SelectedValue = res.DataResponse.LOCAL_TUMBON_CODE;
                }
            }


            UpdatePanelSearch.Update();
            var HeaderApprove = biz.GetVerifyHeadByUploadGroupNo(strGroupNumber.Text);

            if (res.DataResponse.APPROVED == "Y")
            {
                rblApprove.SelectedValue = "Y";
            }
            else if (res.DataResponse.APPROVED == "N")
            {
                rblApprove.SelectedValue = "N";
            }
            else if (res.DataResponse.APPROVED == "W")
            {
                rblApprove.ClearSelection();
            }
        }
 public void Hide()
 {
     ctlIONumber.Text      = string.Empty;
     ctlIODescription.Text = string.Empty;
     UpdatePanelSearch.Update();
 }
Beispiel #27
0
        private void BindDataInGridView(Boolean CountAgain)
        {
            var biz = new BLL.PaymentBiz();
            // var resultPage = txtNumberGvSearch.Text.ToInt();

            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() == "") || (Convert.ToInt32(rowPerpage.Text.Trim()) == 0))
            {
                rowPerpage.Text = (PageSize == 0)? Convert.ToString(PAGE_SIZE_Key):      PageSize.ToString();
            }
            else
            {
                PageSize = Convert.ToInt32(rowPerpage.Text);
            }

            if (CountAgain)
            {
                #region Page
                var CountPage = biz.GetPaymentDetailByGroup(base.UserProfile.MemberType, ddlGroupExam.SelectedValue.ToString(),
                                                            ddlExamPlaceCode.SelectedValue.ToString(), Convert.ToDateTime(txtStartDate.Text), Convert.ToDateTime(txtEndDate.Text), resultPage, PageSize, true, base.UserProfile.CompCode);



                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(gvSearch, totalROWs, Convert.ToInt32(rowPerpage.Text), true);
                        if (Rpage == 0)
                        {
                            NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage);
                        }
                    }
                    else
                    {
                        VisibleGV(gvSearch, 0, Convert.ToInt32(rowPerpage.Text), true);
                        if (Rpage == 0)
                        {
                            NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage);
                        }
                        txtTotalPage.Text = "1";
                    }
                }
                #endregion Page
            }

            var res = biz.GetPaymentDetailByGroup(base.UserProfile.MemberType, ddlGroupExam.SelectedValue.ToString(),
                                                  ddlExamPlaceCode.SelectedValue.ToString(), Convert.ToDateTime(txtStartDate.Text), Convert.ToDateTime(txtEndDate.Text), resultPage, (PageSize == 0) ? PAGE_SIZE_Key : PageSize, false, base.UserProfile.CompCode);


            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                bludDiv.Visible = true;
                DataSet ds = res.DataResponse;
                gvSearch.Visible    = true;
                gvSearch.DataSource = res.DataResponse;
                gvSearch.DataBind();
                UpdatePanelSearch.Update();

                if (res.DataResponse.Tables[0].Rows.Count > 0)
                {
                    btnExportExcel.Visible = true;
                }
                else
                {
                    btnExportExcel.Visible = false;
                }
            }
        }
Beispiel #28
0
        //log4net

        private void BindDataInGridView()
        {
            txtNumberGvSearch.Text = "1";
            maxBefore = txtInputMaxrow.Text;
            if ((txtInputMaxrow.Text != Convert.ToString(PAGE_SIZE) && txtInputMaxrow.Text != "" && Convert.ToInt32(txtInputMaxrow.Text) != 0))
            {
                txtInputMaxrow.Text = maxBefore;
            }
            else if (txtInputMaxrow.Text == "" || Convert.ToInt32(txtInputMaxrow.Text) == 0)
            {
                txtInputMaxrow.Text = Convert.ToString(PAGE_SIZE);
            }
            PAGE_SIZE = Convert.ToInt32(txtInputMaxrow.Text);
            var biz        = new BLL.PaymentBiz();
            var resultPage = txtNumberGvSearch.Text.ToInt();

            if ((base.UserProfile.MemberType == DTO.RegistrationType.OICFinace.GetEnumValue()) ||
                (base.UserProfile.MemberType == DTO.RegistrationType.OIC.GetEnumValue()) ||
                (base.UserProfile.MemberType == DTO.RegistrationType.OICAgent.GetEnumValue()))
            {
                if (txtStartPaidSubDate.Text != "" && txtEndPaidSubDate.Text != "")
                {
                    var resCount1 = biz.GenPaymentNumberTable(base.UserProfile.IdCard,
                                                              Convert.ToDateTime(txtStartPaidSubDate.Text),
                                                              Convert.ToDateTime(txtEndPaidSubDate.Text), txtPaidGroup.Text.Replace(" ", ""), "Y", resultPage, PAGE_SIZE);
                    DataSet ds = resCount1.DataResponse;
                    if (ds.Tables.Count > 0)
                    {
                        DataTable dt = ds.Tables[0];
                        if (dt.Rows.Count > 0)
                        {
                            DataRow dr           = dt.Rows[0];
                            int     rowcount     = Convert.ToInt32(dr["rowcount"].ToString());
                            double  dblPageCount = (double)((decimal)rowcount / PAGE_SIZE);
                            TotalPages        = (int)Math.Ceiling(dblPageCount);
                            txtTotalPage.Text = Convert.ToString(TotalPages);
                            var res1 = biz.GenPaymentNumberTable(base.UserProfile.IdCard,
                                                                 Convert.ToDateTime(txtStartPaidSubDate.Text),
                                                                 Convert.ToDateTime(txtEndPaidSubDate.Text), txtPaidGroup.Text.Replace(" ", ""), "N", resultPage, PAGE_SIZE);
                            gvSearch.Visible    = true;
                            gvSearch.DataSource = res1.DataResponse;
                            gvSearch.DataBind();
                            bludDiv.Visible = true;
                            if (res1.IsError)
                            {
                                this.MasterSite.ModelError.ShowMessageError = Resources.errorGenPayment_002;
                                this.MasterSite.ModelError.ShowModalError();
                            }
                            else
                            {
                                if (TotalPages > 1)
                                {
                                    txtNumberGvSearch.Visible   = true;
                                    lblParaPage.Visible         = true;
                                    txtTotalPage.Visible        = true;
                                    btnNextGvSearch.Visible     = true;
                                    btnPreviousGvSearch.Visible = false;
                                    btngo.Visible              = true;
                                    lblTotalrecord.Text        = dr["rowcount"].ToString();
                                    txtInputMaxrow.Visible     = true;
                                    lblHeadInputMaxrow.Visible = true;
                                    lblHeadTotal.Visible       = true;
                                    lblTotalrecord.Visible     = true;
                                    lblEndTotal.Visible        = true;
                                }
                                else if (TotalPages == 1)
                                {
                                    txtNumberGvSearch.Visible   = true;
                                    lblParaPage.Visible         = true;
                                    txtTotalPage.Visible        = true;
                                    btnPreviousGvSearch.Visible = false;
                                    btnNextGvSearch.Visible     = false;
                                    btngo.Visible              = true;
                                    lblTotalrecord.Text        = dr["rowcount"].ToString();
                                    txtInputMaxrow.Visible     = true;
                                    lblHeadInputMaxrow.Visible = true;
                                    lblHeadTotal.Visible       = true;
                                    lblTotalrecord.Visible     = true;
                                    lblEndTotal.Visible        = true;
                                }
                                else if (TotalPages == 0)
                                {
                                    txtNumberGvSearch.Visible   = true;
                                    lblParaPage.Visible         = true;
                                    txtTotalPage.Visible        = true;
                                    txtTotalPage.Text           = "1";
                                    btngo.Visible               = true;
                                    lblTotalrecord.Text         = "0";
                                    txtInputMaxrow.Visible      = true;
                                    lblHeadInputMaxrow.Visible  = true;
                                    lblHeadTotal.Visible        = true;
                                    lblTotalrecord.Visible      = true;
                                    lblEndTotal.Visible         = true;
                                    btnPreviousGvSearch.Visible = false;
                                    btnNextGvSearch.Visible     = false;
                                }
                                if ((base.UserProfile.MemberType == DTO.RegistrationType.OIC.GetEnumValue()) ||
                                    (base.UserProfile.MemberType == DTO.RegistrationType.OICAgent.GetEnumValue()))
                                {
                                    btnGenReceiptAll.Visible     = false;
                                    gvSearch.Columns[0].Visible  = false;
                                    gvSearch.Columns[11].Visible = false;
                                }
                                else
                                {
                                    if (gvSearch.Rows.Count > 0)
                                    {
                                        btnGenReceiptAll.Visible    = true;
                                        gvSearch.Columns[0].Visible = true;
                                    }
                                    else
                                    {
                                        btnGenReceiptAll.Visible    = false;
                                        gvSearch.Columns[0].Visible = false;
                                    }

                                    gvSearch.Columns[11].Visible = true;
                                }
                                UpdatePanelSearch.Update();
                            }
                        }
                        else
                        {
                            this.MasterSite.ModelError.ShowMessageError = Resources.errorGenPayment_003;
                            this.MasterSite.ModelError.ShowModalError();
                            btnGenReceiptAll.Visible = false;
                        }
                    }
                    else
                    {
                        this.MasterSite.ModelError.ShowMessageError = Resources.errorGenPayment_003;
                        this.MasterSite.ModelError.ShowModalError();
                        btnGenReceiptAll.Visible = false;
                    }
                }
            }

            UpdatePanelSearch.Update();
        }
Beispiel #29
0
        private void BindDataInGridView(Boolean Count)
        {
            try
            {
                PAGE_SIZE = PAGE_SIZE_Key;
                string Place   = "";
                string Asso    = "";
                string DDLTime = "%";
                if (ddlTime.SelectedIndex != 0)
                {
                    DDLTime = ddlTime.SelectedValue.ToString();
                }

                if (ddlPlaceName.SelectedValue.ToString() != "เลือก")
                {
                    Place = ddlPlaceName.SelectedValue.ToString();
                }

                if (ddlAsso.SelectedValue.ToString() != "เลือก")
                {
                    Asso = ddlAsso.SelectedValue.ToString();
                }
                UpdatePanelSearch.Update();

                #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 = PAGE_SIZE.ToString();
                }
                else
                {
                    PAGE_SIZE = Convert.ToInt32(rowPerpage.Text);
                }
                #endregion page

                BLL.ApplicantBiz aBiz = new BLL.ApplicantBiz();
                if (Count)
                {
                    #region Page
                    var CountPage = aBiz.getManageApplicantCourse(ddlLicenseType.SelectedValue,
                                                                  txtStartExamDate.Text, txtEndExamDate.Text, Asso,
                                                                  Place, DDLTime,
                                                                  txtTestNo.Text.Trim(), resultPage, PAGE_SIZE, true);


                    if (CountPage.DataResponse != null)
                    {
                        if (CountPage.DataResponse.Tables[0].Rows.Count > 0)
                        {
                            Int32 totalROWs = Convert.ToInt32(CountPage.DataResponse.Tables[0].Rows[0]["CCount"].ToString());

                            VisibleGV(gvSearch, totalROWs, Convert.ToInt32(rowPerpage.Text), true);
                            if (Rpage == 0)
                            {
                                NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage);
                            }
                        }
                        else
                        {
                            VisibleGV(gvSearch, 0, Convert.ToInt32(rowPerpage.Text), true);
                            if (Rpage == 0)
                            {
                                NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage);
                            }
                            txtTotalPage.Text = "1";
                        }
                    }
                    #endregion Page
                }



                var res = aBiz.getManageApplicantCourse(ddlLicenseType.SelectedValue, txtStartExamDate.Text,
                                                        txtEndExamDate.Text, Asso, Place,
                                                        DDLTime, txtTestNo.Text.Trim(), resultPage, PAGE_SIZE, false);



                if (res.IsError)
                {
                    btnNextGvSearch.Visible     = false;
                    btnPreviousGvSearch.Visible = false;
                    txtNumberGvSearch.Visible   = false;
                    txtTotalPage.Visible        = false;
                    TXTrowperpage.Visible       = false;
                    lblParaPage.Visible         = false;
                    rowPerpage.Visible          = false;
                    pageGo.Visible                = false;
                    div_totalPage.Visible         = false;
                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    divGv1.Visible        = true;
                    gvSearch.Visible      = true;
                    div_totalPage.Visible = true;
                    boxResult.Visible     = true;

                    if (res != null)
                    {
                        if (res.DataResponse.Tables[0].Rows.Count > 0)
                        {
                            btnPreviousGvSearch.Enabled = true;
                            btnNextGvSearch.Enabled     = true;
                        }
                        else
                        {
                            btnPreviousGvSearch.Enabled = false;
                            btnNextGvSearch.Enabled     = false;
                        }
                        txtNumberGvSearch.Enabled = false;
                        gvSearch.DataSource       = res.DataResponse;
                        gvSearch.DataBind();
                        divGv2.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #30
0
        protected void BindDataInGridView2(Boolean count)
        {
            try
            {
                PAGE_SIZE = PAGE_SIZE_Key;
                BLL.ApplicantBiz Abiz = new ApplicantBiz();

                #region page
                int Rpage      = (txtNumberGvSearch2.Text.Trim() == "") ? 0 : txtNumberGvSearch2.Text.Trim().ToInt();
                int resultPage = (Rpage == 0) ? 1 : txtNumberGvSearch2.Text.Trim().ToInt();

                resultPage = resultPage == 0 ? 1 : resultPage;
                if ((rowPerpage2.Text.Trim() == null) || (rowPerpage2.Text.Trim() == "") || (rowPerpage2.Text.ToInt() == 0))
                {
                    rowPerpage2.Text = PAGE_SIZE.ToString();
                }
                else
                {
                    PAGE_SIZE = Convert.ToInt32(rowPerpage2.Text);
                }
                #endregion page

                string ConSQL = ddlEvent.SelectedValue.ToString() == "in"?"":"out";

                if (count)
                {
                    #region Page
                    var CountPage = Abiz.GetApplicantFromTestingNoForManageApplicant(selectRoom.Text, ConSQL, resultPage, PAGE_SIZE, true);


                    if (CountPage.DataResponse != null)
                    {
                        if (CountPage.DataResponse.Tables[0].Rows.Count > 0)
                        {
                            Int32 totalROWs = Convert.ToInt32(CountPage.DataResponse.Tables[0].Rows[0]["CCount"].ToString());

                            VisibleGV(gvSearch2, totalROWs, Convert.ToInt32(rowPerpage2.Text), true);
                            if (Rpage == 0)
                            {
                                NPbutton(btnPreviousGvSearch2, txtNumberGvSearch2, btnNextGvSearch2, "", txtTotalPage2);
                            }
                        }
                        else
                        {
                            VisibleGV(gvSearch2, 0, Convert.ToInt32(rowPerpage2.Text), true);
                            if (Rpage == 0)
                            {
                                NPbutton(btnPreviousGvSearch2, txtNumberGvSearch2, btnNextGvSearch2, "", txtTotalPage2);
                            }
                            txtTotalPage2.Text = "1";
                        }
                    }
                    #endregion Page
                }

                var res = Abiz.GetApplicantFromTestingNoForManageApplicant(selectRoom.Text, ConSQL, resultPage, PAGE_SIZE, false);
                if (res.IsError)
                {
                    btnNextGvSearch2.Visible     = false;
                    btnPreviousGvSearch2.Visible = false;
                    txtNumberGvSearch2.Visible   = false;
                    txtTotalPage2.Visible        = false;
                    TXTrowperpage2.Visible       = false;
                    lblParaPage2.Visible         = false;
                    rowPerpage2.Visible          = false;
                    pageGo2.Visible               = false;
                    manageApp.Visible             = false;
                    divAddIn.Visible              = false;
                    divGetOut.Visible             = false;
                    div_totalPage2.Visible        = false;
                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    if (res != null)
                    {
                        if (res.DataResponse.Tables[0].Rows.Count > 0)
                        {
                            btnPreviousGvSearch2.Enabled = true;
                            btnNextGvSearch2.Enabled     = true;

                            #region ManageRoom
                            manageApp.Visible = true;
                            if (ddlEvent.SelectedValue.ToString() == "in")
                            {
                                divAddIn.Visible  = true;
                                divGetOut.Visible = false;
                                btnAddIn.Visible  = true;
                                btnGetOut.Visible = false;
                            }
                            else
                            {
                                divAddIn.Visible  = false;
                                divGetOut.Visible = true;
                                btnAddIn.Visible  = false;
                                btnGetOut.Visible = true;
                            }
                            #endregion ManageRoom
                        }
                        else
                        {
                            btnPreviousGvSearch2.Enabled = false;
                            btnNextGvSearch2.Enabled     = false;
                            divAddIn.Visible             = false;
                            divGetOut.Visible            = false;
                        }
                        txtNumberGvSearch2.Enabled = false;
                        gvSearch2.DataSource       = res.DataResponse;
                        gvSearch2.DataBind();
                        gvSearch2.Visible = true;
                    }
                }
                UpdatePanelSearch.Update();
            }
            catch
            {
            }
        }