Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 protected override void OnUnload(EventArgs e)
 {
     base.OnUnload(e);
     if (ShowWaitingModal && Page.IsPostBack && !Page.ClientScript.IsStartupScriptRegistered("CloseWatingModal"))
     {
         ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "CloseWatingModal", "closeWaitingModal();", true);
     }
 }
Ejemplo n.º 3
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            DTO.ResponseMessage <bool> resValidate = this.RegPassValidation();
            if (resValidate.ResultMessage == false)
            {
                UCModalError.ShowMessageError = this.RegPassValidation().ErrorMsg;
                UCModalError.ShowModalError();
                return;
            }
            else if (resValidate.ResultMessage == true)
            {
                if (txtNewPassword.Text == txtConfirmPassword.Text)
                {
                    //chek รหัสเดิมห้ามตรงกับรหัสใหม่
                    if (txtOldPassword.Text == txtNewPassword.Text)
                    {
                        UCModalError.ShowMessageError = "รหัสผ่านใหม่ห้ามซ้ำกับรหัสผ่านเดิม";
                        UCModalError.ShowModalError();
                        return;
                    }



                    var biz = new BLL.UserAuthenBiz();

                    if (Session[PageList.UserProfile] != null)
                    {
                        DTO.UserProfile userProfile = (DTO.UserProfile)Session[PageList.UserProfile];
                        var             res         = biz.ChangePassword(userProfile.Id, txtOldPassword.Text, txtNewPassword.Text);
                        if (res.IsError)
                        {
                            var errorMsg = res.ErrorMsg;

                            UCModalError.ShowMessageError = res.ErrorMsg;
                            UCModalError.ShowModalError();
                            return;
                        }
                        else
                        {
                            string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../home.aspx')";
                            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Alert, true);
                        }
                    }
                    else
                    {
                        var errorMsg = Resources.errorChangePass_001;

                        UCModalError.ShowMessageError = errorMsg;
                        UCModalError.ShowModalError();
                        return;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        protected void btnEditSubmit_Click(object sender, EventArgs e)
        {
            var biz = new BLL.PersonBiz();

            PersonTemp item = new PersonTemp();

            item.ID              = this.UserProfile.Id;
            item.COMP_CODE       = ddlPlaceGroup.SelectedValue;
            item.MEMBER_TYPE     = this.MememberTypePlaceGroup;
            item.ID_CARD_NO      = txtIDNumber.Text;
            item.PRE_NAME_CODE   = ddlTitle.SelectedValue;
            item.NAMES           = txtFirstName.Text;
            item.LASTNAME        = txtLastName.Text;
            item.SEX             = rblSex.SelectedValue;
            item.EMAIL           = txtEmail.Text;
            item.LOCAL_TELEPHONE = txtPlaceGroupTel.Text;
            item.TELEPHONE       = txtTel.Text;
            item.ADDRESS_1       = txtAddress.Text;
            item.PROVINCE_CODE   = ddlProvince.SelectedValue;
            item.AREA_CODE       = ddlDistrict.SelectedValue;
            item.TUMBON_CODE     = ddlParish.SelectedValue;
            item.ZIP_CODE        = txtPostcode.Text;
            item.CREATED_BY      = "agdoi";
            item.CREATED_DATE    = DateTime.Now;
            item.UPDATED_BY      = "agdoi";
            item.UPDATED_DATE    = DateTime.Now;


            string firstName = item.NAMES;
            string lastName  = txtLastName.Text;

            var final = biz.SetPersonTemp(item, this.PersonAttachFiles.ToArray());



            if (final.IsError)
            {
                UCModalError.ShowMessageError = final.ErrorMsg;
                UCModalError.ShowModalError();
            }

            ClearControl();

            UCModalError.Visible   = false;
            UCModalSuccess.Visible = false;



            MasterPage.SetUsername(firstName, lastName);

            string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../Register/Reg_Place_Group.aspx?Mode=V')";

            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Alert, true);
        }
Ejemplo n.º 5
0
        protected void hplView_Click(object sender, EventArgs e)
        {
            var gr = (GridViewRow)((LinkButton)sender).NamingContainer;

            var text = (Label)gr.FindControl("lblFileGv");

            Session["ViewFileName"] = text.Text;

            string OpenWindow = "window.open('licenseViewDocument.aspx','','')";

            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", OpenWindow, true);
        }
Ejemplo n.º 6
0
        protected void hplView_Click(object sender, EventArgs e)
        {
            var gr = (GridViewRow)((LinkButton)sender).NamingContainer;

            var text = (Label)gr.FindControl("lblFileGv");

            Session["ViewFileName"] = text.Text;

            string showPic = IAS.Utils.CryptoBase64.Encryption(text.Text.ToString().Trim());

            string OpenWindow = "window.open('../Register/ImagePopup.aspx?targetImage=" + showPic + "','','')";

            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", OpenWindow, true);
        }
Ejemplo n.º 7
0
    //protected void lnkSelect_Click(object sender, EventArgs e)
    //{
    //    string str;
    //    int rowIndex = 0;
    //    Supplier supp = new Supplier();
    //    rowIndex = int.Parse((sender as LinkButton).CommandArgument);
    //    supp.SupplierID = int.Parse(this.GridView1.DataKeys[rowIndex]["SupplierID"].ToString());
    //    supp = Service.GetSupplierbykey(supp);
    //    str = supp.SupplierID + "∑" + supp.DUNS + "∑" + supp.PhoneNumber1 + "∑" + supp.Fax;

    //    Page.RegisterStartupScript("Set", "<script>setReturnValue('" + str + "');</script>");
    //}

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Select")
        {
            string str;
            int    rowIndex = Convert.ToInt32(e.CommandArgument);
            //GridViewRow row = ((Control)sender).NamingContainer as GridViewRow;
            Supplier supp = new Supplier();
            supp.SupplierID = int.Parse(this.GridView1.DataKeys[rowIndex]["SupplierID"].ToString());
            supp            = Service.GetSupplierbykey(supp);
            str             = supp.SupplierID + "∑" + supp.DUNS + "∑" + supp.PhoneNumber1 + "∑" + supp.Fax;

            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "Set", "setReturnValue('" + str + "');", true);
        }
    }
