<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Page_FileShara_List.aspx.cs" Inherits="BDLSerSystem.FileManage.Page_FileShara_List" %>
<HTML>
	<HEAD>
		<title>User_Reg</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<LINK href="../css/css.css" type="text/css" rel="stylesheet">
		<script src="../JS/Site.js"></script>
		<script src="../JS/MyDataTime.js"></script>
<script language="JavaScript">
function winconfirm(){
    question = confirm("您确实要删除所选项目吗?")     
if(!question){   
          event.returnValue=false;   
      }
  }
  function winconfirm2() {
      question = confirm("您确实共享所选项目中的文件夹吗?")
      if (!question) {
          event.returnValue = false;
      }
  }
  function winconfirm3() {
      question = confirm("您确实取消共享吗?")
      if (!question) {
          event.returnValue = false;
      }
  }
  function checkOne(box_no, FileType) {
      var frm = document.Form1;
      if (box_no.checked == true) {
          frm.Del_IDList.value = frm.Del_IDList.value + "," + box_no.value + ",";
          if (FileType == 0) {
              frm.FileFold_List.value = frm.FileFold_List.value + "," + box_no.value + ",";
          }
          else {
              frm.File_List.value = frm.File_List.value + "," + box_no.value + ",";
          }
      }
      else {
          frm.Del_IDList.value = frm.Del_IDList.value.replace("," + box_no.value + ",", "");
          if (FileType == 0) {
              frm.FileFold_List.value = frm.FileFold_List.value.replace("," + box_no.value + ",", "");
          }
          else {
              frm.File_List.value = frm.File_List.value.replace("," + box_no.value + ",", "");
          }
      }
      //再处理下载
      if (frm.File_List.value == "") {
          document.getElementById("Btn_Edit").className = "Btn_Zu_MidNo";
          document.getElementById("Div_Edit").style.display = "";
      }
      else {
          document.getElementById("Btn_Edit").className = "Btn_Zu_Mid";
          document.getElementById("Div_Edit").style.display = "none";
      }      
      
  }
  function pickrow(row,FileType) {
      if (event.srcElement.type == "checkbox") return;
      var x = row.getElementsByTagName("input");
      for (var j = 0; j < x.length; j++) {
          if (x[j].type = "checkbox") {
              x[j].checked = !x[j].checked;
              checkOne(x[j], FileType);
          }
      }
  }
  function checkEdit(sDel_IDList) {
      var frm = document.Form1;
      if (frm.FileFold_List.value != "") {
          alert('不能下载文件夹,请先取消选中的文件夹!');
          return false;
      }
      else {
          var r, re;
          var strlength = sDel_IDList.length;
          re = /\,/; // 创建正则表达式模式。
          while (re.test(sDel_IDList)) {
              sDel_IDList = sDel_IDList.replace(re, "");
          }
          //alert("字符串中还有" + (strlength - sDel_IDList.length) + "点");
          var Tag_Counts = strlength - sDel_IDList.length;
          if (Tag_Counts == 2) {
              //可以修改
              //openWithIframe('活动信息设置', 'Page_HuoDong_Add.aspx?Mech_ID=' + sDel_IDList, 740, 420, 0, 'Page_HuoDong_List.aspx');
              location.href = 'Page_File_Down.aspx?File_ID=' + sDel_IDList;
          }
          else {
              alert('一次只能下载一个选定项目!');
              return false;
          }
      }
  }
  function checkShara() {
      var frm = document.Form1;
      if (frm.File_List.value != "") {
          alert('不能共享文件,请先取消选中的文件!');
          return false;
      }
      else {
          question = confirm("您确定要共享所选文件夹吗?")
          if (!question) {
              event.returnValue = false;
          }
      }
  }
  function checkNoShara() {
      var frm = document.Form1;
      if (frm.File_List.value != "") {
          alert('不能共享文件,请先取消选中的文件!');
          return false;
      }
      else {
          question = confirm("您确定要取消共享所选文件夹吗?")
          if (!question) {
              event.returnValue = false;
          }
      }
  }
  function AddFile(sDel_IDList) {
      openWithIframe('文件信息设置', 'Page_File_Add.aspx?Mech_ID=' + sDel_IDList, 740, 120, 0, 'Page_File_List.aspx?Fath_ID=' + sDel_IDList);
  }
  function MoveFile(sDel_IDList,FathID) {
      openWithIframe('文件移动设置', 'Page_File_Move.aspx?File_List=' + sDel_IDList, 740, 420, 0, 'Page_File_List.aspx?Fath_ID=' + FathID);
  }
