conditionscontrol.ascx

来自「C#语言制作asp.net网上商店的」· ASCX 代码 · 共 214 行

ASCX
214
字号
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ConditionsControl.ascx.vb"
    Inherits="Admin_Merchandising_Controls_ConditionsControl" %>
<%@ Register Src="../../Controls/ResultMessageControl.ascx" TagName="ResultMessageControl"
    TagPrefix="uc4" %>
<%@ Register Src="SpecialOfferNavControl.ascx" TagName="SpecialOfferNavControl" TagPrefix="uc3" %>
<%@ Register Src="../../Controls/ChooseProductsControl.ascx" TagName="ChooseProductsControl"
    TagPrefix="uc2" %>
<%@ Register Src="../../Controls/CategoryListControl.ascx" TagName="CategoryListControl"
    TagPrefix="uc1" %>
<%@ Register Src="../../Controls/CheckAllCheckBoxControl.ascx" TagName="CheckAllCheckBoxControl"
    TagPrefix="uc1" %>
<uc4:ResultMessageControl ID="ResultMessageControl1" runat="server" />
<uc3:SpecialOfferNavControl ID="SpecialOfferNavControl1" runat="server"></uc3:SpecialOfferNavControl>
<div class="dialog-title">
    <asp:Label ID="lblDialogTitle" runat="server" Text="设置条件"></asp:Label>
</div>
<div class="dialog-box">
    <div id="radioButtonList">
        <asp:RadioButtonList ID="rblConditons" runat="server" AutoPostBack="true" RepeatColumns="4"
            RepeatDirection="Horizontal">
            <asp:ListItem Value="0">顾客购买一件或者多件某种商品</asp:ListItem>
            <asp:ListItem Value="1">订单的总金额超过某某金额</asp:ListItem>
            <%--    <asp:ListItem Value="2" Enabled="False">顾客是某某等级的会员</asp:ListItem>--%>
            <asp:ListItem Value="3">顾客的会员积分达到某某分</asp:ListItem>
            <%--<asp:ListItem Value="4" Enabled="False">顾客的送货地点是某某地区</asp:ListItem>--%>
        </asp:RadioButtonList>
    </div>
    <div class="blankbox">
    </div>
    <div id="title">
        <asp:Label ID="lbSetupTitle" runat="server" Text="参数设置"></asp:Label>
    </div>

    <div id="multiview">
        <asp:MultiView ID="mvConditions" runat="server">
            <asp:View ID="vCertainProduts" runat="server">
                <div class="grid">
                    <asp:GridView ID="gvCertainProducts" runat="server" AllowPaging="true" AutoGenerateColumns="False"
                        BorderColor="White" DataKeyNames="ID" EmptyDataText="范围:全部商品" Width="100%">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbSelect" runat="server" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderStyle Width="25px" HorizontalAlign="Center" />
                                <HeaderTemplate>
                                    <uc1:CheckAllCheckBoxControl ID="CheckAllCheckBoxControl1" runat="server" Prefix="cbSelect" />
                                </HeaderTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="商品或者类别">
                                <ItemTemplate>
                                    <asp:HiddenField ID="hfCategoryID" runat="server" Value='<%#Eval("CategoryID")%>' />
                                    <asp:HiddenField ID="hfProductID" runat="server" Value='<%#Eval("ProductID")%>' />
                                    <asp:Label ID="lbCategoryName" runat="server" Text='<%#Eval("CategoryName")%>'></asp:Label>
                                    <asp:Label ID="lbProductName" runat="server" Text='<%#Eval("ProductName")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="数量">
                                <ItemStyle Width="30px" />
                                <ItemTemplate>
                                    <asp:TextBox ID="txtQty" runat="server" MaxLength="4" Text='<%#Eval("Quantity")%>'
                                        Width="30px"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div class="blankbox">
                </div>
                <div class="row">
                    <asp:Button ID="btnDeleteProducts" runat="server" Text="删除选中" />
                    <asp:Button ID="btnUpdateProducts" runat="server" Text="更新" Width="75px" />
                </div>

                <script language="javascript" type="text/javascript">
function selectionChanged(type) {

	var p = document.getElementById('spanProduct');
	var c = document.getElementById('spanCategory');
	
	if (type =="p")
	{		p.style.display = '';
			c.style.display = 'none';
			document.cookie = 'specialOffer_Condition_isShowProduct=' + escape('true')+';';
	}
	else
	{	p.style.display = 'none';
		c.style.display = '';
		document.cookie = 'specialOffer_Condition_isShowProduct=' + escape('false')+';';
	}



}


  //*********获取指定的Cookie的值***********
