<%@ page language="C#" masterpagefile="~/login/Super Admin.master" autoeventwireup="true" inherits="Photo_Gall, App_Web_photo gall.aspx.6cb53fb3" title="Welcome To Lokmangal Institute of Versatile Education" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    
    <style type="text/css">
        .style101405
        {
            color: #000000;
            text-align: left;
            font-family: Verdana;
            font-size: 9pt;
           
        }
        .style101406
        {
            color: #000000;
            text-align: left;
            font-weight: bold;
        }
        .style101407
        {
            color: #000000;
            text-align: left;
            font-family: Verdana;
            font-size: 9pt;
            font-weight: normal;
        }
        .style101408
        {
            font-weight: normal;
            text-align: left;
            width: 213px;
        }
        .style101409
        {
            width: 540px;
            text-align: left;
        }
        .style101410
        {
            width: 100%;
        }
        .style101411
        {
            font-family: Verdana;
            font-size: 10pt;
            font-weight: bold;
        }
        .style101412
        {
            text-align: left;
        }
        .style101413
        {
            text-align: left;
            width: 213px;
        }
    </style>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style101410">
        <tr>
            <td class="style101411">
            Add Photos To Photo Gallery :</td>
        </tr>
    </table>
    <table class="style3" style="width: 95%">
        <tr>
            <td class="style14" valign="top" style="font-family: Verdana; font-size: 10pt">
                <asp:Panel ID="Panel3" runat="server" Width="197px">
                    <table class="style3" style="width: 103%">
                        <tr>
                            <td class="style15" style="background-color: #003366; text-align: left;">
                                <b> <span class="style15">SELECT OPTION</span></b></td>
                        </tr>
                        <tr>
                            <td style="text-align: left">
                                <asp:LinkButton ID="LinkButton2" runat="server" Font-Underline="False" 
                                    onclick="LinkButton2_Click" style="font-family: Verdana; font-size: 10pt">Add 
                                Category</asp:LinkButton>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left">
                                <asp:LinkButton ID="LinkButton3" runat="server" Font-Underline="False" 
                                    onclick="LinkButton3_Click" style="font-family: Verdana; font-size: 10pt">Add 
                                Photos</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
            
            <td valign="top" style="font-family: Verdana; font-size: 10pt">
                <asp:Panel ID="Panel1" runat="server" Visible="False" Width="727px">
                    <table class="style3" style="font-family: Verdana; width: 100%;">
                        <tr>
                            <td class="style101406">
                                Add Photos :</td>
                            <td class="style101409">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style101407">
                                Select Photo To Upload :</td>
                            <td class="style101409">
                                <asp:FileUpload ID="FileUpload1" runat="server" Width="213px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style101407">
                                Select Category :</td>
                            <td class="style101409">
                                <asp:DropDownList ID="DropDownList1" runat="server" 
                    DataSourceID="AccessDataSource2" DataTextField="Category_Name" 
                    DataValueField="Category_Name" Height="22px" Width="167px" 
                                    onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:AccessDataSource ID="AccessDataSource2" runat="server" 
                    DataFile="~/App_Data/superwit.mdb" 
                    SelectCommand="SELECT [Category_Name] FROM [categories]">
                                </asp:AccessDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td class="style101407">
                                Description :</td>
                            <td class="style101409">
                                <asp:TextBox ID="TextBox7" runat="server" Height="44px" TextMode="MultiLine" 
                                    Width="311px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style101407">
                                &nbsp;</td>
                            <td class="style101409">
                                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                                    style="font-weight: 700" Text="Submit" Width="156px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style101405">
                                &nbsp;</td>
                            <td class="style101409">
                                <asp:TextBox ID="TextBox2" runat="server" Visible="False"></asp:TextBox>
                                <asp:TextBox ID="TextBox5" runat="server" Visible="False"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                    <table class="style3">
                        <tr>
                            <td>
                                <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
                                    BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" 
                                    CellPadding="4" CellSpacing="2" DataKeyNames="Sr_No" 
                                    DataSourceID="AccessDataSource1" ForeColor="Black" Width="719px">
                                    <RowStyle BackColor="White" />
                                    <Columns>
                                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                        <asp:BoundField DataField="Sr_No" HeaderText="Sr_No" ReadOnly="True" 
                                            SortExpression="Sr_No" />
                                        <asp:TemplateField HeaderText="Image" SortExpression="Image">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Image") %>'></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Image ID="Image3" runat="server" Height="160px" 
                                                    ImageUrl='<%# Eval("Image", "../gallery/{0}") %>' Width="209px" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="functiion_name" HeaderText="Functiion Name" 
                                            SortExpression="functiion_name" />
                                             <asp:BoundField DataField="Description" HeaderText="Description" 
                                            SortExpression="Description" />
                                    </Columns>
                                    <FooterStyle BackColor="#CCCCCC" />
                                    <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                                </asp:GridView>
                                <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
                                    ConflictDetection="CompareAllValues" DataFile="~/App_Data/superwit.mdb" 
                                    DeleteCommand="DELETE FROM [gallery] WHERE [Sr_No] = ? " 
                                    InsertCommand="INSERT INTO [gallery] ([Sr_No], [Image], [functiion_name],[Description]) VALUES (?, ?, ?, ?)" 
                                    OldValuesParameterFormatString="original_{0}" 
                                    SelectCommand="SELECT [Sr_No], [Image], [functiion_name],[Description] FROM [gallery] ORDER BY [functiion_name]" 
                                    UpdateCommand="UPDATE [gallery] SET [Image] = ?, [functiion_name] = ?, [Description]=? WHERE [Sr_No] = ? ">
                                    <DeleteParameters>
                                        <asp:Parameter Name="original_Sr_No" Type="Int32" />
                                        <asp:Parameter Name="original_Image" Type="String" />
                                        <asp:Parameter Name="original_functiion_name" Type="String" />
                                        <asp:Parameter Name="original_Description" Type="String" />
                                    </DeleteParameters>
                                    <UpdateParameters>
                                        <asp:Parameter Name="Image" Type="String" />
                                        <asp:Parameter Name="functiion_name" Type="String" />
                                         <asp:Parameter Name="Description" Type="String" />
                                        <asp:Parameter Name="original_Sr_No" Type="Int32" />
                                        <asp:Parameter Name="original_Image" Type="String" />
                                        <asp:Parameter Name="original_functiion_name" Type="String" />
                                        <asp:Parameter Name="Description" Type="String" />
                                    </UpdateParameters>
                                    <InsertParameters>
                                        <asp:Parameter Name="Sr_No" Type="Int32" />
                                        <asp:Parameter Name="Image" Type="String" />
                                        <asp:Parameter Name="functiion_name" Type="String" />
                                        <asp:Parameter Name="Description" Type="String" />
                                    </InsertParameters>
                                </asp:AccessDataSource>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="Panel2" runat="server" Visible="False">
                    <table class="style3" style="width: 725px">
                        <tr>
                            <td class="style101413">
                                <b>Add Category :</b></td>
                            <td class="style101412">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style101408">
                                Enter New Category Name :</td>
                            <td class="style101412">
                                <asp:TextBox ID="TextBox6" runat="server" Width="329px" AutoPostBack="True" 
                                    ontextchanged="TextBox6_TextChanged"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style101413">
                                &nbsp;</td>
                            <td class="style101412">
                                <asp:Label ID="Label2" runat="server" Text="Label" Visible="False"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="style101413">
                                &nbsp;</td>
                            <td class="style101412">
                                <asp:Button ID="Button2" runat="server" 
                                    style="font-weight: 700; font-family: Verdana; font-size: 10pt" Text="Submit" 
                                    Width="161px" onclick="Button2_Click" Visible="False" />
                            </td>
                        </tr>
                    </table>
                    <table class="style3">
                        <tr>
                            <td>
                                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                    BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" 
                                    CellPadding="4" CellSpacing="2" DataKeyNames="Category_Name" 
                                    DataSourceID="AccessDataSource3" ForeColor="Black" Width="715px" 
                                    Font-Bold="False" style="text-align: left">
                                    <FooterStyle BackColor="#CCCCCC" />
                                    <RowStyle BackColor="White" />
                                    <Columns>
                                        <asp:BoundField DataField="Category_Name" HeaderText="Category Name" 
                                            ReadOnly="True" SortExpression="Category_Name" />
                                    </Columns>
                                    <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                                </asp:GridView>
                                <asp:AccessDataSource ID="AccessDataSource3" runat="server" 
                                    ConflictDetection="CompareAllValues" DataFile="~/App_Data/superwit.mdb" 
                                    DeleteCommand="DELETE FROM [Category] WHERE [Category_Name] = ?" 
                                    InsertCommand="INSERT INTO [Category] ([Category_Name]) VALUES (?)" 
                                    OldValuesParameterFormatString="original_{0}" 
                                    
                                    
                                    SelectCommand="SELECT Category_Name FROM categories WHERE (Category_Name &lt;&gt; ?)">
                                    <SelectParameters>
                                        <asp:Parameter DefaultValue="-" Name="?" />
                                    </SelectParameters>
                                    <DeleteParameters>
                                        <asp:Parameter Name="original_Category_Name" Type="String" />
                                    </DeleteParameters>
                                    <InsertParameters>
                                        <asp:Parameter Name="Category_Name" Type="String" />
                                    </InsertParameters>
                                </asp:AccessDataSource>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
    
</asp:Content>

