<%@ page language="C#" masterpagefile="../ShopMasterPage/MyShopMasterPage.master" inherits="Shop_Member_Shop_ManagePromotion, HoWaveVGO" title="促销方案管理" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  <script type="text/jscript">
     
     function OpenWin(){ 
             var str=window.showModalDialog('Shop_commonpage.aspx',document.getElementById('ctl00_ContentPlaceHolder1_txthidenValue').value,'dialogHeight:600px;dialogWidth:850px;status:no;') ;
          if(str!=null)document.getElementById('ctl00_ContentPlaceHolder1_txthidenValue').value=str ;
          } 
    </script> 
     <table width="100%"  style="FLOAT: none; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: aliceblue" id="TABLE1">
        <tr>
            <td style="height: 14px">
                <span style="font-size: 30px">促销方案管理</span>
                <asp:Button ID="linkeAdd" runat="server" Text="新增加方案信息" CausesValidation="False" BackColor="AliceBlue" BorderStyle="Double" BorderWidth="0px" ForeColor="Blue" OnClick="linkeAdd_Click" /><br />
            </td>
        </tr>
        <tr>
            <td style="height: 232px">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" DataKeyNames="ProjectID" AllowPaging="True" Width="100%">
                 <Columns>
                        <asp:BoundField DataField="ProjectName" HeaderText="方案名称" >
                            <HeaderStyle Width="10%" Wrap="False" />
                        </asp:BoundField>
                     <asp:TemplateField HeaderText="价格区间">
                          
                         <HeaderStyle Width="10%" Wrap="False" />
                         <ItemTemplate>
                             从<asp:Label ID="LabelMinMoney" runat="server" Text='<%# Bind("MinMoney") %>'></asp:Label>至
                  <asp:Label ID="LabelMaxMoney" runat="server" Text='<%# Bind("MaxMoney") %>'></asp:Label>
                         </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="有效期">
                         
                         <HeaderStyle Width="10%" Wrap="False" />
                         <ItemTemplate>
                          从   <asp:Label ID="LabelBeginDate" runat="server" Text='<%# Bind("BeginDate") %>'></asp:Label>到
                  <asp:Label ID="LabelEndDate" runat="server" Text='<%# Bind("EndDate") %>'></asp:Label>
                         </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="有效">
                         <HeaderStyle Width="10%" Wrap="False" />
                         <ItemTemplate>
                             <asp:CheckBox ID="CheckEffective" runat="server" Text="是" />
                         </ItemTemplate>
                     </asp:TemplateField>
                        <asp:BoundField DataField="PresentContent" HeaderText="方案内容" >
                            <HeaderStyle Width="30%" Wrap="False" />
                        </asp:BoundField>
                        <asp:HyperLinkField DataNavigateUrlFields="Projectid" DataNavigateUrlFormatString="?Projectid={0}"
                            HeaderText="修改" Text="修改" >
                            <HeaderStyle Width="7%" Wrap="False" />
                        </asp:HyperLinkField>
                     <asp:CommandField ShowDeleteButton="True" HeaderText="删除" />
                    </Columns>
                </asp:GridView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPromoteProjectSalerID"
                    TypeName="Shop_PromoteProject" UpdateMethod="GetPromoteProjectSalerID" DeleteMethod="DeleteProject">
                    <UpdateParameters>
                        <asp:Parameter Name="SalerID" Type="Int32" />
                    </UpdateParameters>
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="0" Name="SalerID" SessionField="Howave_UserID"
                            Type="Int32" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter Name="ProjectID" Type="Int32" />
                    </DeleteParameters>
                </asp:ObjectDataSource>
                &nbsp;&nbsp;
                <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
                   <%-- <ErrorTemplate>
                        <div style="padding: 12px; width: 400px; height: 140px; border: #000000 1px solid;
                            background-color: white; text-align: left">
                            An error has occurred:<br />
                            <span id="errorMessageLabel" runat="server"></span>
                            <br />
                            <br />
                            <input id="okButton" runat="server" type="button" value="OK" />
                        </div>
                    </ErrorTemplate>--%>
                </asp:ScriptManager>
                <asp:Panel ID="Panel1" runat="server" Visible="false" Width="100%">
        <table border="1" cellpadding="2" cellspacing="1" class="border"  style="FLOAT: none; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: aliceblue" width="100%">
            <tr align="middle">
                <td class="title" colspan="2">
                    <b>
                        <asp:Label ID="Label2" runat="server" Text="添 加 /修　改　方 案 "/></b></td>
            </tr>
            <tr class="tdbg">
                <td  colspan="2" style="height: 44px">
                    <table border="1" cellpadding="2" cellspacing="1" class="border" width="100%" style="border-collapse: collapse">
                        <tr class="tdbg">
                            <td style="width: 100px">
                                方案名称：</td>
                            <td>
                                <input id="ProjectName" maxlength="20" name="ProjectName" runat="server" />
                                <font color="#ff0000">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ProjectName"
                                        ErrorMessage="不能空"></asp:RequiredFieldValidator></font></td>
                        </tr>
                        <tr class="tdbg">
                            <td style="width: 100px">
                                有 效 期：</td>
                            <td>
                                <a onclick='PopCalendar.show(document.myform.EndDate, "yyyy-m-d", null, null, null, "11");'
                                    style="cursor: hand"></a>
                                <table border="1" cellpadding="2" cellspacing="1" class="border" style="float: none;
                                    border-collapse: collapse; background-color: aliceblue" width="100%">
                                    <tr>
                                        <td class="tdbg5" style="width: 579px">
                                            起始日期
                                        </td>
                                        <td class="tdbg5" style="width: 130px">
                                            &nbsp;<asp:UpdatePanel ID="UpdatePanel3" runat="server" >
                                                <ContentTemplate>
                                                    &nbsp;<asp:TextBox ID="TxtBeginDate" runat="server" AutoPostBack="True" ReadOnly="True"
                                                        Width="93px"></asp:TextBox><asp:Button ID="Button1" runat="server" OnClick="Button1_Click1"
                                                            Text="..." Width="17px" />
                                                    <asp:Calendar ID="Calendar2" runat="server" Height="208px" OnSelectionChanged="Calendar2_SelectionChanged"
                                                        Visible="False" Width="0px"></asp:Calendar>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="Calendar2" EventName="SelectionChanged" />
                                                    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                            &nbsp; &nbsp; &nbsp;
                                        </td>
                                        <td class="tdbg5" style="width: 590px">
                                            结束日期</td>
                                        <td class="tdbg5" style="width: 369px">
                                            &nbsp;
                                            <asp:UpdatePanel ID="UpdatePanel2" runat="server" >
                                                <ContentTemplate>
                                                    <asp:TextBox ID="TxtEndDate" runat="server" AutoPostBack="True" ReadOnly="True" Width="94px"></asp:TextBox><asp:Button
                                                        ID="Button2" runat="server" OnClick="Button2_Click" Text="..." Width="17px" />
                                                    <asp:Calendar ID="Calendar1" runat="server" Height="235px" OnSelectionChanged="Calendar1_SelectionChanged"
                                                        Visible="False" Width="1px"></asp:Calendar>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="Calendar1" EventName="SelectionChanged" />
                                                    <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr class="tdbg">
                            <td style="width: 100px">
                                价格区间：</td>
                            <td>
                                <input id="MinMoney" runat="server" maxlength="10" name="MinMoney" size="10" style="text-align: center"
                                    value="100.00" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="MinMoney"
                                    ErrorMessage="不能空"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator6" runat="server" ControlToValidate="MinMoney"
                                    ErrorMessage="格式为数字" MaximumValue="99999999" MinimumValue="0" Type="Double"></asp:RangeValidator><b><font color="#ff0000">≤</font></b> 购物总金额 <b><font color="#ff0000">&lt;</font></b>
                                <input id="MaxMoney" runat="server" maxlength="10" name="MaxMoney" size="10" style="text-align: center"
                                    value="500.00" />
                                &nbsp; &nbsp; 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="MaxMoney"
                                    ErrorMessage="不能空"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator5" runat="server" ControlToValidate="MaxMoney"
                                    ErrorMessage="格式为数字" MaximumValue="99999999" MinimumValue="0" Type="Double"></asp:RangeValidator>
                                <font color="#ff0000">不同促销方案的价格区间必须不同，否则会产生冲突</font></td>
                        </tr>
                        <tr class="tdbg">
                            <td  rowspan="4" style="width: 100px">
                                促销内容：</td>
                            <td>
                                <input id="PresentContent" name="PresentContent" type="checkbox"
                                    value="1" runat="server" />
                                可以
                                <input id="Price" runat="server" maxlength="10" name="Price" size="6" style="text-align: center"
                                    value="10" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="Price"
                                    ErrorMessage="不能空"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="Price"
                                    ErrorMessage="格式为数字" MaximumValue="99999999" MinimumValue="0" Type="Double"></asp:RangeValidator>元超值换购以下商品中任一款：<br />
                                <table border="0" cellpadding="0" cellspacing="5" width="100%">
                                    <tr>
                                        <td style="width: 18px">
                                        </td>
                                        <td width="200">
                                            <asp:UpdatePanel ID="UpdatePanel1"  runat="server">
                                                <ContentTemplate>
                                                    <asp:ListBox ID="ListBox1" runat="server" Height="254px" Width="210px" SelectionMode="single"></asp:ListBox>
                                    
                                                </ContentTemplate>
                              <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="btnOpen" EventName="Click" />
                              <asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" />
                              </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                        <td>
                                            <asp:Button ID="btnOpen" runat="server" Text="添加商品" OnClientClick="OpenWin()"  />&nbsp;
                                            <br />
                                            <input id="txthidenValue" type="text"  runat="server" name="" value="" visible="true" style="border-top-style: none; border-right-style: none; border-left-style: none; border-collapse: collapse; background-color: aliceblue; border-bottom-style: none; color: aliceblue;" size="10" /><br />
                                            <asp:Button ID="Button3" runat="server" Text=" 删  除 " OnClick="Button3_Click2"    />
                                            </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdbg">
                                <input id="Checkbox1" runat="server" name="PresentContent" type="checkbox" value="2" />
                                返还
                                <input id="Cash" runat="server" maxlength="10" name="Cash" size="6" style="text-align: center"
                                    value="20" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="Cash"
                                    ErrorMessage="不能空"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="Cash"
                                    ErrorMessage="格式为数字" MaximumValue="99999999" MinimumValue="0" Type="Double"></asp:RangeValidator>元现金券</td>
                        </tr>
                        <tr>
                            <td class="tdbg" style="height: 28px">
                                <input id="Checkbox2" runat="server" name="PresentContent" type="checkbox" value="3" />
                                可以得到
                                <input id="PresentExp" runat="server" maxlength="9" name="PresentExp" size="6" style="text-align: center"
                                    value="20" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="PresentExp"
                                    ErrorMessage="不能空"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="PresentExp"
                                    ErrorMessage="整数" MaximumValue="99999999" MinimumValue="0" Type="Integer"></asp:RangeValidator>点积分</td>
                        </tr>
                        <tr>
                            <td class="tdbg" style="height: 29px">
                                <input id="Checkbox3" runat="server" name="PresentContent" type="checkbox" value="4" />
                                可以得到
                                <input id="PresentPoint" runat="server" maxlength="9" name="PresentPoint" size="6"
                                    style="text-align: center" value="20" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="PresentPoint"
                                    ErrorMessage="不能空"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="PresentPoint"
                                    ErrorMessage="整数" MaximumValue="99999999" MinimumValue="0" Type="Integer"></asp:RangeValidator>点点券</td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr align="middle" class="tdbg">
                <td colspan="2" height="50">
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp;&nbsp;
                    <asp:Button ID="ButAdd" runat="server" Text="增加" OnClick="Button3_Click" />
                  <asp:Button ID="ButSave" runat="server" Text="修改" OnClick="ButSave_Click" />
                    <asp:Button ID="ButClose" runat="server" Text="关闭" Width="35px" OnClick="ButClose_Click" CausesValidation="False" /></td>
            </tr>
        </table>
        </asp:Panel> 
                <span style="color: #ff0000"></span>
            </td>
        </tr>
    </table>
   
</asp:Content>

