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

<!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/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>
    <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">
        $(function () {
            LoadList();
        });
        function LoadList() {
            try {
                $.ajax({
                    type: 'get',
                    url: 'ajax/workcalendarset.ashx?action=getcalendarlist&strdate=' + document.getElementById("txtYear").value + "-" + document.getElementById("txtMonth").value + "-01",
                    data: { userid: '' },
                    dataType: 'html',
                    async: false,
                    cache: false,
                    success: function (res) {
                        document.getElementById("divDataItems").innerHTML = res;
                        $("#pageloading").hide();
                    }
                });
            }
            catch (e) {
                alert(e.Message);
            }
        }
        function changeState(e) {
            $.ligerDialog.confirm('确定修改[' + e.id + ']的工作日设置吗?', function (yes) {
                if (yes) {
                    $.ajax({
                        type: "post",
                        url: "ajax/workcalendarset.ashx?action=changworkingday&dateid=" + e.id,
                        async: true,
                        cache: false,
                        success: function (data, states) {
                            if (states == "success") {
                                if (data == "True") {
                                    if (e.color == "#000000" || e.color == "black" || e.color == "Black") {
                                        e.color = "red";
                                    }
                                    else {
                                        e.color = "black";
                                    }
                                }
                            }
                        }
                    });
                }
            });
        }
        function PreYear() {
            var year = document.getElementById("txtYear").value;

            document.getElementById("txtYear").value = parseInt(year) - 1;
            LoadList();
        }
        function NextYear() {
            var year = document.getElementById("txtYear").value;

            document.getElementById("txtYear").value = parseInt(year) + 1;
            LoadList();
        }
        function PreMonth() {
            var year = document.getElementById("txtYear").value;
            var month = document.getElementById("txtMonth").value;
            document.getElementById("txtMonth").value = parseInt(month) - 1;
            if (parseInt(document.getElementById("txtMonth").value) < 1) {
                document.getElementById("txtMonth").value = 12;
                document.getElementById("txtYear").value = parseInt(year) - 1;
            }
            LoadList();
        }
        function NextMonth() {
            var year = document.getElementById("txtYear").value;
            var month = document.getElementById("txtMonth").value;
            document.getElementById("txtMonth").value = parseInt(month) + 1;
            if (parseInt(document.getElementById("txtMonth").value) > 12) {
                document.getElementById("txtMonth").value = parseInt(document.getElementById("txtMonth").value) % 12;
                document.getElementById("txtYear").value = parseInt(year) + 1;
            }
            LoadList();
        }
        function NextMonth1() {
            var strdate = document.getElementById("txtYear").value + "-" + document.getElementById("txtMonth").value + "-01";

            //document.getElementById("txtMonth").value = parseInt(month) + 1;
            LoadList();
        }
    </script>
</head>
<body style="margin: 0px; padding: 0px; overflow: hidden;">
    <form id="form1" runat="server">
    <div class="l-loading" style="display: block" id="pageloading">
    </div>
    <div class="tools_box">
        <div class="tools_bar">
            <div style=" width:100%; text-align:center; padding-top:8px; color:Red; font-size:16px;">红色的为非工作日，点击日期对日期进行设置</div>
        </div>
    </div>
    <div style="width:100%; border:solid 1px #cccccc; height:38px; padding-top:10px; text-align:center;">
    <img src="../images/page_FL1.gif" style=" cursor:pointer;" onclick="PreYear();" alt="上一年" title="上一年" />&nbsp;&nbsp;<img src="../images/page_L1.gif" onclick="PreMonth()" style=" cursor:pointer;" alt="上一月" title="上一月" />&nbsp;&nbsp;<asp:TextBox ID="txtYear" runat="server" CssClass="txtInput" Width="50px" ReadOnly="true" ></asp:TextBox>&nbsp;-&nbsp;<asp:TextBox ID="txtMonth" runat="server" CssClass="txtInput" Width="50px" ReadOnly="true" ></asp:TextBox>&nbsp;<img src="../images/page_R1.gif" onclick="NextMonth();" style=" cursor:pointer;" alt="下一月" title="下一月" />&nbsp;&nbsp;<img src="../images/page_LL1.gif" onclick="NextYear();" style=" cursor:pointer;" alt="下一年" title="下一年" />
    </div>
    <div id="divDataItems" style="width:100%;">
    </div>
    </form>
</body>
</html>
