<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="B.aspx.cs" Inherits="Maticsoft.Web.Admin.B.B"
    MasterPageFile="~/MasterPage.master" EnableEventValidation="false" Title="期刊管理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script src="../../js/Common.js" type="text/javascript"></script>

    <script src="../../js/mp.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
   function showBtype()
	{
	
	var strUrl="ajax/showB1.aspx?paperName="+escape(document.getElementById("<%=DropDownList1.ClientID %>").value);

		Ajaxs.GET(strUrl,showtypeexist);
		
	}
	function showtypeexist(req)
	{
		var text = req.responseText;
		
		var d = text.split(',');
		
		document.getElementById("<%=DropDownList2.ClientID %>").options.length=0;
        document.getElementById("<%=DropDownList2.ClientID %>").options.add(new Option("全部","全部"));
		
		for (i=0;i<d.length;i++)
		{
		if(d[i]!=""){
		document.getElementById("<%=DropDownList2.ClientID %>").options.add(new Option( d[i],d[i]));
		}
		
		}
		document.getElementById("<%=HiddenField1.ClientID %>").value=document.getElementById("<%=DropDownList2.ClientID %>").value;
	
	}
	function changeqnum()
	{
	document.getElementById("<%=HiddenField1.ClientID %>").value=document.getElementById("<%=DropDownList2.ClientID %>").value;
	}
	function checknum()
	{
	 if(isNaN(document.getElementById("<%=DropDownList2.ClientID %>").value))
	 {
	 alert("请选择期号!");
	 return false; 
	 }
	}
	function checknum1()
	{
	
	 if(document.getElementById("<%=DropDownList2.ClientID %>").value=="")
	 {
	 alert("请选择期号!"); 
	 return false; 
	 }
	}
    </script>

    <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1">
        <tr>
            <td>
                <fieldset>
                    <legend class="tt1">期刊管理</legend>
                    <table>
                        <tr>
                            <td>
                                所属报纸:
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList1" runat="server" onchange="showBtype()">
                                </asp:DropDownList>
                            </td>
                            <td>
                                所属期号:
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList2" runat="server" onchange="changeqnum()">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:Button ID="Button1" runat="server" CssClass="button2" Text="查询" OnClick="Button1_Click"
                                   OnClientClick="return checknum1()"  />
                            </td>
                            <td>
                                <asp:Button ID="Button3" runat="server" CssClass="button2" Text="继续添加" OnClick="Button3_Click"
                                    OnClientClick="return checknum()" />
                            </td>
                            <td>
                                <asp:Button ID="Button2" runat="server" CssClass="button22" Text="删除该报该期信息" ForeColor="Red"
                                    OnClick="Button2_Click" OnClientClick="return window.confirm('确定要删除满足条件的期刊吗?')" />
                            </td>
                        </tr>
                    </table>
                    <div id="List" runat="server">
                    </div>
                    <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1">
                        <tr>
                            <td height="50" valign="middle" align="center">
                                <div id="CopyrightInfo" runat="server">
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </td>
        </tr>
    </table>

    <script language="javascript" type="text/javascript">
function Del(id,pic)
{
    if(confirm('你确认删除此版面吗?'))
    {
        self.location="?Action=Del&ID="+id+"&pic="+pic;
    }
}
 function delAll() {
   if(confirm('你确认删除所选期刊吗?'))
    {
    var ids="";
    
    for (var i = 0; i < document.getElementsByName("selectFlag").length; i++) {
    if(document.getElementsByName("selectFlag")[i].checked){
    if(document.getElementsByName("selectFlag")[i].value.split(",").length>0){
    ids+=document.getElementsByName("selectFlag")[i].value.split(",")[0]+","+document.getElementsByName("selectFlag")[i].value.split(",")[1]+"|";
   }
}    
   
  }
  self.location="?Action=Dels&ID="+ids;
        
    }
  
 }
function Edit(id)
{
    self.location="Modify.aspx?id="+id;
}
function showMap(pic,papername,qnum,pageNum)
   {
   window.open("map.aspx?pic="+escape(pic)+"&paperName="+escape(papername)+"&qnum="+qnum+"&pageNum="+pageNum);
   }
 
    </script>

    <asp:HiddenField ID="HiddenField1" runat="server" />
    <asp:HiddenField ID="HiddenField_select" runat="server" />
     <asp:HiddenField ID="HiddenField_specialRole" runat="server" />
</asp:Content>
