Esempio n. 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 { }
        }
Esempio n. 2
0
        protected void chkSelectApplicantNoPay_CheckedChanged(object sender, EventArgs e)
        {
            btnDelete.Enabled = true;

            var data = new List <DTO.CancelApplicant>();

            if (gvApplicantNoPay.Visible == true)
            {
                foreach (GridViewRow gr in gvApplicantNoPay.Rows)
                {
                    if (((CheckBox)gr.FindControl("chkSelectApplicantNoPay")).Checked == true)
                    {
                        var lblApplicantCodeGv = (Label)gr.FindControl("lblApplicantCodeGv");
                        var lblTestingNoGv     = (Label)gr.FindControl("lblTestingNoGv");
                        var lblExamPlaceCodeGv = (Label)gr.FindControl("lblExamPlaceCodeGv");


                        data.Add(new DTO.CancelApplicant
                        {
                            ApplicantCode = Convert.ToInt32(lblApplicantCodeGv.Text),
                            TestingNo     = lblTestingNoGv.Text,
                            ExamPlaceCode = lblExamPlaceCodeGv.Text
                        });
                    }
                }

                Session["CancelApplicant"] = data;
            }

            UpdatePanelGv.Update();
        }
Esempio n. 3
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     if (Convert.ToDateTime(txtStartPaidSubDate.Text) > Convert.ToDateTime(txtEndPaidSubDate.Text))
     {
         UCModalError.ShowMessageError = Resources.errorApplicantNoPay_004;
         UCModalError.ShowModalError();
         PnlDetail.Visible = false;
     }
     else
     {
         UpdatePanelGv.Update();
         ListAppNoPay           = new List <DTO.AppNoPay>();
         txtNumberGvSearch.Text = "0";
         txt_Page_now.Text      = "0";
         lbltotalP.Text         = "0";
         BindDataInGridview(true);
         PnlDetail.Visible    = true;
         exportExcel2.Visible = false;
         if (gvSearch.Rows.Count > 0)
         {
             btnExportExcel.Visible = true;
         }
         else
         {
             btnExportExcel.Visible = false;
         }
     }
 }
Esempio n. 4
0
 protected void btnNextDGvSearch_Click(object sender, EventArgs e)
 {
     NPbutton(btn_P, txt_Page_now, btn_N, "N", lbltotalP);
     BindDATAdetail(NOW_REQUEST.Insert(6, " ").Insert(11, " "));
     Hide_show(btn_P, txt_Page_now, btn_N, "", txtTotalPage.Text.ToInt());
     UpdatePanelGv.Update();
     detaiLL.Visible = false;
 }
Esempio n. 5
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());
     gv2.Visible     = false;
     detaiLL.Visible = false;
     UpdatePanelGv.Update();
 }
Esempio n. 6
0
        protected void btnExportExcel_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                int total = lblTotal.Text == "" ? 0 : lblTotal.Text.ToInt();
                if (total > base.EXCEL_SIZE_Key)
                {
                    UCModalError.ShowMessageError = SysMessage.ExcelSizeError;
                    UCModalError.ShowModalError();
                    UpdatePanelGv.Update();
                }
                else
                {
                    ExportBiz export = new ExportBiz();
                    Dictionary <string, string> columns = new Dictionary <string, string>();
                    columns.Add("ลำดับ", "RUN_NO");
                    columns.Add("เลขที่ใบสั่งจ่ายกลุ่ม", "GROUP_REQUEST_NO");
                    columns.Add("วันครบกำหนดชำระ", "EXPIRATION_DATE");
                    columns.Add("จำนวนเงินในใบสั่งจ่ายกลุ่ม", "GROUP_AMOUNT");

                    List <HeaderExcel> header = new List <HeaderExcel>();
                    header.Add(new HeaderExcel
                    {
                        NameColumnsOne  = "วันที่ต้องชำระเงิน(เริ่ม) ",
                        ValueColumnsOne = txtStartPaidSubDate.Text,
                        NameColumnsTwo  = "วันที่ต้องชำระเงิน(สิ้นสุด) ",
                        ValueColumnsTwo = txtEndPaidSubDate.Text
                    });

                    header.Add(new HeaderExcel
                    {
                        NameColumnsOne  = "วันที่สอบ ",
                        ValueColumnsOne = txtTestingDate.Text,
                        NameColumnsTwo  = "รหัสรอบสอบ ",
                        ValueColumnsTwo = txtTestingNo.Text
                    });

                    header.Add(new HeaderExcel
                    {
                        NameColumnsOne  = "รหัสสนามสอบ ",
                        ValueColumnsOne = txtExamPlaceCode.Text
                    });



                    var biz = new BLL.PaymentBiz();
                    var res = biz.GetApplicantNoPaymentHeadder(Convert.ToDateTime(txtStartPaidSubDate.Text),
                                                               Convert.ToDateTime(txtEndPaidSubDate.Text), txtTestingDate.Text, txtTestingNo.Text, txtExamPlaceCode.Text, 1, base.EXCEL_SIZE_Key, false);
                    export.CreateExcel(res.DataResponse.Tables[0], columns, header, base.UserProfile);
                }
            }
            catch { }
        }
