<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="faxcustomer.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.faxmanage.faxcustomer" %>

<!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 runat="server">
    <title>客户导入</title>
    <link href="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../scripts/ui/json2.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
    <link href="../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
    <link href="../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/ui/js/plugins/ligerGrid.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerLayout.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerTree.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerMenu.js" type="text/javascript"></script>
    <script src="../scripts/CustomersData.js" type="text/javascript"></script>
    <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="../images/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        var singleClick;
        $(function () {
            InitList();
        });
        var gridlist;
        function InitList() {
            var sql = GetSql();
            gridlist = $("#divDataList").ligerGrid({
                checkbox: true,
                height: '85%',
                columns: [
                { display: '客户Id', name: '_f_customerid', hide: "false", width: '1%' },
                { display: '客户编号', name: '_f_customercode', align: 'left', width: 150 },
                { display: '客户名称', name: '_f_customername', width: 200 },
                { display: '传真', name: '_f_fax', width: 200 }
                ],
                url: '../customermanage/ajax/customer.ashx?action=getcustomerlist' + sql, pageSize: 10, rownumbers: true,
                onSelectRow: function (data, rowindex, rowobj) {
                }

            });
            gridlist.changePage('first');
            $("#pageloading").hide();
        }
        function GetSql() {
            var sql = "";
            if (document.getElementById("txtKey").value != "") {
                sql += "&key=" + escape(document.getElementById("txtKey").value);
            }
            return sql;
        }

        function GetCheckBoxId() {
            var rows = gridlist.getSelectedRows();
            if (rows.length > 0) {
                try {
                    var arr = new Array();
                    var i = 0, j = 0;
                    for (var i = 0; i < rows.length; i++) {
                        if (rows[i]._f_fax != "") {
                            arr[j] = rows[i]._f_fax;
                            j++;
                        }

                    }
                    parent.OnInnerCallback(arr);
                    var dialog = frameElement.dialog;
                    dialog.close();
                }
                catch (e) {
                    alert(e.Message);
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="tools_box">
        <div class="tools_bar">
            <div class="search_box">
                关键字：<asp:TextBox ID="txtKey" runat="server" CssClass="txtInput"></asp:TextBox>&nbsp;&nbsp;
                <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="InitList();" />
            </div>
        </div>
    </div>
    <div id="divDataList">
    </div>
    <div style="text-align: center; margin-top: 10px">
        <input id="butSercher" type="button" onclick="GetCheckBoxId();" class="btnSubmit"
            value="确定" style="text-align: center; width: 80px" />
    </div>
    </form>
</body>
</html>
