<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Visit.aspx.cs" Inherits="TotCms.Web.Office.Customer.Visit" %>
<%@ Register assembly="TotCms.Controls" namespace="TotCms.Controls" tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>拜访记录管理</title>    
    <link href="../style/global.css" rel="stylesheet" type="text/css" />
    <link href="../../js/jquery-ui-1.8.10/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../../js/jquery-ui-1.8.10/js/jquery.ui.core.min.js" type="text/javascript"></script>
    <script src="../../js/jquery-ui-1.8.10/js/jquery.ui.widget.min.js" type="text/javascript"></script>
    <script src="../../js/jquery-ui-1.8.10/js/jquery.ui.datepicker.min.js" type="text/javascript"></script>
    <script src="../../js/jquery-ui-1.8.10/js/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
    <script type="text/javascript">
      $(function () {
        $('.dates').datepicker($.datepicker.regional["zh-CN"]);
      });
    </script>
    </head>
<body>
    <form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
     <div class="br"></div>
    <div>
        <table style="width: 100%;" border="0" cellpadding="0" cellspacing="1" class="border">
            <tr class="suphead">
                <td>
                    拜访管理</td>
            </tr>
            <tr>
                <td height="30">公司：<asp:TextBox ID="tbTitle" runat="server"></asp:TextBox>
&nbsp;拜访方式：<asp:RadioButtonList ID="rbBy" runat="server" RepeatDirection="Horizontal" 
                    RepeatLayout="Flow">
                    <asp:ListItem>电话</asp:ListItem>
                    <asp:ListItem>短信</asp:ListItem>
                    <asp:ListItem>登门</asp:ListItem>
                  </asp:RadioButtonList>
                  日期 从：<asp:TextBox ID="tbStartDate" runat="server" CssClass="dates"></asp:TextBox>
                    到：<asp:TextBox ID="tbEndDate" runat="server" CssClass="dates"></asp:TextBox>
                    <asp:Button ID="btnGo" runat="server" Text="查询" onclick="btnGo_Click" />                
                
                </td>
            </tr>
        </table>
    </div>
    <div class="br"></div>
    <div><img class="style1" src="../images/plus.png" height="16" /> <a href='Visit_Edit.aspx?comid=<%=_comid%>'>新增拜访</a></div>
    <div>
        <asp:ListView ID="lvList" runat="server" ItemPlaceholderID="items" OnItemCommand="lvList_ItemCommand" OnItemDataBound="lvList_ItemDataBound" DataKeyNames="id">
            <LayoutTemplate>
                <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border">
                    <tr class="suphead">
                        <td width="3%">
                            <asp:CheckBox ID="cbSelect" runat="server" OnCheckedChanged="CbSelectChanged" AutoPostBack="true" />
                        </td>
                        <td width="25%">
                            公司名称
                        </td>
                        <td style="text-align:left; padding-left:5px;">
                            拜访者
                        </td>
                        <td width="8%">
                            拜访方式
                        </td>    
                        <td style="text-align:left; padding-left:5px;">内容</td>                    
                        <td width="15%">
                            时间
                        </td>

                        <td width="15%">
                            操作
                        </td>
                    </tr>
                    <asp:PlaceHolder runat="server" ID="items"></asp:PlaceHolder>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr class="lines">
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:CheckBox ID="ChkId" runat="server" Checked="false" />
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="BtnSelect" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                        <asp:TextBox ID="ChkTxt" runat="server" CssClass="hidden" Text='<%# Eval("id") %>'></asp:TextBox>
                    </td>
                    <td>
                        <%# Eval("ComName")%>
                    </td>
                    <td style="text-align:left; padding-left:5px;">
                        <%# Eval("UserName")%>
                    </td>
                    <td>
                        <%# Eval("VisitBy")%>
                    </td> 
                    <td style="text-align:left; padding-left:5px;">
                        <%#Eval("Content")%>
                    </td>                   
                    <td>
                        <%#FormatDate(Eval("PubDate"))%>
                    </td>
                    <td>   
                    <a href='Visit_Edit.aspx?id=<%# Eval("id") %>&comid=<%# Eval("CustomerId") %>'>编辑</a>
                        <asp:LinkButton ID="LinkButton1" OnLoad="Delete_Load" runat="server" CommandName="deleteobj"
                            CommandArgument='<%# Eval("id") %>'>删除</asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <EmptyDataTemplate>
                <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border">
                    <tr class="suphead">
                        <td>
                           暂时没有数据
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
        </asp:ListView>
        <div align="center">
            <asp:Button ID="BtnSelect" runat="server" Text="全选" OnClick="BtnSelect_Click" />
            <asp:DropDownList ID="BatRunType" runat="server">
                <asp:ListItem Text="批量删除" Value="delete"></asp:ListItem>
            </asp:DropDownList>
            <asp:Button ID="BtnRun" runat="server" Text="执行操作" OnClick="BtnRun_Click" OnClientClick="return confirm('确定执行吗?')" />
        </div>
        <cc1:Pager ID="Pager1" runat="server" GenerateFirstLastSection="True" 
      GenerateGoToSection="True" GenerateHiddenHyperlinks="False" 
      QueryStringParameterName="CurrentPage" OnCommand="pager_Command" 
      GoToStyle="text" OfClause="/" PageClause="页" PageSize="15" />
    </div>
    </form>
</body>
</html>