Ejemplo n.º 8
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            string id = null;

            if (!String.IsNullOrEmpty(this.ActiveWebPart))
            {
                id = this.WebParts[this.ActiveWebPart].ClientID;
            }

            string js = @"
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
function EndRequest(sender, args)
{
    if (args.get_error() == undefined) {
            var id = $('#" + _activeWebPartClientIDHidden.ClientID + @"').val();
            registerPopup(id);
     }
}

function registerPopup(id) {
    var popup = $('#' + id).parents('.popupzone_part').first();
    popup.switchClass('popup_hidden', 'popup_shown');
    popup.overlay({

    // custom top position
    top: 100,
    left: 750,

    // disable this for modal dialog-type of overlays
    closeOnClick: false,

    // load it immediately after the construction
    load: false

    });
    
    popup.overlay().load();
    popup.draggable();
}
";

            ToolkitScriptManager.RegisterStartupScript(this, typeof(Page), "overlay components", js, true);
        }
Ejemplo n.º 9
0
        // Backend copy of Frontend Masonry JS call
        public void Masonry()
        {
            string script = " $(function () { var $container = $('#container'); $container.imagesLoaded(function () { $container.masonry({ itemSelector: '.item' }); }); });";

            ToolkitScriptManager.RegisterStartupScript(this, GetType(), "masonry", script, true);
        }
Ejemplo n.º 10
0
    /// <summary>
    /// 打开指定页面
    /// </summary>
    /// <param name="control"></param>
    /// <param name="url"></param>
    /// <param name="height"></param>
    /// <param name="width"></param>
    public static void OpenWindow(Control control, string url, string height, string width)
    {
        string script = string.Format("window.showModalDialog('{0}','','height={1}, width={2}, top=20, left=20, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');", url, height, width);

        ToolkitScriptManager.RegisterStartupScript(control, typeof(System.Web.UI.Page), "open", script, true);
    }
