Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlInputButton btn = (System.Web.UI.HtmlControls.HtmlInputButton)(Master.FindControl("cart").FindControl("bPurcahse"));
            btn.Disabled = true;

            if (Session["Payment"] != null)
            {
                DataTable dt = (DataTable)Session["Payment"];
                if (dt.Rows.Count > 0)
                {
                    bCash.Enabled    = false;
                    bCredit.Enabled  = false;
                    bVoucher.Enabled = false;
                }
                else
                {
                    bCash.Enabled    = true;
                    bCredit.Enabled  = true;
                    bVoucher.Enabled = true;
                }
            }
            else
            {
                bCash.Enabled    = true;
                bCredit.Enabled  = true;
                bVoucher.Enabled = true;
            }
        }
 private void ButtonOffOn(System.Web.UI.HtmlControls.HtmlInputButton btn)
 {
     if (btn.Disabled == true)
     {
         btn.Attributes.Add("class", "Off FixWidth");
     }
     else
     {
         btn.Attributes.Add("class", "FixWidth");
     }
 }
Esempio n. 3
0
        private void LinkControls(ControlCollection ctrls)
        {
            foreach (Control ctrl in ctrls)
            {
                switch (ctrl.ID)
                {
                case "tgQR":
                    tgQR           = (Toggle)ctrl;
                    tgQR.ImagePath = ThemePath;
                    break;

                case "tgdQR":
                    tgdQR = (ToggleDisplay)ctrl;
                    break;

                case "plhMessage":
                    plhMessage = (PlaceHolder)ctrl;
                    break;

                case "reqUserName":
                    reqUserName = (System.Web.UI.WebControls.RequiredFieldValidator)ctrl;
                    break;

                case "txtUserName":
                    txtUserName = (System.Web.UI.HtmlControls.HtmlInputText)ctrl;
                    break;

                case "reqBody":
                    reqBody = (Label)ctrl;
                    break;

                case "reqSecurityCode":
                    reqSecurityCode = (Label)ctrl;
                    break;

                case "chkSubscribe":
                    chkSubscribe = (CheckBox)ctrl;
                    break;

                case "ambtnSubmit":
                    ambtnSubmit = (ImageButton)ctrl;
                    break;

                case "btnSubmit":
                    btnSubmit = (System.Web.UI.HtmlControls.HtmlInputButton)ctrl;
                    break;

                case "trUsername":
                    trUsername = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                    break;

                case "trCaptcha":
                    trCaptcha = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                    break;

                case "trSubscribe":
                    trSubscribe = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                    break;
                }
                if (ctrl is Controls.ControlsBase)
                {
                    ((Controls.ControlsBase)ctrl).ControlConfig = this.ControlConfig;
                }
                if (ctrl.Controls.Count > 0)
                {
                    LinkControls(ctrl.Controls);
                }
            }
        }
Esempio n. 4
0
 private void LinkControls(ControlCollection ctrls)
 {
     foreach (Control ctrl in ctrls)
     {
         switch (ctrl.ID)
         {
             case "tgQR":
                 tgQR = (Toggle)ctrl;
                 tgQR.ImagePath = ThemePath;
                 break;
             case "tgdQR":
                 tgdQR = (ToggleDisplay)ctrl;
                 break;
             case "plhMessage":
                 plhMessage = (PlaceHolder)ctrl;
                 break;
             case "reqUserName":
                 reqUserName = (System.Web.UI.WebControls.RequiredFieldValidator)ctrl;
                 break;
             case "txtUserName":
                 txtUserName = (System.Web.UI.HtmlControls.HtmlInputText)ctrl;
                 break;
             case "reqBody":
                 reqBody = (Label)ctrl;
                 break;
             case "reqSecurityCode":
                 reqSecurityCode = (Label)ctrl;
                 break;
             case "chkSubscribe":
                 chkSubscribe = (CheckBox)ctrl;
                 break;
             case "ambtnSubmit":
                 ambtnSubmit = (ImageButton)ctrl;
                 break;
             case "btnSubmit":
                 btnSubmit = (System.Web.UI.HtmlControls.HtmlInputButton)ctrl;
                 break;
             case "trUsername":
                 trUsername = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                 break;
             case "trCaptcha":
                 trCaptcha = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                 break;
             case "trSubscribe":
                 trSubscribe = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                 break;
         }
         if (ctrl is Controls.ControlsBase)
         {
             ((Controls.ControlsBase)ctrl).ControlConfig = this.ControlConfig;
         }
         if (ctrl.Controls.Count > 0)
         {
             LinkControls(ctrl.Controls);
         }
     }
 }
