<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Write.aspx.vb" Inherits="user_Write"
    ValidateRequest="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!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 runat="server">
    <link href="../StyleSheetPC.css" rel="stylesheet" type="text/css" />
    <title>
        <%= xTab%></title>
</head>
<body id="Backimage" runat="server">
    <form id="form1" runat="server">
    <%--page▼--%>
    <div id="vPage" runat="server">
        <%--header▼--%>
        <div id="header2">
            <h1 id="top" style="margin-top: 65px; padding-left: 30px; font-size: 14pt;">
                <a href="Default.aspx" style="text-decoration: none; color: White;">
                    <%= xTitle%>
                </a>
            </h1>
        </div>
        <%--header▲--%>
        <%--pagecontents▼--%>
        <%--left▼--%>
        <div id="left" runat="server">
            <asp:Panel ID="Panel2" runat="server" Width="220px">
                <asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" DataSourceID="SiteMapDataSourceMenu"
                    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57"
                    StaticDisplayLevels="2" StaticSubMenuIndent="30px" Width="210px">
                    <DynamicHoverStyle BackColor="#666666" ForeColor="White" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                    <DynamicMenuStyle BackColor="#E3EAEB" />
                    <DynamicSelectedStyle BackColor="#1C5E55" />
                    <StaticHoverStyle BackColor="#666666" ForeColor="White" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                    <StaticSelectedStyle BackColor="#DA3C41" ForeColor="White" Width="175px" />
                </asp:Menu>
                <br />
                <asp:Label ID="LabelName" runat="server" Text=""></asp:Label><br />
                <asp:Label ID="LabelMail" runat="server" Text=""></asp:Label><br />
                <asp:Label ID="LabelCookie" runat="server" Text="" Visible="false"></asp:Label><br />
                <asp:Label ID="Label2" runat="server" Text="過去の投稿（選択で修正可）"></asp:Label><br />
                <asp:ListBox ID="ListBoxList" runat="server" Height="107px" Width="200px" AutoPostBack="True">
                </asp:ListBox>
                <asp:SqlDataSource ID="SqlDataSourceSubjectList" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT * FROM [Novel] ORDER BY [id] DESC"></asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceSubjectList2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT * FROM [Novel] ORDER BY [id]"></asp:SqlDataSource>
                <asp:Label ID="LabelOrder" runat="server" Text=""></asp:Label>
                <asp:Label ID="Label1" runat="server" Text="IP:" Visible="False"></asp:Label>
                <asp:Label ID="LabelIP" runat="server" Text="" Visible="False"></asp:Label>
                <asp:Label ID="LabelMyid" runat="server" Text="" Visible="false"></asp:Label>
                <asp:Label ID="LabelButton" runat="server" Text="" Visible="false"></asp:Label>
                <asp:Label ID="LabelNew" runat="server" Text="" Visible="false"></asp:Label>
                <asp:Label ID="LabelMenu" runat="server" Text="" Visible="false"></asp:Label>
                <asp:Label ID="LabelBackcolor" runat="server" Text="" Visible="false"></asp:Label>
                <%--リストボックスのデータと書込み--%>
                <asp:SqlDataSource ID="SqlDataSourceAll" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT * FROM [Novel] ORDER BY [id] DESC" DeleteCommand="DELETE FROM [Novel] WHERE [id] = @id"
                    InsertCommand="INSERT INTO [Novel] ([date], [subject], [body], [level], [button], [new], [menu], [backcolor], [myid], [proxy]) VALUES (@date, @subject, @body, @level, @button, @new, @menu, @backcolor, @myid, @proxy)"
                    UpdateCommand="UPDATE [Novel] SET [date] = @date, [subject] = @subject, [body] = @body, [level] = @level, [button] = @button, [new] = @new, [menu] = @menu, [backcolor] = @backcolor, [myid] = @myid, [proxy] = @proxy WHERE [id] = @id">
                    <DeleteParameters>
                        <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:SessionParameter Name="date" SessionField="date" Type="DateTime" />
                        <asp:SessionParameter Name="subject" SessionField="subject" Type="String" />
                        <asp:SessionParameter Name="body" SessionField="body" Type="String" />
                        <asp:SessionParameter Name="level" SessionField="level" Type="Int32" />
                        <asp:SessionParameter Name="button" SessionField="button" Type="String" />
                        <asp:SessionParameter Name="new" SessionField="new" Type="String" />
                        <asp:SessionParameter Name="menu" SessionField="menu" Type="String" />
                        <asp:SessionParameter Name="backcolor" SessionField="backcolor" Type="String" />
                        <asp:SessionParameter Name="myid" SessionField="myid" Type="String" />
                        <asp:SessionParameter Name="proxy" SessionField="proxy" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:SessionParameter Name="date" SessionField="date" Type="DateTime" />
                        <asp:SessionParameter Name="subject" SessionField="subject" Type="String" />
                        <asp:SessionParameter Name="body" SessionField="body" Type="String" />
                        <asp:SessionParameter Name="level" SessionField="level" Type="Int32" />
                        <asp:SessionParameter Name="button" SessionField="button" Type="String" />
                        <asp:SessionParameter Name="new" SessionField="new" Type="String" />
                        <asp:SessionParameter Name="menu" SessionField="menu" Type="String" />
                        <asp:SessionParameter Name="backcolor" SessionField="backcolor" Type="String" />
                        <asp:SessionParameter Name="myid" SessionField="myid" Type="String" />
                        <asp:SessionParameter Name="proxy" SessionField="proxy" Type="String" />
                        <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
                <br />
                <%--リストボックスの移動対象の選択--%>
                <asp:SqlDataSource ID="SqlDataSourceFromTo" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT * FROM [Novel] WHERE (([id] &gt;= @id) AND ([id] &lt;= @id2)) ORDER BY [id] DESC">
                    <SelectParameters>
                        <asp:SessionParameter Name="id" SessionField="xStart" Type="Int32" />
                        <asp:SessionParameter Name="id2" SessionField="xEnd" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceFromTo2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT * FROM [Novel] WHERE (([id] &gt;= @id) AND ([id] &lt;= @id2)) ORDER BY [id]">
                    <SelectParameters>
                        <asp:SessionParameter Name="id" SessionField="xStart" Type="Int32" />
                        <asp:SessionParameter Name="id2" SessionField="xEnd" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <%--選択されたリストボックスのidから対象データの検索--%>
                <asp:SqlDataSource ID="SqlDataSourceID" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT * FROM [Novel] WHERE ([id] = @id)">
                    <SelectParameters>
                        <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <br />
            </asp:Panel>
        </div>
        <%--left▲--%>
        <%--main▼--%>
        <div id="main" runat="server">
            <asp:Panel ID="Panel3" runat="server">
                <table style="width: 730px;">
                    <tr>
                        <td style="width: 90px">
                            <asp:Label ID="Label4" runat="server" Text="タイトル"></asp:Label>
                        </td>
                        <td style="background-color: White;">
                            <asp:TextBox ID="TextBoxSubject" runat="server" Width="460px" Font-Size="Large"></asp:TextBox>
                            <%--<asp:Literal ID="LiteralSubject" runat="server" Visible="False"></asp:Literal>--%>
                        </td>
                        <td style="width: 50px; text-align: left;">
                            <asp:Label ID="Label5" runat="server" Text="日付"></asp:Label>
                        </td>
                        <td class="style1" style="width: 140px;">
                            <asp:TextBox ID="TextBoxDate" runat="server" Width="70px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            &nbsp;&nbsp;
                            <asp:Label ID="Label9" runat="server" Text="表示レベル"></asp:Label>
                            <asp:Button ID="ButtonDown" runat="server" Text="←" />
                            <asp:TextBox ID="TextBoxLevel" runat="server" Width="30px" ReadOnly="True"></asp:TextBox>
                            <asp:Button ID="ButtonUp" runat="server" Text="→" />
                        </td>
                        <td>
                        </td>
                        <td>
                            <asp:Label ID="Label7" runat="server" Text="ID"></asp:Label>
                            &nbsp;
                            <asp:Label ID="LabelID" runat="server" Text="0"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label6" runat="server" Text="本文"></asp:Label>
                        </td>
                        <td colspan="2">
                            <asp:Button ID="Button2" runat="server" Text="新規" />
                            &nbsp;
                            <asp:Button ID="Button1" runat="server" Text="書込み" BackColor="#CCFFFF" />
                            &nbsp;<asp:Label ID="LabelMsg" runat="server" ForeColor="Red" Text="原稿は、スマホを意識して幅を固定しないでください"></asp:Label>
                        </td>
                        <td class="style1">
                            <asp:Button ID="Button5" runat="server" Text="削除" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="background-color: White;">
                            <asp:TextBox ID="TextBoxBody" runat="server" TextMode="MultiLine" Height="550px"
                                Width="100%"></asp:TextBox>
                            <ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="TextBoxBody"
                                DisplaySourceTab="true" EnableSanitization="False">
                                <Toolbar>
                                    <ajaxToolkit:Undo />
                                    <ajaxToolkit:Redo />
                                    <ajaxToolkit:Bold />
                                    <ajaxToolkit:Italic />
                                    <ajaxToolkit:Underline />
                                    <ajaxToolkit:StrikeThrough />
                                    <ajaxToolkit:Subscript />
                                    <ajaxToolkit:Superscript />
                                    <ajaxToolkit:JustifyLeft />
                                    <ajaxToolkit:JustifyCenter />
                                    <ajaxToolkit:JustifyRight />
                                    <ajaxToolkit:JustifyFull />
                                    <ajaxToolkit:InsertOrderedList />
                                    <ajaxToolkit:InsertUnorderedList />
                                    <ajaxToolkit:CreateLink />
                                    <ajaxToolkit:UnLink />
                                    <ajaxToolkit:RemoveFormat />
                                    <ajaxToolkit:SelectAll />
                                    <ajaxToolkit:UnSelect />
                                    <ajaxToolkit:Delete />
                                    <ajaxToolkit:Cut />
                                    <ajaxToolkit:Copy />
                                    <ajaxToolkit:Paste />
                                    <ajaxToolkit:BackgroundColorSelector />
                                    <ajaxToolkit:ForeColorSelector />
                                    <ajaxToolkit:FontNameSelector />
                                    <ajaxToolkit:FontSizeSelector />
                                    <ajaxToolkit:Indent />
                                    <ajaxToolkit:Outdent />
                                    <ajaxToolkit:InsertHorizontalRule />
                                    <ajaxToolkit:HorizontalSeparator />
                                    <ajaxToolkit:InsertImage />
                                </Toolbar>
                            </ajaxToolkit:HtmlEditorExtender>
                            <%--<FTB:FreeTextBox ID="FreeTextBoxBody" runat="server" Width="740px">
                        </FTB:FreeTextBox>--%>
                        </td>
                    </tr>
                </table>
                <hr />
                <p>
                </p>
            </asp:Panel>
        </div>
        <%--main▲--%>
        <%--footer▼--%>
        <div id="footer" runat="server">
            <hr />
            <h1>
                Footer &nbsp;
                <asp:Label ID="LabelFooter" runat="server" Text=""></asp:Label>
            </h1>
            <br />
        </div>
        <%--footer▲--%>
        <%--pagecontents▲--%>
    </div>
    <%--見てくれデータの読み取り--%>
    <asp:SqlDataSource ID="SqlDataSourceNovelByID" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT * FROM [Novel] WHERE ([id] = @id)">
        <SelectParameters>
            <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSourceNovelByProxy" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT * FROM [Novel] WHERE ([proxy] = @proxy) ORDER BY [id] DESC">
        <SelectParameters>
            <asp:SessionParameter Name="proxy" SessionField="proxy" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSourceFormat" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT * FROM [Format] ORDER BY [id]"></asp:SqlDataSource>
    <asp:SiteMapDataSource ID="SiteMapDataSourceMenu" runat="server" SiteMapProvider="forViewer" />
    <asp:SiteMapDataSource ID="SiteMapDataSourceMenu2" runat="server" SiteMapProvider="forWriter" />
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    </form>
</body>
</html>
