Пример #1
0
        protected void exportExcel2_Click(object sender, ImageClickEventArgs e)
        {
            ExportBiz export = new ExportBiz();

            try
            {
                int total = lblRec.Text == "" ? 0 : lblRec.Text.ToInt();
                if (total > base.EXCEL_SIZE_Key)
                {
                    UCModalError.ShowMessageError = SysMessage.ExcelSizeError;
                    UCModalError.ShowModalError();
                    UpdatePanelGv.Update();
                }
                else
                {
                    Dictionary <string, string> columns = new Dictionary <string, string>();
                    columns.Add("ลำดับ", "RUN_NO");
                    columns.Add("เลขบัตรประชาชน", "ID_CARD_NO");
                    columns.Add("วันที่สมัคร", "CREATED_DATE");
                    columns.Add("ชื่อ", "FIRSTNAME");
                    columns.Add("นามสกุล", "LASTNAME");
                    columns.Add("วันที่สอบ", "TESTING_DATE");

                    var biz = new BLL.PaymentBiz();
                    var res = biz.GetApplicantNoPayment(txtTestingDate.Text, txtTestingNo.Text, txtExamPlaceCode.Text, Convert.ToDateTime(txtStartPaidSubDate.Text),
                                                        Convert.ToDateTime(txtEndPaidSubDate.Text), H_NOW_REQUEST.Value, 1, base.EXCEL_SIZE_Key, false);
                    int[] colum = new int[] { 9 };
                    export.CreateExcel(res.DataResponse, columns);
                }
            }
            catch { }
        }
Пример #2
0
        protected void BindDATAdetail(string GroupNo)
        {
            var biz = new BLL.PaymentBiz();

            #region Page
            int PageSizeDetail = (txt_input.Text.Trim() != "") ? txt_input.Text.ToInt() : PageSize;
            int Rpage          = (txt_Page_now.Text.Trim() == "") ? 0 : txt_Page_now.Text.Trim().ToInt();
            int resultPage     = (Rpage == 0) ? 1 : txt_Page_now.Text.Trim().ToInt();
            resultPage = resultPage == 0 ? 1 : resultPage;

            var CountPage = biz.GetApplicantNoPayment(txtTestingDate.Text, txtTestingNo.Text.Trim(), txtExamPlaceCode.Text.Trim(), Convert.ToDateTime(txtStartPaidSubDate.Text),
                                                      Convert.ToDateTime(txtEndPaidSubDate.Text), GroupNo, resultPage, PageSizeDetail, true);


            if ((txt_input.Text.Trim() == null) || (txt_input.Text.Trim() == "") || (txt_input.Text.ToInt() <= 0))
            {
                txt_input.Text = PageSizeDetail.ToString();
            }
            else
            {
                PageSizeDetail = Convert.ToInt32(txt_input.Text);
            }

            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(gvApplicantNoPay, totalROWs, Convert.ToInt32(txt_input.Text), true);
                    if (Rpage == 0)
                    {
                        NPbutton(btn_P, txt_Page_now, btn_N, "", lbltotalP);
                    }
                }
                else
                {
                    VisibleGV(gvApplicantNoPay, 0, Convert.ToInt32(txt_input.Text), true);
                    if (Rpage == 0)
                    {
                        NPbutton(btn_P, txt_Page_now, btn_N, "", lbltotalP);
                    }
                    lbltotalP.Text = "1";
                }
            }
            #endregion Page

            var res = biz.GetApplicantNoPayment(txtTestingDate.Text, txtTestingNo.Text, txtExamPlaceCode.Text, Convert.ToDateTime(txtStartPaidSubDate.Text),
                                                Convert.ToDateTime(txtEndPaidSubDate.Text), NOW_REQUEST, resultPage, PageSizeDetail, false);

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

                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                gvApplicantNoPay.DataSource = res.DataResponse;
                gvApplicantNoPay.DataBind();
                gvApplicantNoPay.Visible = true;
                gv2.Visible          = true;
                exportExcel2.Visible = true;
                UpdatePanelGv.Update();
            }
            detaiLL.Visible    = false;
            detaiLL.Enabled    = false;
            group_request.Text = Resources.propApplicantNoPay_group_request + GroupNo;
        }