Ejemplo n.º 11
0
 protected void btnShow_Click(object sender, EventArgs e)
 {
     ToolkitScriptManager.RegisterStartupScript(Page, typeof(Page), "popup", "window.open('../Register/Reg_Co.aspx', '_blank')", true);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// ISSUE : http://jira.ar.co.th/browse/IASAR-411
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <EDITOR>Natta</EDITOR>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            DTO.ResponseMessage <bool> res = this.ControlValidationBeforeSubmit(this.Page);
            if ((res.ResultMessage == false) || (res.IsError))
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
                //return;
                //ControlValidation(RegisGeneral);
                return;
            }

            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
            Registration        reg = new Registration();

            reg.ID            = IAS.BLL.Helpers.GenerateIdHelper.GetGenAutoId();
            reg.PRE_NAME_CODE = ddlTitle.SelectedValue;
            if (rblSex.SelectedValue == "M")
            {
                reg.SEX = "M";
            }
            else
            {
                reg.SEX = "F";
            }
            reg.NAMES           = txtFirstName.Text;
            reg.LASTNAME        = txtLastName.Text;
            reg.MEMBER_TYPE     = this.MememberTypePlaceGroup;
            reg.COMP_CODE       = ddlPlaceGroup.SelectedValue;
            reg.ID_CARD_NO      = txtIDNumber.Text;
            reg.PRE_NAME_CODE   = ddlTitle.SelectedValue;
            reg.NAMES           = txtFirstName.Text;
            reg.LASTNAME        = txtLastName.Text;
            reg.EMAIL           = txtEmail.Text;
            reg.LOCAL_TELEPHONE = txtPlaceGroupTel.Text;
            reg.TELEPHONE       = txtTel.Text;
            reg.ADDRESS_1       = txtAddress.Text;
            reg.PROVINCE_CODE   = ddlProvince.SelectedValue;
            reg.AREA_CODE       = ddlDistrict.SelectedValue;
            reg.TUMBON_CODE     = ddlParish.SelectedValue;
            reg.ZIP_CODE        = txtPostcode.Text;
            reg.CREATED_BY      = "agdoi";
            reg.CREATED_DATE    = DateTime.Now;
            reg.UPDATED_BY      = "agdoi";
            reg.UPDATED_DATE    = DateTime.Now;
            if (txtPassword.Text == txtPassword.Text)
            {
                //reg.REG_PASSWORD = txtPassword.Text;
                reg.REG_PASS = txtPassword.Text;
            }

            reg.LINK_REDIRECT = Utils.CryptoBase64.Encryption(reg.EMAIL.Trim() + "||" + txtPassword.Text.Trim());
            var attachFiles = this.AttachFiles;
            var result      = biz.InsertWithAttatchFile(DTO.RegistrationType.TestCenter, reg, attachFiles);

            if (result.IsError)
            {
                UCModalError.ShowMessageError = result.ErrorMsg;
                UCModalError.ShowModalError();
                return;
                //Response.Redirect("Reg_Place_Group.aspx");
            }
            else
            {
                UCModalSuccess.ShowMessageSuccess = SysMessage.SuccessInsertTypeGroupPlace;
                UCModalSuccess.ShowModalSuccess();
            }

            Session.Remove("TempFolderOracle");
            Session.Remove("AttatchFiles");
            //Session.Abandon();

            ClearControl();

            UCModalError.Visible   = false;
            UCModalSuccess.Visible = false;

            string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../Register/Reg_Place_Group.aspx')";

            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Alert, true);

            //string Alert = "alert('"+ Resources.infoSysMessage_RegisSuccess2 +"');window.location.assign('../home.aspx')";
            //ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", Alert, true);
        }