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

<!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="../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/jquery/jquery-1.8.3.min.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" />
    <script src="../scripts/My97DatePicker/lang/zh-cn.js" type="text/javascript"></script>
    <link href="../images/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function CloseThis() {
            var dialog = frameElement.dialog;
            parent.LoadPlanList();
            dialog.close();
        }
        var pagerlist;
        function LoadPagerList() {
            var key = escape(document.getElementById("txtPagerName").value);
            pagerlist = $("#divPagerList").ligerGrid({
                height: 200,
                width: 470,
                columns: [
                { display: '试卷名称', width: '200', name: '_f_title' },
                { display: '问题数量', width: '60', name: '_f_times', render: function (rowdata, rowindex, value) {
                    return "<font color='red'>" + value + "</font>";
                }
                },
                { display: '生成时间', width: '150', name: '_f_createon', type: 'date', format: 'yyyy-MM-dd hh:mm:ss' }
                ],
                url: '../askmanage/ajax/pagerinfo.ashx?action=getlist&key=' + key, pageSize: 10, pageSizeOptions: [10, 20, 50], rownumbers: true,
                onDblClickRow: function (data, rowindex, rowobj) {
                    sflag = false;
                    var vid = "0";
                    var vname = "";
                    try {
                        vid = data._f_pagerid;
                        vname = data._f_title;
                        document.getElementById("txtPagerId").value = vid;
                        document.getElementById("txtPagerName").value = vname;
                    }
                    catch (e) {
                    }
                    document.getElementById("divPagerList").style.display = "none";
                    document.getElementById("imgBack").style.display = "none";
                }
            });
        }
        function validate() {
            var i = 0;
            if (!validate_name()) {
                i++;
            }

            if (i > 0) {
                return false;
            }
            return true;
        }
        function validate_name() {
            if ($("#TaskName").val() == "" || $("#TaskName").val() == undefined) {
                document.getElementById("lbTaskName").innerHTML = "* 名称不为空！";
                document.getElementById("lbTaskName").style.color = "red";
                return false;
            }
            else {
                document.getElementById("lbTaskName").innerHTML = "*";
                document.getElementById("lbTaskName").style.color = "#414141";
                return true;
            }
        }
        var sflag = true;
        $(function () {
            LoadPagerList();
        });
        function SelectPager() {
            sflag = true;
            document.getElementById("divPagerList").style.display = "block";
            document.getElementById("imgBack").style.display = "block";
            LoadPagerList();
        }
        function ChangeFlag() {
            sflag = true;
        }
        function HideList() {
            document.getElementById("divPagerList").style.display = "none";
            document.getElementById("imgBack").style.display = "none";
        }
        function ChangeKey() {
            if (sflag) {
                if (document.getElementById("txtPagerName").value == "") {
                    document.getElementById("txtPagerId").value = "0";
                    document.getElementById("divPagerList").style.display = "none";
                    document.getElementById("imgBack").style.display = "none";
                }
                else {
                    document.getElementById("divPagerList").style.display = "block";
                    document.getElementById("imgBack").style.display = "block";
                    LoadPagerList();
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server"><div id="divPagerList" style="display:none; position:absolute; z-index:9999; top:80px; left:5px; width:470px; height:200px;"></div>
    <div id="contentTab">
        <asp:HiddenField ID="txtId" Value="0" runat="server" />
        <div class="tab_con" style="display: block; ">
            <table class="form_table">
                <col width="100px" />
                <col />
                <tbody>           
                    <tr>
                        <th>
                        <span style="color:red"> 计划名称：</span>
                        </th>
                        <td>
                            <asp:TextBox ID="TaskName" runat="server" Width="200px" CssClass="txtInput normal" ></asp:TextBox><label
                                id="lbTaskName" for="TaskName"></label>
                        </td>
                    </tr> 
                    <tr>
                        <th>
                        <span style="color:red;"> 调查问卷：</span>
                        </th>
                        <td>
                            <div style="float: left;">
                                <asp:HiddenField ID="txtPagerId" runat="server" Value="0" />
                                <asp:TextBox ID="txtPagerName" runat="server" CssClass="txtInput normal" onPropertyChange="ChangeKey();" Style="width: 200px;"></asp:TextBox></div>
                            <div style="float: left; padding-top: 2px;">
                                <img src="../images/btn_off_lookup.gif" onclick="SelectPager();" title="选择调查问卷" style="cursor: pointer;" /></div>
                                <div style="float: left; padding-top: 2px; padding-left:10px;">
                                <img id="imgBack" src="../images/Arrow_left_16.png" onclick="HideList();" title="返回" style="cursor: pointer;display:none;" /></div>
                        </td>
                    </tr> 
                </tbody>
            </table>
        </div>
        <div class="foot_btn_box">
            <asp:Button ID="btnSubmit" runat="server" Text="保&nbsp;&nbsp;存" CssClass="btnSubmit"
                OnClientClick="return validate();"  OnClick="btnSubmit_Click" />
        </div>
    </div>
    </form>
</body>
</html>