</script>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server" defaultbutton="Btn_Search" defaultfocus="SFile_Name">
			<div align="center">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="43" background="../Images/Menu_Bg.png" class="tbl_1line_b"><div align="right">
    <table width="98%" height="30"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="55px"><div align="center"><input type="button" class="Btn_Zu_LeftNo" value="新增"></div></td>
              <td width="55px"><div align="center"><input type="button" name="Btn_Edit" id="Btn_Edit" class="Btn_Zu_MidNo" value="下载" onClick="checkEdit(File_List.value);"></div></td>
              <td width="55px"><div align="center"><asp:Button ID="Btn_Shara" 
                      CssClass="Btn_Zu_MidNo" Text="共享" runat="server" onclick="Btn_Shara_Click" /></div></td>
              <td width="55px"><div align="center"><asp:Button ID="Btn_NoShara" 
                      CssClass="Btn_Zu_MidNo" Text="去共享" runat="server" onclick="Btn_NoShara_Click"/></div></td>
              <td width="55px"><div align="center"><input type="button" name="Btn_Move" class="Btn_Zu_MidNo" value="移动"></div></td>
              <td width="54px"><div align="center"><asp:Button ID="Btn_Del" runat="server" 
                      CssClass="Btn_Zu_RightNo" Text="删除" onclick="Btn_Del_Click" /></div></td>
              <td width="20px">&nbsp;</td>             
              <td width="54px"><div align="center"><asp:Button ID="Btn_Back" runat="server" 
                      CssClass="Btn_Quan_Small" Text="返回" onclick="Btn_Back_Click" /></div></td>
              <td width="55px"><div id="Div_Edit" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -348px;  width:55px;height:35px;"></div></td>
              <td width="54px"><div id="Div_Del" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -183px;  width:54px;height:35px;"></div></td>              
              <td width="55px"><div id="Div_Shara" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -403px;  width:55px;height:35px;"></div></td>    
              <td width="55px"><div id="Div_NoShara" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -403px;  width:55px;height:35px;"></div></td>       
              <td width="55px"><div id="Div_Move" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -403px;  width:55px;height:35px;"></div></td>
              
              <td width="55px"><div id="Div_Add" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -678px;  width:55px;height:30px;"></div></td>
              
              <td>&nbsp;</td>
            </tr>
          </table>
    </div></td>
  </tr>
  <tr>
    <td valign="top"><div align="right">
            <table width="98%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td height="35" colspan="3" background="../images/Page_Title.png" class="tbl_3line_rtl">
										        <table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td><div align="left" class="font_style_2a5b8c">&nbsp;&nbsp;&nbsp;&nbsp;共享文件综合管理<%=sFile_PathStr%><asp:TextBox ID="Del_IDList" runat="server"  style="DISPLAY: none"></asp:TextBox><asp:TextBox ID="FathIDBack" runat="server" style="DISPLAY: none"></asp:TextBox><asp:TextBox ID="FileFold_List" runat="server" style="DISPLAY: none"></asp:TextBox><asp:TextBox ID="File_List" runat="server" style="DISPLAY: none"></asp:TextBox><asp:TextBox ID="EmplCodeBack" runat="server" style="DISPLAY: none"></asp:TextBox></div>
														</td>
														<td width="50">&nbsp;</div>
														</td>
													</tr>
												</table></td>
									</tr>
									<tr>
										<td background="../images/tbl_rl.png" width="6px"></td>
										<td class="tbl_4line_rblt" valign="top"><div align="center">
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
												    <tr>
														<td height="40" class="tbl_1line_b"><div align="left">&nbsp;&nbsp;文件名：<asp:TextBox ID="SFile_Name" runat="server" CssClass="input_style" Width="150px"></asp:TextBox>&nbsp;&nbsp;<asp:Button ID="Btn_Search" runat="server" CssClass="BtnStyle" Text="文件搜索" onclick="Btn_Search_Click" /></div></td>
													</tr>
													<tr>
														<td height="35"><div align="center"><asp:Label ID="ShowInfo" Runat="server"></asp:Label></div></td>
													</tr>
													<tr>
														<td>&nbsp;</td>
													</tr>
												</table>
											</div>
										</td>
										<td background="../images/tbl_rl2.png" width="6px"></td>
									</tr>
									<tr>
										<td height="6"><div align="center"><img src="../images/tbl_bl.png" width="6" height="6"></div>
										</td>
										<td height="6" background="../images/tbl_bt.png"></td>
										<td height="6"><div align="center"><img src="../images/tbl_br.png" width="6" height="6"></div>
										</td>
									</tr>
								</table>
    </div></td>
  </tr>
</table>
				
			</div>
		</form>
	</body>
</HTML>