Esempio n. 7
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;
     }
     UpdatePanelGv.Update();
     if (txtNum.Text.ToInt() >= MaxP)
     {
         NextName.Visible = false;
     }
     else
     {
         NextName.Visible = true;
     }
 }
Esempio n. 8
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            if (ListAppNoPay != null)
            {
                var biz = new BLL.PaymentBiz();
                var res = biz.CancelApplicantsHeader(ListAppNoPay.ToArray());

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

                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = "ยกเลิกรายการ " + ListAppNoPay.Count + " รายการเรียบร้อยแล้ว";
                    UCModalSuccess.ShowModalSuccess();
                    btnDelete.Visible = true;
                    ClearData();
                    btnSearch_Click(sender, e);
                    // BindDataInGridview(true);
                    NPbutton(btnPreviousGvSearch, txtNumberGvSearch, btnNextGvSearch, "", txtTotalPage);
                    PnlDetail.Visible = true;
                    UpdatePanelGv.Update();
                    ListAppNoPay = new List <DTO.AppNoPay>();
                    if (gvSearch.Rows.Count == 0)
                    {
                        btnExportExcel.Visible = false;
                    }
                }
            }
            else
            {
                UCModalError.ShowMessageError = Resources.errorApplicantNoPay_003;
                UCModalError.ShowModalError();
            }
        }
Esempio n. 9
0
        protected void btnDisSave_Click(object sender, EventArgs e)
        {
            try
            {
                AccountBiz        biz  = new AccountBiz();
                DTO.AccountDetail user = new DTO.AccountDetail();
                user.ID         = lblDisUserID.Text;
                user.ACTIVE     = radIsActive.SelectedValue;
                user.ID_CARD_NO = lblDisIdCard.Text;
                if (user.ACTIVE == "D")
                {
                    user.DELETE_USER     = ddlDisRemark.SelectedValue;
                    user.OTH_DELETE_USER = txtDisRemarkText.Text;
                    if (String.IsNullOrEmpty(user.DELETE_USER))
                    {
                        MessageBoxError("กรุณาเลือก เหตุผลการยกเลิก");
                        return;
                    }
                }

                var res = biz.DisableUser(user, UserProfile);
                if (!res.IsError)
                {
                    PopUpDisableUser.Hide();
                    MessageBoxSuccess("บันทึกข้อมูลเรียบร้อยแล้ว");
                    BindGrid();
                    UpdatePanelGv.Update();
                }
                else
                {
                    MessageBoxError(res.ErrorMsg);
                }
            }
            catch (Exception ex)
            {
                MessageBoxError(ex.Message);
            }
        }
Esempio n. 10
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;
        }
Esempio n. 11
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();
            }
        }
Esempio n. 12
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            AccountBiz biz = new AccountBiz();

            try
            {
                DTO.AccountDetail ent = new DTO.AccountDetail();
                ent.ID          = lblUserId.Text;
                ent.MEMBER_TYPE = ddlMemberTypeEdit.SelectedValue;
                if (ent.MEMBER_TYPE == "2" && trCompany.Visible == true)
                {
                    ent.COMP_CODE = txtCompanyId.Text.Trim();
                }
                else if (ent.MEMBER_TYPE == "3" && trAssoc.Visible == true)
                {
                    ent.COMP_CODE = txtAssocId.Text.Trim();
                }
                else if (ent.MEMBER_TYPE == "7" && trExamPlaceGroup.Visible == true)
                {
                    ent.COMP_CODE = ddlExamPlaceGroup.SelectedValue;
                }
                else
                {
                    ent.COMP_CODE = UserCompCode;
                }

                ent.OTH_USER_TYPE = txtRemark.Text;

                var res = biz.EditMemberTypeAndActive(ent, UserProfile);
                if (!res.IsError)
                {
                    PopUpEditTypeAccount.Hide();
                    this.MasterSite.ModelSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                    this.MasterSite.ModelSuccess.ShowModalSuccess();
                    btnSearch_Click(sender, e);
                    UpdatePanelGv.Update();
                    UplPopUp.Update();
                }
                else
                {
                    PopUpEditTypeAccount.Show();
                    this.MasterSite.ModelError.ShowMessageError = res.ErrorMsg;
                    this.MasterSite.ModelError.ShowModalError();

                    if (ent.MEMBER_TYPE == "2" && trCompany.Visible == true)
                    {
                        SetCompanyIdName();
                    }
                    else if (ent.MEMBER_TYPE == "3" && trAssoc.Visible == true)
                    {
                        SetAssocIdName();
                    }
                    else if (ent.MEMBER_TYPE == "7" && trExamPlaceGroup.Visible == true)
                    {
                        SetExamPlaceGroup();
                    }
                    UplPopUp.Update();
                }
            }
            catch (Exception ex)
            {
                PopUpEditTypeAccount.Show();
                this.MasterSite.ModelError.ShowMessageError = ex.Message;
                this.MasterSite.ModelError.ShowModalError();
                UplPopUp.Update();
            }
        }