<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LiveTelecastList.aspx.cs" Inherits="RM.Web.Training.LiveTelecast.LiveTelecastList" %>
<%@ Register Src="~/UserControl/PageControl.ascx" TagName="PageControl" TagPrefix="uc1" %>
<%@ Register Src="~/UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc2" %>
<!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>
    <title>
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("LiveTelecast_Form")%></title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/artDialog/skins/opera.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("LiveTelecast_Form")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="text-align: right">
            <uc2:loadbutton id="LoadButton1" runat="server" />
            <a class="button green" onclick="tiaozhuan();" 
                title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("LiveTelecast_List_ckzb")%>">
                <span class="icon-botton" style="background: url('/Themes/images/16/images.png') no-repeat scroll 0px 4px;">
                </span>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("LiveTelecast_List_ckzb")%></a>
        </div>
    </div>
    <div class="div-body">
        <%=TableHtml  %>
    </div>
    <uc1:pagecontrol id="PageControl1" runat="server" />
    </form>
</body>
<script type="text/javascript">
    $(function () {
        //把分页定位到屏幕下面
        divresize(120);
        FixedTableHeader("#table1", $(window).height() - 121);
    });  
    //跳转
    function tiaozhuan(){
        var arrt = new Array();
        arrt = CheckboxValue().split('|');
        var key = arrt[0];
        if (IsEditdata(CheckboxValue())) {              
            var dataarry = $(".selected").eq(3).html().split($(".selected").eq(3).html().substr(4,1));                
            var m = dataarry[1] < 10? '0' +dataarry[1] : dataarry[1];
            var d = dataarry[2].substr(0,2) <10 ? '0'+dataarry[2].substr(0,2) : dataarry[2].substr(0,2);
            var datanew =  dataarry[0]+'-'+ m +'-' + d;
            window.open('/LiveTelecast/Live_TelecastList.aspx?data='+datanew);   
        }
    }
    //新增
    function add() {
        var url = "/Training/LiveTelecast/LiveTelecastFrom.aspx";
        top.openDialog(url, 'LiveTelecastForm', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("LiveTelecast_Form")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Add")%>', "960px", "450px", 50, 50);
    }
    function edit() {
        var arrt = new Array();
        arrt = CheckboxValue().split('|');
        var key = arrt[0];
        if (IsEditdata(CheckboxValue())) {
            var url = "/Training/LiveTelecast/LiveTelecastFrom.aspx?key=" + key;
            top.openDialog(url, 'LiveTelecastFrom', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("LiveTelecast_Form")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Edit")%>', "960px", "450px", 50, 50);            
        }
    }
    //删除
    function Delete() {
      var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                getAjax("/Training/LiveTelecast/DeleteLive.ashx", "action=delete&key=" + key, function (rs) {
                    location.reload();
                    if (rs == "0") {
                        showTipsMsg("请选择要删除直播！", 2000, 4);                       
                    } else if (rs == "1") {
                        showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CG")%>", 2000, 4);
                    } else if (rs == "2") {
                        showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CG")%>", 2000, 4);
                    } else if (rs == "3") {
                        showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SB")%>", 2000, 4);
                    } else if (rs == "4") {
                        showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SB")%>", 2000, 4);
                    }                    
                    console.log(rs);
                });
            }
    }
</script>
</html>
