最近写了一个应用策略模式的小程序。实现《大话策略模式》里面的商场收银系统。对里面的接口模式进行了一些改装,使得其更具封闭性。 使用WebForm实现了客户端。先来看看网页部分的主要代码。 <form id="form1" runat="se ...
最近写了一个应用策略模式的小程序。实现《大话策略模式》里面的商场收银系统。对里面的接口模式进行了一些改装,使得其更具封闭性。
使用WebForm实现了客户端。先来看看网页部分的主要代码。
<form id="form1" runat="server"> <div> <asp:TextBox ID="goodsName" runat="server"></asp:TextBox> <asp:TextBox ID="goodsPrice" runat="server"></asp:TextBox> <asp:TextBox ID="goodsNum" runat="server"></asp:TextBox> <asp:DropDownList ID="cbxType" runat="server"> <asp:ListItem Text="正常" Value="正常"></asp:ListItem> <asp:ListItem Text="打8折" Value="打8折"></asp:ListItem> <asp:ListItem Text="满300反100" Value="满300反100"></asp:ListItem> </asp:DropDownList> <asp:Button ID="btnOk" runat="server" Text="录入" OnClick="btnOk_click" /> <br /> <asp:TextBox ID="lbxList" runat="server" TextMode="MultiLine"></asp:TextBox> <%--<asp:Repeater ID="GoodsTable" runat="server"> <HeaderTemplate> <table class="goods"> <tr> <th>商品名称</th> <th>价格</th> <th>数量</th> <th>打折方式</th> <th>总价</th> </tr> </table> </HeaderTemplate> <ItemTemplate> </ItemTemplate> </asp:Repeater>--%> <br /> <asp:Label ID="lblResult" runat="server" Text="Label" EnableViewState="true"></asp:Label> <br /> <asp:Button ID="Button1" runat="server" Text="确认支付?" /> </div> </form>
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:应用接口的策略模式
关键词:接口
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。