Esempio n. 5
0
 protected void rptList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rptSubList");
         OrderInfo orderInfo = OrderHelper.GetOrderInfo(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID").ToString());
         if (orderInfo != null && orderInfo.LineItems.Count > 0)
         {
             repeater.DataSource = orderInfo.LineItems.Values;
             repeater.DataBind();
         }
         OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus");
         string      a           = "";
         if (!(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull))
         {
             a = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway");
         }
         int num = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId") != System.DBNull.Value) ? ((int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId")) : 0;
         //	System.Web.UI.HtmlControls.HtmlInputButton htmlInputButton = (System.Web.UI.HtmlControls.HtmlInputButton)e.Item.FindControl("btnModifyPrice");
         //	System.Web.UI.HtmlControls.HtmlInputButton htmlInputButton2 = (System.Web.UI.HtmlControls.HtmlInputButton)e.Item.FindControl("btnSendGoods");
         System.Web.UI.WebControls.Button           button           = (System.Web.UI.WebControls.Button)e.Item.FindControl("btnPayOrder");
         System.Web.UI.WebControls.Button           button2          = (System.Web.UI.WebControls.Button)e.Item.FindControl("btnConfirmOrder");
         System.Web.UI.HtmlControls.HtmlInputButton htmlInputButton3 = (System.Web.UI.HtmlControls.HtmlInputButton)e.Item.FindControl("btnCloseOrderClient");
         System.Web.UI.HtmlControls.HtmlAnchor      arg_198_0        = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund");
         System.Web.UI.HtmlControls.HtmlAnchor      arg_1AE_0        = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReturn");
         System.Web.UI.HtmlControls.HtmlAnchor      arg_1C4_0        = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReplace");
         System.Web.UI.WebControls.Literal          literal          = (System.Web.UI.WebControls.Literal)e.Item.FindControl("WeiXinNickName");
         System.Web.UI.WebControls.Literal          literal2         = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litOtherInfo");
         int        totalPointNumber = orderInfo.GetTotalPointNumber();
         MemberInfo member           = MemberProcessor.GetMember(orderInfo.UserId, true);
         if (member != null)
         {
             literal.Text = "买家:" + member.UserName;
         }
         System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
         decimal total = orderInfo.GetTotal();
         if (total > 0m)
         {
             stringBuilder.Append("<strong>¥" + total.ToString("F2") + "</strong>");
             stringBuilder.Append("<small>(含运费¥" + orderInfo.AdjustedFreight.ToString("F2") + ")</small>");
         }
         if (totalPointNumber > 0)
         {
             stringBuilder.Append("<small>" + totalPointNumber.ToString() + "积分</small>");
         }
         if (orderInfo.PaymentType == "货到付款")
         {
             stringBuilder.Append("<span class=\"setColor bl\"><strong>货到付款</strong></span>");
         }
         if (string.IsNullOrEmpty(stringBuilder.ToString()))
         {
             stringBuilder.Append("<strong>¥" + total.ToString("F2") + "</strong>");
         }
         literal2.Text = stringBuilder.ToString();
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             //htmlInputButton.Visible = true;
             //htmlInputButton.Attributes.Add("onclick", "DialogFrame('../trade/EditOrder.aspx?OrderId=" + System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID") + "&reurl='+ encodeURIComponent(goUrl),'修改订单价格',900,450)");
             htmlInputButton3.Attributes.Add("onclick", "CloseOrderFun('" + System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID") + "')");
             htmlInputButton3.Visible = true;
             if (a != "hishop.plugins.payment.podrequest")
             {
                 button.Visible = true;
             }
         }
         if (num > 0)
         {
             GroupBuyStatus groupBuyStatus = (GroupBuyStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus");
             //	htmlInputButton2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && groupBuyStatus == GroupBuyStatus.Success);
         }
         //else
         //{
         //	htmlInputButton2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest"));
         //}
         //	htmlInputButton2.Attributes.Add("onclick", "DialogFrame('../trade/SendOrderGoods.aspx?OrderId=" + System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID") + "&reurl='+ encodeURIComponent(goUrl),'订单发货',750,220)");
         button2.Visible = (orderStatus == OrderStatus.SellerAlreadySent);
     }
 }
