<%@ page language="C#" masterpagefile="~/MasterPage/UserMasterPage.master" autoeventwireup="true" inherits="Rest_Gift_EditGift, DoodiiShop" title="Untitled Page" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="Brettle.Web.NeatUpload" Namespace="Brettle.Web.NeatUpload"
    TagPrefix="Upload" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <title>编辑礼品</title>
  <style type="text/css">
input.huo{ width:60px;background-color:#008c00; color:#FFFFFF;  height:25px; text-align:center; margin-right:375px;}
input.sho{float:right; background-color:#008c00 ;color:#FFFFFF; margin-right: 285px; height:25px; line-height:25px; padding:1px 8px;}
 </style>
    <script type="text/javascript">
       var changeImage = function() {
        var filePath = document.getElementById("<%=InputFile1.ClientID%>").value;
        //alert(filePath);
        if ( doodii.Web.App_Code.Common.checkImgExt(filePath).value == 0 ) {
            $("#<%=Image1.ClientID%>").attr("src", "/getImage_0_100_100_0_0_0_1.aspx");
        } else {
            $("#<%=Image1.ClientID%>").attr("src", filePath);  //ImageUrl
        }
    }
     function checkCk()
    {
       var cktg=document.getElementById("<%=tg.ClientID %>");
       var ckxf=document.getElementById("<%=xf.ClientID %>");
       var ckuv=document.getElementById("<%=uv.ClientID %>");
       var sptg=document.getElementById("<%=sptg.ClientID %>");
       var spxf=document.getElementById("<%=spxf.ClientID %>");
       var spuv=document.getElementById("<%=spuv.ClientID %>");
       
       if(cktg.checked==true && ckxf.checked==true && ckuv.checked==true)
       {alert("只能选择２种兑换方式！请取消一种再做选择");return;}
       
       if(cktg.checked==true)
       {sptg.style.display="";
        if($("#giftspread").val()==0)
           {$("#giftspread").val("");}
       }
       else
       {sptg.style.display="none";
        $("#giftspread").val("0");
       }
       if(ckxf.checked==true)
       {spxf.style.display="";
       if($("#giftexpend").val()==0)
       {$("#giftexpend").val("")}
       }
       else{spxf.style.display="none";$("#giftexpend").val("0")}
       
       if(ckuv.checked==true)
       {spuv.style.display=""; 
        if($("#txtUserValue").val()==0)
        {$("#txtUserValue").val("");}
        }
       else{spuv.style.display="none";$("#txtUserValue").val("0")}
       
    }
    </script>

    <div>
        <%--<table style="width: 100%" class="NewTable">
            <tr>
                <td style="width: 947px; height: 25px;" colspan="8">
                    礼品类别：
                    <asp:DropDownList ID="giftclass" runat="server">
                    </asp:DropDownList>&nbsp; 礼品名称：<asp:TextBox BorderStyle="Groove" ID="giftname" runat="server"
                        Width="175px" MaxLength="20" />
                    库存：<asp:TextBox BorderStyle="Groove" ID="giftnum" runat="server" Width="94px"></asp:TextBox>&nbsp;
                    <span style="display: none">价值：<asp:TextBox BorderStyle="Groove" ID="giftworth" runat="server"
                        Width="94px" /></span></td>
            </tr>
            <tr>
                <td style="width: 947px;" colspan="8">
                    金豆<input type="checkbox" id="tg" onclick="checkCk()" runat="server" />
                    <span id="sptg" style="display: none" runat="server">
                        <asp:TextBox BorderStyle="Groove" Text="0" ID="giftspread" runat="server" Width="94px" />
                    </span>消费积分<input type="checkbox" id="xf" onclick="checkCk()" runat="server" />
                    <span id="spxf" style="display: none" runat="server">
                        <asp:TextBox BorderStyle="Groove" Text="0" ID="giftexpend" runat="server" Width="94px" /></span>
                    会员价格
                    <input type="checkbox" id="uv" onclick="checkCk()" runat="server" />
                    <span id="spuv" style="display: none" runat="server">
                        <asp:TextBox BorderStyle="Groove" Text="0" ID="txtUserValue" runat="server" Width="88px" /></span>&nbsp;排序：
                    <asp:TextBox ID="txtSort" runat="server" Width="103px"></asp:TextBox>&nbsp;</td>
            </tr>
        </table>
        <table style="width: 100%" class="NewTable">
            <tr>
                <td style="width: 947px; height: 20px" colspan="6">
                    礼品图片：<Upload:InputFile ID="InputFile1" runat="server" Size="50" Width="368px" onchange="changeImage()" />
                </td>
            </tr>
            <tr>
                <td colspan="6" style="width: 947px; height: 20px">
                    &nbsp;是否推荐<input id="chIsCommend" runat="server" type="checkbox" value="1" />
                    是否新品<input id="ckIsNew" runat="server" type="checkbox" value="1" />
                </td>
            </tr>
        </table>
        <table style="width: 100%; height: 173px" class="NewTable">
            <tr>
                <td style="width: 739px">
                    说明：</td>
                <td rowspan="3">
                    <asp:Image ID="Image1" runat="server" Height="100%" Width="100%" AlternateText="预览图片" />
                </td>
            </tr>
            <tr>
                <td style="width: 739px">
                    <FCKeditorV2:FCKeditor ID="FCKNote" runat="server" ToolbarSet="bulletin">
                    </FCKeditorV2:FCKeditor>
                </td>
            </tr>
            <tr>
                <td style="width: 739px; text-align: center; height: 24px;">
                    <asp:Label ID="lblID" runat="server" Visible="False"></asp:Label>
                    <asp:Button ID="SubmitBT" runat="server" Text="修改" OnClick="SubmitBT_Click" /></td>
            </tr>
        </table>--%>
        <table style="width: 100%" class="NewTable">
            <tr>
                <td>
                    类&nbsp;&nbsp;&nbsp;别：
                </td>
                <td>
                    <asp:DropDownList ID="giftclass" runat="server">
                    </asp:DropDownList>
                    &nbsp;&nbsp;<input class="huo" type="button" value="类别管理" onclick="AddClass()" /></td>
            </tr>
            <tr>
                <td>
                    礼品名称：</td>
                <td>
                    <asp:TextBox BorderStyle="Groove" ID="giftname" runat="server" Width="128px" MaxLength="20" />&nbsp;&nbsp;库存：<asp:TextBox
                        BorderStyle="Groove" ID="giftnum" runat="server" Width="40px"></asp:TextBox>&nbsp;&nbsp;积分：<input
                            type="checkbox" checked="checked" runat="server" id="xf" onclick="checkCk()" style="display: none;" />
                    <span id="spxf" runat="server">
                        <asp:TextBox BorderStyle="Groove" ID="giftexpend" runat="server" Width="40px" /></span>&nbsp;排序：
                    <asp:TextBox ID="txtSort" runat="server" Width="40px"></asp:TextBox>&nbsp;
                    <br />
                    排序数字越大，位置越靠前，默认排序为0<span style="display: none">价值：<asp:TextBox BorderStyle="Groove"
                        ID="giftworth" runat="server" Width="40px" Text="0" MaxLength="20" /></span></td>
            </tr>
            <tr style="display: none;">
                <td style="height: 25px;" colspan="10">
                    金豆<input type="checkbox" runat="server" id="tg" onclick="checkCk()" />
                    <span id="sptg" runat="server" style="display: none">
                        <asp:TextBox BorderStyle="Groove" ID="giftspread" runat="server" Width="94px" />
                    </span>会员价格
                    <input type="checkbox" runat="server" id="uv" onclick="checkCk()" />
                    <span id="spuv" style="display: none" runat="server">
                        <asp:TextBox BorderStyle="Groove" ID="txtUserValue" runat="server" Width="88px" /></span></td>
            </tr>
            <tr>
                <td>
                    礼品图片：</td>
                <td>
                    <Upload:InputFile ID="InputFile1" runat="server" Size="50" Width="356px" onchange="changeImage()" />
                    <br />
                    文件大小请不要超过100KB。文件类型可使用gif、jpg及png
                    <br />
                    <asp:Image ID="Image1" runat="server" Height="150" Width="150" AlternateText="预览图片" />
                </td>
            </tr>
            <tr style="display: none;">
                <td colspan="4" style="padding-left: 3px; height: 20px">
                    &nbsp;是否推荐<input id="chIsCommend" value="1" runat="server" type="checkbox" />
                    是否新品<input id="ckIsNew" value="1" type="checkbox" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    礼品说明：</td>
                <td style="width: 4081px">
                    <FCKeditorV2:FCKeditor ID="FCKNote" runat="server" ToolbarSet="bulletin">
                    </FCKeditorV2:FCKeditor>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    <asp:RadioButton ID="rdIsShow" Text="立即上架" GroupName="rdShow" runat="server" />&nbsp;<asp:RadioButton
                        ID="RdIsHide" Text="稍后上架" GroupName="rdShow" runat="server"/></td>
            </tr>
            <tr>
                <td style="text-align: center; height: 24px;" colspan="2">
                <asp:Label ID="lblID" runat="server" Visible="False"></asp:Label>
                    <asp:Button ID="SubmitBT" CssClass="sho"  runat="server" Text="提交" OnClick="SubmitBT_Click" /></td>
            </tr>
        </table>
    </div>
</asp:Content>