function getCookie(cookieName) {
  var cookieString = document.cookie;
  var start = cookieString.indexOf(cookieName + '=');
  // 加上等号的原因是避免在某些 Cookie 的值里有
  // 与 cookieName 一样的字符串。
  if (start == -1) // 找不到
    return null;
  start += cookieName.length + 1;
  var end = cookieString.indexOf(';', start);
  if (end == -1) return unescape(cookieString.substring(start));
  return unescape(cookieString.substring(start, end));
}
//******************保持上一次的状态***********************************
function SaveState(CookieName){ 
     
   if (getCookie(CookieName)=='false'){
         document.getElementById("rdCategory").checked="true"
   selectionChanged("c")
   }  
   if (getCookie(CookieName)=='true'){
  document.getElementById("rdProduct").checked="true"
    selectionChanged("p")
   }
}
                </script>

                <div class="blankbox">
                </div>
                <div style="margin-left: 10px">
                    <div id="title">
                        <asp:Label ID="lbAddProductOrCategory" runat="server" Text="添加商品或者类别"></asp:Label></div>
                    <div class="hr">
                    </div>
                    <div>
                        <input id="rdProduct" type="radio" onclick='selectionChanged("p")' checked="checked"
                            name="xxGroup" /><label for="rdProduct">商品</label>
                        <input id="rdCategory" onclick='selectionChanged("c")' type="radio" name="xxGroup" />
                        <label for="rdCategory">
                            类别</label>
                    </div>
                    <div>
                        <span id="spanProduct">
                            <uc2:ChooseProductsControl ID="ChooseProductsControl1" runat="server" />
                        </span><span id="spanCategory" style="display: none;">选择分类:&nbsp;<asp:DropDownList
                            ID="ddlCategory" runat="server">
                        </asp:DropDownList>
                            <asp:Button ID="btnAddCategory" runat="server" Text="添加分类" Width="85px" />
                        </span>
                    </div>
                </div>

                <script type="text/javascript" language="javascript">SaveState("specialOffer_Condition_isShowProduct")</script>

            </asp:View>
            <asp:View ID="vSubtotalExceed" runat="server">
                <div class="editzone">
                    <p>
                        <asp:Label ID="lbMinSubtotal" runat="server" Text=" 最小金额:" AssociatedControlID="txtMinSubtotal"></asp:Label>
                        <asp:TextBox ID="txtMinSubtotal" runat="server">0.00</asp:TextBox><asp:RegularExpressionValidator
                            ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtMinSubtotal"
                            ErrorMessage="请输入正确的最小金额" ValidationExpression="^\d+(\.\d+)?$" ValidationGroup="Subtotal">*</asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtMinSubtotal"
                            runat="server" ErrorMessage='请输入"最小金额"'>*</asp:RequiredFieldValidator>
                    </p>
                    <p>
                        <asp:Label ID="lbMaxSubtotal" runat="server" Text=" 最大金额:" AssociatedControlID="txtMaxSubtotal"></asp:Label>
                        <asp:TextBox ID="txtMaxSubtotal" runat="server">0.00</asp:TextBox><asp:RegularExpressionValidator
                            ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtMaxSubtotal"
                            ErrorMessage="请输入正确的最大金额" ValidationExpression="^\d+(\.\d+)?$" ValidationGroup="Subtotal">*</asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtMaxSubtotal"
                            runat="server" ErrorMessage='请输入"最大金额"' ValidationGroup="Subtotal">*</asp:RequiredFieldValidator><br />
                        说明: <b>最大金额是0.00时表明没有限制.</b>
                    </p>
                    <div style="margin-left: 125px">
                        <asp:Button ID="btnUpdateSubtotalExceed" runat="server" Text="更新" Width="119px" ValidationGroup="Subtotal" />
                    </div>
                    <asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="Subtotal" DisplayMode="List"
                        runat="server" />
                </div>
            </asp:View>
            <asp:View ID="vMemberShip" runat="server">
                membershio</asp:View>
            <asp:View ID="vBonusPoint" runat="server">
                <div class="editzone">
                    <p>
                        <asp:Label ID="lbMinPoint" runat="server" Text="最小积分:" AssociatedControlID="txtMinPoint"></asp:Label>
                        <asp:TextBox ID="txtMinPoint" runat="server">0.00</asp:TextBox><asp:RegularExpressionValidator
                            ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtMinPoint"
                            ErrorMessage="请输入正确的最小积分" ValidationExpression="^\d+(\.\d+)?$" ValidationGroup="BonusPoint">*</asp:RegularExpressionValidator>
                    </p>
                    <p>
                        <asp:Label ID="lbmaxPoint" runat="server" Text="最大积分:" AssociatedControlID="txtMaxPoint"></asp:Label>
                        <asp:TextBox ID="txtMaxPoint" runat="server">0.00</asp:TextBox><font class="SmallText"><b><asp:RegularExpressionValidator
                            ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtMaxPoint"
                            ErrorMessage="请输入正确的最大积分" ValidationExpression="^\d+(\.\d+)?$" ValidationGroup="BonusPoint">*</asp:RegularExpressionValidator><br />
                            说明</b>: 最大积分是0.00时表明没有限制.</font>
                    </p>
                    <div style="margin-left: 125px;">
                        <asp:Button ID="btnUpdatePoint" runat="server" Text="更新" Width="119px" ValidationGroup="BonusPoint" />
                    </div>
                    <asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="BonusPoint" />
                </div>
            </asp:View>
            <asp:View ID="vSpecificLocation" runat="server">
                Location</asp:View>
        </asp:MultiView>
    </div>
    <div class="blankbox">
    </div>
    <div class="row-middle">
        <asp:Button ID="btnNext" runat="server" Text="下一步(奖励内容)" />
    </div>
</div>
<asp:HiddenField ID="hfOfferID" runat="server" />
<asp:HiddenField ID="hfIsComplete" runat="server" Value="0" />

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?