Esempio n. 6
0
        public static void AssociateListBoxes(System.Web.UI.WebControls.ListBox sourceListBox,
                                              System.Web.UI.WebControls.ListBox targetListBox,
                                              System.Web.UI.HtmlControls.HtmlInputButton addButton,
                                              System.Web.UI.HtmlControls.HtmlInputButton removeButton
                                              )
        {
            // Test for validity.
            if (sourceListBox.Page == null || targetListBox.Page == null)
            {
                throw(new ArgumentException("The control must be added to a page before " +
                                            "you can set the associations."));
            }

            RegisterBrowserDetector(sourceListBox.Page);

            string sourceId   = sourceListBox.ClientID;
            string targetId   = targetListBox.ClientID;
            string funcPrefix = "lba_" + sourceId + targetId;

            addButton.Attributes.Add("onClick", funcPrefix + "_Add();");
            removeButton.Attributes.Add("onClick", funcPrefix + "_Remove();");

            sourceListBox.Page.ClientScript.RegisterClientScriptBlock(typeof(ControlExtender), funcPrefix,
                                                                      "<script language=\"javascript\"> \n" +
                                                                      "<!-- \n" +
                                                                      "function " + funcPrefix + "_Add() \n" +
                                                                      "{ \n" +
                                                                      "	var f = document.forms[0]; \n" +
                                                                      "	var idx = f." + sourceId + ".selectedIndex; \n" +
                                                                      "	if(idx==-1) \n" +
                                                                      "		return; \n"+
                                                                      "	if (NSX) \n" +
                                                                      "	{ \n" +
                                                                      "		f."+ targetId + ".options[f." + targetId + ".length] = f." + sourceId + ".options[idx].text; \n" +
                                                                      "		f."+ targetId + ".options[idx] = null; \n" +
                                                                      "	} \n" +
                                                                      "	else if (IE4) \n" +
                                                                      "	{ \n" +
                                                                      "		var newOpt = document.createElement(\"OPTION\"); \n"+
                                                                      "		newOpt.text = f."+ sourceId + ".options[idx].text; \n" +
                                                                      "		newOpt.value = f."+ sourceId + ".options[idx].value; \n" +
                                                                      "		f."+ targetId + ".add(newOpt); \n" +
                                                                      "	} \n" +
                                                                      "	f." + sourceId + ".options.remove(idx); \n" +
                                                                      "} \n" +
                                                                      "function " + funcPrefix + "_Remove() \n" +
                                                                      "{ \n" +
                                                                      "	var f = document.forms[0]; \n" +
                                                                      "	var idx = f." + targetId + ".selectedIndex; \n" +
                                                                      "	if(idx==-1) \n" +
                                                                      "		return; \n"+
                                                                      "	if (NSX) \n" +
                                                                      "	{ \n" +
                                                                      "		f."+ sourceId + ".options[f." + sourceId + ".length] = f." + targetId + ".options[idx].text; \n" +
                                                                      "		f."+ sourceId + ".options[idx] = null; \n" +
                                                                      "	} \n" +
                                                                      "	else if (IE4) \n" +
                                                                      "	{ \n" +
                                                                      "		var newOpt = document.createElement(\"OPTION\"); \n"+
                                                                      "		newOpt.text = f."+ targetId + ".options[idx].text; \n" +
                                                                      "		newOpt.value = f."+ targetId + ".options[idx].value; \n" +
                                                                      "		f."+ sourceId + ".add(newOpt); \n" +
                                                                      "	} \n" +
                                                                      "	f." + targetId + ".options.remove(idx); \n" +
                                                                      "} \n" +
                                                                      "//--> \n" +
                                                                      "</script> \n");
        }
Esempio n. 7
0
        public static void DefaultButton(System.Web.UI.Page Page, ref System.Web.UI.WebControls.CheckBox checkBox, ref System.Web.UI.HtmlControls.HtmlInputButton inputButton)
        {
            try
            {
                System.Text.StringBuilder sScript = new System.Text.StringBuilder();

                sScript.Append(Environment.NewLine + "<SCRIPT language=\"javascript\">" + Environment.NewLine);
                sScript.Append("function fnTrapKD(btn) {" + Environment.NewLine);
                sScript.Append(" if (document.all){" + Environment.NewLine);
                sScript.Append("   if (event.keyCode == 13)" + Environment.NewLine);
                sScript.Append("   { " + Environment.NewLine);
                sScript.Append("     event.returnValue=false;" + Environment.NewLine);
                sScript.Append("     event.cancel = true;" + Environment.NewLine);
                sScript.Append("     btn.click();" + Environment.NewLine);
                sScript.Append("   } " + Environment.NewLine);
                sScript.Append(" } " + Environment.NewLine);
                sScript.Append("}" + Environment.NewLine);
                sScript.Append("</SCRIPT>" + Environment.NewLine);

                checkBox.Attributes.Add("onkeydown", "fnTrapKD(document.all." + inputButton.ClientID + ")");

                //Page.RegisterStartupScript("ForceDefaultToScript", sScript.ToString());
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ForceDefaultToScript", sScript.ToString());
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
            }
        }
Esempio n. 8
0
File: Upload.cs Progetto: VKeCRM/V2
 private void CreateCtrls()
 {
     System.Web.UI.HtmlControls.HtmlInputText input = new System.Web.UI.HtmlControls.HtmlInputText();
     input.Attributes["style"] = InputStyle;
     input.ID = this.ID + _fileName;
     System.Web.UI.HtmlControls.HtmlInputButton button = new System.Web.UI.HtmlControls.HtmlInputButton();
     button.Attributes["style"] = ButtonStyle;
     button.ID = this.ID + _btnName;
     button.Value = BtnValue;
     this.Controls.Add(input);
     this.Controls.Add(button);
 }