<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Download_Edit.aspx.cs" Inherits="TotCms.Web.Admin.Download_Edit" ValidateRequest="false" %>

<%@ Register src="UI/main_top.ascx" tagname="main_top" tagprefix="uc1" %>

<%@ Register assembly="TotCms.Controls" namespace="TotCms.Controls" tagprefix="cc1" %>

<!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">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>修改下载</title>
    <link href="style/global.css" rel="stylesheet" type="text/css" />
    <script src="js/xmlhttp.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>    
    <script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../js/jquery-ui-1.8.10/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
    <link href="../js/jquery-ui-1.8.10/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
      $(function () {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-win").dialog({
          autoOpen: false,
          width: 530,
          height: 250,
          modal: true,
          close: function () {

          }
        });
      });
      function Upload_Open() {
        $("#dialog-win").dialog("open");
        document.getElementById('win_frame').src = 'Upload.aspx';
        $("#dialog-win").dialog('option', 'title', '上传图片');
      }
      function CloseFrame() {
        $("#dialog-win").dialog("close");
      }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
      <uc1:main_top ID="main_top1" runat="server" />
    
    </div>
    <table style="width:100%;" border="0" cellpadding="0" cellspacing="1" 
      class="black_border">
      <tr class="suphead">
        <td colspan="2">
                                        修改下载</td>
    </tr>
    <tr>
      <td class="fields_text">
        选择栏目：</td>
      <td class="fields_input">
        <asp:Label ID="CategoryTitle" runat="server" Text="Label"></asp:Label>
        <asp:TextBox ID="CategoryId" runat="server" CssClass="hidden"></asp:TextBox>
          <input id="Button4" type="button" value="..." onclick="popupWindow('Category_Tree.aspx?datamodule=<%=(int)TotCms.FrameWork.Enums.DataModule.Download %>','category_tree',400,300,1)" />
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          软件名称：</td>
      <td class="fields_input">
        <asp:TextBox ID="Title" runat="server" CssClass="input_middle"></asp:TextBox>
          &nbsp; 字母索引：&nbsp; 
          <asp:DropDownList ID="SoftChar" runat="server" CssClass="select">
              <asp:ListItem>a</asp:ListItem>
              <asp:ListItem>b</asp:ListItem>
              <asp:ListItem>c</asp:ListItem>
              <asp:ListItem>d</asp:ListItem>
              <asp:ListItem>e</asp:ListItem>
              <asp:ListItem>f</asp:ListItem>
              <asp:ListItem>g</asp:ListItem>
              <asp:ListItem>h</asp:ListItem>
              <asp:ListItem>i</asp:ListItem>
              <asp:ListItem>j</asp:ListItem>
              <asp:ListItem>k</asp:ListItem>
              <asp:ListItem>l</asp:ListItem>
              <asp:ListItem>m</asp:ListItem>
              <asp:ListItem>n</asp:ListItem>
              <asp:ListItem>o</asp:ListItem>
              <asp:ListItem>p</asp:ListItem>
              <asp:ListItem>q</asp:ListItem>
              <asp:ListItem>r</asp:ListItem>
              <asp:ListItem>s</asp:ListItem>
              <asp:ListItem>t</asp:ListItem>
              <asp:ListItem>u</asp:ListItem>
              <asp:ListItem>v</asp:ListItem>
              <asp:ListItem>w</asp:ListItem>
              <asp:ListItem>x</asp:ListItem>
              <asp:ListItem>y</asp:ListItem>
              <asp:ListItem>z</asp:ListItem>
          </asp:DropDownList>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
              ControlToValidate="Title" ErrorMessage="软件名称不能为空"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
      <td class="fields_text">
          关键字：</td>
      <td class="fields_input">
        <asp:TextBox ID="SoftKey" runat="server" CssClass="input_middle"></asp:TextBox>
          据此查找相关下载</td>
    </tr>
    <tr>
      <td class="fields_text">
          版本：</td>
      <td class="fields_input">
        <asp:TextBox ID="SoftVersion" runat="server" CssClass="input_middle"></asp:TextBox>
          &nbsp;</td>
    </tr>
    <tr>
      <td class="fields_text">
          语言：</td>
      <td class="fields_input">
          <asp:RadioButtonList ID="SoftLanguage" runat="server" 
              RepeatDirection="Horizontal" RepeatLayout="Flow">
              <asp:ListItem Selected="True">简体中文</asp:ListItem>
              <asp:ListItem>繁体中文</asp:ListItem>
              <asp:ListItem>英文</asp:ListItem>
              <asp:ListItem>多国语言</asp:ListItem>
          </asp:RadioButtonList>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          软件许可：</td>
      <td class="fields_input">
          <asp:RadioButtonList ID="SoftLicense" runat="server" 
              RepeatDirection="Horizontal" RepeatLayout="Flow">
              <asp:ListItem Selected="True">共享版</asp:ListItem>
              <asp:ListItem>免费版</asp:ListItem>
              <asp:ListItem>商业版</asp:ListItem>
              <asp:ListItem>试用版</asp:ListItem>
          </asp:RadioButtonList>
        </td>
    </tr>
    <tr>
      <td class="fields_text">
          软件属性：</td>
      <td class="fields_input">
          <asp:RadioButtonList ID="SoftAttr" runat="server" RepeatDirection="Horizontal" 
              RepeatLayout="Flow">
              <asp:ListItem Selected="True">国产软件</asp:ListItem>
              <asp:ListItem>国外软件</asp:ListItem>
              <asp:ListItem>汉化补丁</asp:ListItem>
              <asp:ListItem>破解补丁</asp:ListItem>
          </asp:RadioButtonList>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        缩略图：</td>
      <td class="fields_input">
        <asp:TextBox ID="Photo" runat="server" CssClass="input_middle"></asp:TextBox>
        <input name="UpLoad" type="button" id="UpLoad" value="上传" 
          onclick="Upload_Open()" class="btn-general" />
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          软件大小：</td>
      <td class="fields_input">
          <asp:TextBox ID="SoftSize" runat="server" CssClass="input_mini"></asp:TextBox>
          </td>
    </tr>
    <tr id="outLink1" style="display:none;">
      <td class="fields_text">
          星级：</td>
      <td class="fields_input">
          <asp:RadioButtonList ID="SoftStars" runat="server" RepeatDirection="Horizontal" 
              RepeatLayout="Flow">
              <asp:ListItem Selected="True" Value="5">★★★★★</asp:ListItem>
              <asp:ListItem Value="4">★★★★</asp:ListItem>
              <asp:ListItem Value="3">★★★</asp:ListItem>
              <asp:ListItem Value="2">★★</asp:ListItem>
              <asp:ListItem Value="1">★</asp:ListItem>
          </asp:RadioButtonList>
          </td>
    </tr>
    <tr id="outLink2">
      <td class="fields_text">
          运行环境运行环境：</td>
      <td class="fields_input">
          <asp:TextBox ID="SoftOs" runat="server" CssClass="input_middle"></asp:TextBox>
          </td>
    </tr>
    <tr id="outLink3">
      <td class="fields_text">
          软件开发商：>
      <td class="fields_input">
          <asp:TextBox ID="SoftAuthor" runat="server" CssClass="input_normal"></asp:TextBox>
          开发商网址：<asp:TextBox ID="SoftAuthorUrl" runat="server" CssClass="input_normal">http://</asp:TextBox>
          </td>
    </tr>
    <tr id="outLink3">
      <td class="fields_text">
          演示网址：</td>
      <td class="fields_input">
          <asp:TextBox ID="SoftDemoUrl" runat="server" CssClass="input_middle">http://</asp:TextBox>
          </td>
    </tr>
    <tr id="outLink4">
      <td class="fields_text" valign="top">内容：</td>
      <td class="fields_input" colspan="2">
        <asp:TextBox ID="Content" runat="server" CssClass="hidden" 
          TextMode="MultiLine">下载内容</asp:TextBox>
          <cc1:Editor ID="Editor1" runat="server" FieldName="Content" />    
      </td>      
    </tr>
    <tr>
      <td class="fields_text">
                    摘要：</td>
      <td class="fields_input">
        <asp:TextBox ID="Summary" runat="server" CssClass="text_normal" 
          TextMode="MultiLine"></asp:TextBox>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          下载设置：</td>
      <td class="fields_input">
        <asp:DropDownList ID="IsNeedLogin" runat="server">
          <asp:ListItem Value="0">开放下载</asp:ListItem>
          <asp:ListItem Value="1">仅会员下载</asp:ListItem>
        </asp:DropDownList>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          下载地址：</td>
      <td class="fields_input">
          <asp:Button ID="Button3" runat="server" Text="添加下载地址" onclick="Button3_Click" />
          <asp:GridView ID="GridView1" runat="server" DataKeyNames="id"
                            AutoGenerateColumns="False"  OnRowCancelingEdit="GridView1_RowCancelingEdit"
                            OnRowEditing="GridView1_RowEditing" 
          OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting" 
          GridLines="None" onrowdatabound="GridView1_RowDataBound">
                            <Columns>
                                <asp:TemplateField HeaderText="ID">
                                    <ItemTemplate>
                                        <asp:Label runat="server" Text='<%#Eval("id") %>' ID="Label0"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="下载点">
                                    <ItemTemplate>
                                        <%# GetDownServerTitle(Eval("ServerId"))%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="DropDownList1" runat="server">
                                        </asp:DropDownList>
                                        <asp:HiddenField ID="HiddenField1" Value='<%# Eval("ServerId") %>' runat="server" />
                                    </EditItemTemplate>
                                    <ItemStyle Width="150px" />
                                </asp:TemplateField> 
                                <asp:TemplateField HeaderText="下载名称">
                                    <ItemTemplate>
                                        <%# Eval("Title")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="Title" Text='<%# Eval("Title") %>' runat="server" Width="140px" />
                                    </EditItemTemplate>
                                    <ItemStyle Width="150px" />
                                </asp:TemplateField>  
                                <asp:TemplateField HeaderText="文件路径">
                                    <ItemTemplate>
                                        <%# Eval("FileUrl")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="FileUrl" Text='<%# Eval("FileUrl") %>' runat="server" Width="140px" />
                                    </EditItemTemplate>
                                    <ItemStyle Width="150px" />
                                </asp:TemplateField>                                   
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderText="操作" 
                                  CancelText="取消" DeleteText="删除" EditText="修改" InsertText="加入" SelectText="选择" 
                                  UpdateText="更新" />
                            </Columns>
                            <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#F7F6F3" ForeColor="#333333" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#f5f5f5" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
    </td>
    </tr>
    <tr>
      <td class="fields_text">
          自定义字段：</td>
      <td class="fields_input">
      <div id="CustomFields" runat="server"></div>
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td align="left" height="50">
        <asp:Button ID="Button1" runat="server" Text="修改下载" onclick="Button1_Click" 
          CssClass="btn-submit" />
        <input id="Button2" type="reset" value="取 消" class="btn-cancel" /></td>
    </tr>
  </table>
  <div id="dialog-win" title="window">
	  <iframe id="win_frame" name="win_frame" src="Blank.htm" width="500" height="170" frameborder="0"></iframe>	
  </div>
  <br />
    </form>
</body>
</html>
