<%@ Page Title="" Language="C#" MasterPageFile="~/BackStage/HelperMaster.Master" AutoEventWireup="true" CodeBehind="Frm_AddSimpleCusBaiFang.aspx.cs" Inherits="AndroidSevice.Web.BackStage.XDGL.Frm_AddSimpleCusBaiFang" %>
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function sAlert(info) {
            var message = info;
            layer.alert(message, { closeBtn: 0
            }, function () {
                parent.location.reload(); //刷新父页面
            });
        }
        function sAlertO(info) {
            var message = info;
            layer.alert(message, 8); //风格一，layer弹出层特效
        }
        function sAlertOut(info) {
            layer.alert(info, { closeBtn: 0
            }, function () {
                window.location.href = '../../default.aspx'; //刷新父页面
            });
        }
        function ShowDataHelp(_url, _title, _handler) {
             var select1 = document.all.<%= dropUser.ClientID %>;
                var etypeid = select1.options[select1.selectedIndex].value; 
                var name= select1.options[select1.selectedIndex].text;

            var strdate = document.getElementById("strdate").value;
            var enddate = document.getElementById("endate").value;
            if (name == "") {
                alert("请选择业务员！");
                return;
            }
            _url = _url + "id=" + etypeid + "&name=" + name + "&strdate=" + strdate + "&enddate=" + enddate;
            layer.open({
                type: 2,
                area: ['800px', '600px'],
                fix: false, //不固定
                maxmin: true,
                content: _url,
                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">
                                <asp:HiddenField ID="HiddenField1" runat="server" Visible="false" />
                                <asp:HiddenField ID="HiddenField2" runat="server" Visible="false" />
                                </div>

                            </div>
							<div class="widget-content2">
                             <table id="query" class="table table-bordered table-striped table-hover">
                                    <tbody>
                                    <tr>
										<td>
                                            <span>业务员：
                                            <asp:DropDownList ID="dropUser" runat="server" >
                                            </asp:DropDownList>
                                            </span>
                                        </td>
                                        <td><span>日期段：</span><span>
                                            <input type="text" style="width:100px" class="inputwidth" onFocus="WdatePicker({isShowClear:false,readOnly:true})" name="strdate" id="strdate" value="<%=_strDate %>"/></span>
                                            <span>
                                            <input type="text" style="width:100px" class="inputwidth" onFocus="WdatePicker({isShowClear:false,readOnly:true})"  name="endate" id="endate" value="<%=_endDate %>"/></span>
                                        </td>
                                        <td>
                                            <a href="#"><button type="submit" value="save" name="save" class="btn" >保存</button></a>
                                        </td> 
									</tr>
                                    </tbody>
							 </table>
                                    <button type="button" onclick=ShowDataHelp('Frm_SimpleCustomerBtype.aspx?','','') class="btn" ><i class="icon-plus"></i>选择客户</button>
                                    <button type="button" onclick=ShowDataHelp('Frm_AddSimpleOptCusLode.aspx?','','') class="btn" ><i class="icon-plus"></i>按线路选择客户</button>
                             <table id="wew" class="table table-bordered table-striped table-hover">
                                    <thead>
										<tr>
                                            <th style=" width:30px">序号</th>
											<th>拜访顺序</th>
											<th>客户编号</th>
                                            <th>客户名称</th>
                                            <th>地区</th>
                                            <th>地址</th>
                                            <th>操作</th>
										</tr>
									</thead>
                                    <tbody>
                                    <%
                                        if (dtList != null && dtList.Rows.Count != 0)
                                        {
                                            for (int i = 0; i < dtList.Rows.Count; i++)
                                            {
                                        %>
                                    <tr>
                                            <td style=" width:30px"><%=i + 1%></td>
											<td><%=dtList.Rows[i]["sort"].ToString()%></td>
                                            <td><%=dtList.Rows[i]["UserCode"].ToString()%></td>
                                            <td><%=dtList.Rows[i]["CustomerName"].ToString()%></td>
                                            <td><%=dtList.Rows[i]["area"].ToString()%></td>
                                            <td><%=dtList.Rows[i]["Address"].ToString()%></td>
                                            <td>
                                            <button type="button" onclick="javaScript:if(confirm('您确定要删除吗？')) window.location.href='Frm_AddSimpleCusBaiFang.aspx?del=del&Billid=<%=dtList.Rows[i]["Billid"].ToString()%>&cid=<%=dtList.Rows[i]["customerid"].ToString()%>&strdate=<%=dtList.Rows[i]["billdate"].ToString() %>&endate=<%=dtList.Rows[i]["enddate"].ToString() %>&etypeid=<%=dtList.Rows[i]["etypeid"].ToString() %>&num=<%=dtList.Rows[i]["num"].ToString()%>'" class="btn">删除</button>
                                            </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>
    </div>
</asp:Content>

