<%@ Page Title="" Language="C#" MasterPageFile="~/BackStage/HelperMaster.Master" AutoEventWireup="true" CodeBehind="Frm_AddTimePromotion.aspx.cs" Inherits="AndroidSevice.Web.WLTGL.Frm_AddTimePromotion" %>
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function ShowDataHelp(_url, type, _handler) {
            var name = document.getElementById("cxdName").value;
            var comment = document.getElementById("comment").value;
            var code = document.getElementById("djCode").value;
            var sdate = document.getElementById("strdateCX").value;
            var edate = document.getElementById("endateCX").value;
            var stime = document.getElementById("strdatename").value;
            var etime = document.getElementById("enddatename").value;
            var dateLD = document.getElementById("dateLD").value;
            layer.open({
                type: 2,
                area: ['85%', '85%'],
                fix: false, //不固定
                maxmin: true,
                content: _url + "name=" + name + "&comment=" + comment + "&code=" + code + "&sdate=" + sdate + "&edate=" + edate + "&stime=" + stime + "&etime=" + etime + "&dateLD=" + dateLD,
                end: function () {
                    location.reload();
                }
            });
        }
        function sAlert(info) {
            var message = info;
            layer.alert(message, 8); //风格一，layer弹出层特效
        }

        function SelectAll() {
            var checkboxs = document.getElementsByName("Btypecheck");
            for (var i = 0; i < checkboxs.length; i++) {
                var e = checkboxs[i];
                e.checked = !e.checked;
            }
        }
        function sAlertok(info) {
            layer.alert(info, { closeBtn: 0
            }, function () {
                parent.location.reload(); //刷新父页面
            });
        }
        function sAlertOut(info) {
            layer.alert(info, { closeBtn: 0
            }, function () {
                window.location.href = '../../default.aspx'; //刷新父页面
            });
        }

        function ShowDataHelpSet(_url, _title, _handler) {
            var name = document.getElementById("cxdName").value;
            var comment = document.getElementById("comment").value;
            var code = document.getElementById("djCode").value;
            var sdate = document.getElementById("strdateCX").value;
            var edate = document.getElementById("endateCX").value;
            var stime = document.getElementById("strdatename").value;
            var etime = document.getElementById("enddatename").value;
            layer.open({
                type: 2,
                area: ['75%', '80%'],
                fix: false, //不固定
                maxmin: true,
                content: _url + "name=" + name + "&comment=" + comment + "&code=" + code + "&sdate=" + sdate + "&edate=" + edate + "&stime=" + stime + "&etime=" + etime ,
                end: function () {
                    location.reload();
                    }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon">
							<i class="icon-th-list"></i>
						</span>
						<h5>时段促销</h5>
                         <div class="buttons">
                         <button type="submit" name="sub" value="sub" class="btn" ><i class="icon-hdd"></i>保存</button>
                         <asp:HiddenField ID="HiddenField1" runat="server" />
                         </div>
					</div>
					<div class="widget-content2 ">
                        <table class="table table-bordered table-striped table-hover">
							<tbody>
                                <tr>
                                    <td>
                                        时段促销单名称：<input type="text" name="cxdName" id="cxdName" style=" width:340px" value="<%=_cxdName %>"/>
                                        &nbsp;&nbsp;录单时间：
                                        <input type="text" class="inputwidth" style=" width:90px"  disabled="disabled" onFocus="WdatePicker({isShowClear:false,readOnly:true})" name="dateLD" id="dateLD" value="<%=_dateLD %>"/>
                                        &nbsp;&nbsp;单据编号：<input type="text" name="djCode" id="djCode" style=" width:180px" value="<%=_djCode %>" disabled="disabled"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        促销日期：
                                        <input type="text" class="inputwidth" style=" width:90px" onFocus="WdatePicker({isShowClear:false,readOnly:true})" name="strdateCX" id="strdateCX" value="<%=_strDateCX %>"/>
                                        <input type="text" class="inputwidth" style=" width:90px" onFocus="WdatePicker({isShowClear:false,readOnly:true})"  name="endateCX" id="endateCX" value="<%=_endDateCX%>"/>
                                        &nbsp;&nbsp;摘要：<input type="text" name="comment" id="comment" style=" width:400px" value="<%=_comment %>"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td>促销周期：
                                        <asp:CheckBox ID="CheckBox1"  runat="server"  />周一
                                        <asp:CheckBox ID="CheckBox2"  runat="server"  />周二
                                        <asp:CheckBox ID="CheckBox3"  runat="server"  />周三
                                        <asp:CheckBox ID="CheckBox4"  runat="server"  />周四
                                        <asp:CheckBox ID="CheckBox5"  runat="server"  />周五
                                        <asp:CheckBox ID="CheckBox6"  runat="server"  />周六
                                        <asp:CheckBox ID="CheckBox7"  runat="server"  />周日

                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                        开始时间：
                                        <input type="text" style=" width:90px" onFocus="WdatePicker({isShowClear:false,readOnly:true,dateFmt:'HH:mm:ss'})"  name="strdatename" id="strdatename" value="<%=_strdatename %>"/>
                                        结束时间：
                                        <input type="text" style=" width:90px" onFocus="WdatePicker({isShowClear:false,readOnly:true,dateFmt:'HH:mm:ss'})"  name="enddatename" id="enddatename" value="<%=_enddatename %>"/>
                                    </td>
                                </tr>
							</tbody>
						</table>
                    </div>
                    
                    <div class="row-fluid">
                         <div class="span6" style="width:60%">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-arrow-right"></i>
								</span>
								<h5>促销商品</h5>
                                <div class="buttons">
                                    <button type="button" onclick=ShowDataHelpSet('Frm_SetPrice.aspx?num=n&','','') class="btn btn-mini" >批量设置价格</button>
									<button type="button"  name="sub" value="add" onclick=ShowDataHelp('Frm_AddPtypeData.aspx?','','') class="btn btn-mini" ><i class="icon-plus-sign"></i>选择促销商品</button>
								</div>
							</div>
							<div class="widget-content nopadding">
								<table id="wew" class="table table-bordered table-striped table-hover">
                                        <thead>
								            <tr>
									            <th style=" width:20px">序号</th>
									            <th>商品编号</th>
                                                <th>商品全名</th>
                                                <th>单位</th>
                                                <th>促销价格</th>
                                                <th>单据备注</th>
                                                <th>设置</th>
									            <th>删除</th>
								            </tr>
							            </thead>
                                        <tbody>
                                        <%
                                            if (dtPType != null && dtPType.Rows.Count != 0)
                                            {
                                                for (int i = 0; i < dtPType.Rows.Count; i++)
                                                {
                                            %>
                                        <tr>
                                            <td style=" width:20px"><%=i+1 %></td>
									        <td><%=dtPType.Rows[i]["UserCode"].ToString()%></td>
                                            <td><%=dtPType.Rows[i]["FullName"].ToString()%></td>
                                            <td><%=dtPType.Rows[i]["UnitName"].ToString()%></td>
                                            <td><%=dtPType.Rows[i]["price"].ToString()%></td>
                                            <td><%=dtPType.Rows[i]["comment"].ToString()%></td>
                                            <td>
                                                <button type="button" onclick=ShowDataHelpSet('Frm_PromotionSet.aspx?bid=<%=dtPType.Rows[i]["billnumberid"].ToString() %>&id=<%=dtPType.Rows[i]["TypeID_"].ToString() %>&','','') class="btn btn-mini" >设置</button>
                                            </td>
                                            <td>
                                                <a ><button type="button" class="btn" onclick="javaScript:if(confirm('您确定要删除吗？')) window.location.href='Frm_AddTimePromotion.aspx?del=del1&cbradios=<%=_cbradios %>&id1=<%=dtPType.Rows[i]["TypeID_"].ToString() %>&num=<%=dtPType.Rows[i]["nub"].ToString() %>&name=<%=_cxdName %>&comment=<%=_comment %>&code=<%=_djCode %>&sdate=<%=_strDateCX %>&edate=<%=_endDateCX %>&stime=<%=_strdatename %>&etime=<%=_enddatename %>&ldDate=<%=_dateLD %>'">删除</button></a>
                                           </td>
							            </tr>
                                            <%
                                                }
                                            }
                                                %>
                                        </tbody>
					            </table>
							
                             <div class="pager">
                                <webdiyer:aspnetpager ID="AspNetPager1" runat="server" FirstPageText="首页"  LastPageText="尾页" 
                                    PrevPageText="上一页" NextPageText="下一页"  onpagechanging="AspNetPager1_PageChanging" PageSize="10" AlwaysShow="True" />
					        </div>
                            </div>
						</div>
                       
                        </div>
                        <div class="span6" style="width:36%">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-arrow-right"></i>
								</span>
								<h5>不适用客户</h5>
                                 <div class="buttons">
									<button type="button" onclick=ShowDataHelp('Frm_AddCustomerData.aspx?','','') class="btn btn-mini" ><i class="icon-plus-sign"></i>选择不适用客户</button>
								</div>
							</div>
							<div class="widget-content nopadding">
                                <table id="Table1" class="table table-bordered table-striped table-hover">
                                    <thead>
								        <tr>
									        <th style=" width:20px">序号</th>
									        <th>单位编号</th>
                                            <th>单位全名</th>
									        <th>删除</th>
								        </tr>
							        </thead>
                                    <tbody>
                                    <%
                                        if (dtCustomer != null && dtCustomer.Rows.Count != 0)
                                        {
                                            for (int i = 0; i < dtCustomer.Rows.Count; i++)
                                            {
                                        %>
                                    <tr>
                                        <td style=" width:20px"><%=i+1 %></td>
									    <td><%=dtCustomer.Rows[i]["UserCode"].ToString()%></td>
                                        <td><%=dtCustomer.Rows[i]["bFullName"].ToString()%></td>
                                        <td style="text-align:center">
                                           <a ><button type="button" class="btn" onclick="javaScript:if(confirm('您确定要删除吗？')) window.location.href='Frm_AddTimePromotion.aspx?del=del2&cbradios=<%=_cbradios %>&id2=<%=dtCustomer.Rows[i]["btypeId"].ToString() %>&name=<%=_cxdName %>&comment=<%=_comment %>&code=<%=_djCode %>&sdate=<%=_strDateCX %>&edate=<%=_endDateCX %>&stime=<%=_strdatename %>&etime=<%=_enddatename %>&ldDate=<%=_dateLD %> '">删除</button></a>
                                        </td>
							        </tr>
                                        <%
                                            }
                                        }
                                            %>
                                    </tbody>
					        </table>
                            </div>
						</div>
                        <div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-arrow-right"></i>
								</span>
								<h5>不适用仓库</h5>
                                <div class="buttons">
									<button type="button" onclick=ShowDataHelp('Frm_AddStockData.aspx?','','') class="btn btn-mini" ><i class="icon-plus-sign"></i>选择不适用仓库</button>
								</div>
							</div>
							<div class="widget-content nopadding">
								<table id="Table3" class="table table-bordered table-striped table-hover">
                                        <thead>
								            <tr>
									            <th style=" width:20px">序号</th>
									            <th>仓库编号</th>
                                                <th>仓库全名</th>
									            <th>删除</th>
								            </tr>
							            </thead>
                                        <tbody>
                                        <%
                                            if (dtStock != null && dtStock.Rows.Count != 0)
                                            {
                                                for (int i = 0; i < dtStock.Rows.Count; i++)
                                                {
                                            %>
                                        <tr>
                                            <td style=" width:20px"><%=i+1 %></td>
									        <td><%=dtStock.Rows[i]["usercode"].ToString()%></td>
                                            <td><%=dtStock.Rows[i]["bfullname"].ToString()%></td>
                                            <td>
                                                <a ><button type="button" class="btn" onclick="javaScript:if(confirm('您确定要删除吗？')) window.location.href='Frm_AddTimePromotion.aspx?del=del3&cbradios=<%=_cbradios %>&id3=<%=dtStock.Rows[i]["TypeID"].ToString() %>&name=<%=_cxdName %>&comment=<%=_comment %>&code=<%=_djCode %>&sdate=<%=_strDateCX %>&edate=<%=_endDateCX %>&stime=<%=_strdatename %>&etime=<%=_enddatename %>&ldDate=<%=_dateLD %> '">删除</button></a>
                                            </td>
							            </tr>
                                            <%
                                                }
                                            }
                                                %>
                                        </tbody>
					            </table>
							</div>
						</div>
                        <div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-arrow-right"></i>
								</span>
								<h5>不适用业务员</h5>
                                 <div class="buttons">
									<button type="button" onclick=ShowDataHelp('Frm_AddETypeData.aspx?','','') class="btn btn-mini" ><i class="icon-plus-sign"></i>选择不适用业务员</button>
								</div>
							</div>
							<div class="widget-content nopadding">
                                <table id="Table2" class="table table-bordered table-striped table-hover">
                                        <thead>
								            <tr>
									            <th style=" width:20px">序号</th>
									            <th>业务员编号</th>
                                                <th>业务员名称</th>
									            <th>删除</th>
								            </tr>
							            </thead>
                                        <tbody>
                                        <%
                                            if (dtEType != null && dtEType.Rows.Count != 0)
                                            {
                                                for (int i = 0; i < dtEType.Rows.Count; i++)
                                                {
                                            %>
                                        <tr>
                                            <td style=" width:20px"><%=i+1 %></td>
									        <td><%=dtEType.Rows[i]["usercode"].ToString()%></td>
                                            <td><%=dtEType.Rows[i]["fullname"].ToString()%></td>
                                            <td style="text-align:center">
                                               <a ><button type="button" class="btn" onclick="javaScript:if(confirm('您确定要删除吗？')) window.location.href='Frm_AddTimePromotion.aspx?del=del4&cbradios=<%=_cbradios %>&id4=<%=dtEType.Rows[i]["eTypeID"].ToString() %>&name=<%=_cxdName %>&comment=<%=_comment %>&code=<%=_djCode %>&sdate=<%=_strDateCX %>&edate=<%=_endDateCX %>&stime=<%=_strdatename %>&etime=<%=_enddatename %>&ldDate=<%=_dateLD %> '">删除</button></a>
                                            </td>
							            </tr>
                                            <%
                                                }
                                            }
                                                %>
                                        </tbody>
					            </table>
                            </div>
						</div>
                        </div>
                    </div>
				</div>
			</div>
		</div>
	</div>
</asp:Content>

