Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="aspnet_administartion._Default" %>
- <%@ Register TagPrefix="txt" TagName="box" Src="~/TxtBox.ascx" %>
- <%@ Register TagPrefix="article" TagName="panel" Src="~/ArticlePanel.ascx" %>
- <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
- <div>
- <div>
- <asp:HiddenField ID="SetFilter" runat="server" />
- <asp:DropDownList ID="Type" runat="server">
- <asp:ListItem Text="FilterType"></asp:ListItem>
- <asp:ListItem Text="Název" Value="name"></asp:ListItem>
- <asp:ListItem Text="Telefon" Value="phone"></asp:ListItem>
- <asp:ListItem Text="Email" Value="mail"></asp:ListItem>
- </asp:DropDownList>
- <asp:TextBox ID="searchString" runat="server"></asp:TextBox>
- <asp:Button ID="ShowAll" runat="server" Text="Zobrazit Vše" OnClick="ShowAll_Click" />
- <asp:Button ID="Filter" runat="server" Text="Filtrovat" OnClick="Filter_Click" />
- </div>
- <asp:GridView ID="GridView1" ShowHeaderWhenEmpty="true" EmptyDataText="žádné vysledky nebyly nalezeny" runat="server" AutoGenerateColumns="False"
- DataSourceID="LinqSource" AllowPaging="true" PageSize="10"
- PagerSettings-FirstPageText="first" PagerSettings-LastPageText="Last"
- PagerSettings-Mode="NumericFirstLast" ShowFooter="True">
- <SelectedRowStyle BackColor="Silver" />
- <Columns>
- <asp:TemplateField HeaderText="Název">
- <ItemTemplate>
- <asp:Label ID="lblName" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
- </ItemTemplate>
- <EditItemTemplate>
- <%--Není specifikovano - ale kdyz nemuzu menit id clanku tak asi ani restauraci bylo by připadne
- snadné povolit pridanim int identity ID aby nebylo pře strig pripojene ke článkům --%>
- <asp:Label ID="lblName" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
- <%-- <txt:box ID="EditName" runat="server" Value='<%#Eval("Name") %>'
- Placeholder="Na Růžku" Regular=".{3,50}"
- ErrorMessege="Jméno musí být 3-50 znaků dlouhé" ></txt:box>--%>
- </EditItemTemplate>
- <FooterTemplate>
- <txt:box ID="NewName" runat="server"
- Placeholder="Na Růžku" Regular=".{3,50}"
- ErrorMessege="Jméno musí být 3-50 znaků dlouhé"></txt:box>
- </FooterTemplate>
- </asp:TemplateField>
- <asp:TemplateField HeaderText="Telefon">
- <ItemTemplate>
- <asp:Label runat="server" Text='<%#Eval("Phone") %>'></asp:Label>
- </ItemTemplate>
- <EditItemTemplate>
- <txt:box ID="EditPhone" runat="server" Value='<%#Eval("Phone") %>'
- Placeholder="123456789" Regular="^[0-9]{3} [0-9]{3} [0-9]{3}$"
- ErrorMessege="Zadejte telefon ve formátu 123 456 789"></txt:box>
- </EditItemTemplate>
- <FooterTemplate>
- <txt:box ID="NewPhone" runat="server"
- Placeholder="123456789" Regular="^[0-9]{3} [0-9]{3} [0-9]{3}$"
- ErrorMessege="Zadejte telefon ve formátu 123 456 789"></txt:box>
- </FooterTemplate>
- </asp:TemplateField>
- <asp:TemplateField HeaderText="Telefon">
- <ItemTemplate>
- <asp:Label runat="server" Text='<%#Eval("Email") %>'></asp:Label>
- </ItemTemplate>
- <EditItemTemplate>
- <txt:box ID="EditEmail" runat="server" Value='<%#Eval("Email") %>'
- Placeholder="info@naruzku.cz" Regular="^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"
- ErrorMessege="Zadejte validní email"></txt:box>
- </EditItemTemplate>
- <FooterTemplate>
- <txt:box ID="NewEmail" runat="server"
- Placeholder="info@naruzku.cz" Regular="^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"
- ErrorMessege="Zadejte validní email"></txt:box>
- </FooterTemplate>
- </asp:TemplateField>
- <asp:TemplateField HeaderText="">
- <ItemTemplate>
- <asp:Button ID="ClosePanel" runat="server" Visible="false" Text="Zavřít" OnClick="ClosePanel_Click" class="center" />
- <asp:Button ID="Edit" runat="server" OnClick="Edit_Click" Text="Editovat" class="center" />
- </ItemTemplate>
- <EditItemTemplate>
- <asp:Button ID="SaveEdit" runat="server" Text="Uložit" class="center" />
- </FooterTemplate>
- </EditItemTemplate>
- <FooterTemplate>
- <asp:Button ID="SaveNew" runat="server" Text="Uložit" OnClick="SaveNew_Click" class="center" />
- </FooterTemplate>
- </asp:TemplateField>
- <asp:TemplateField HeaderText="Akce">
- <ItemTemplate>
- <%--<span class="btn expand">VYTVOŘIT REZERVACI</span>--%>
- <asp:Button ID="ShowFrom" runat="server" Text="Články" OnClick="ShowFrom_Click" class="center" />
- <asp:Button ID="SetNewArticle" runat="server" Visible="false" Text="Nový Článek" OnClick="SetNewArticle_Click" class="center" />
- </td>
- </tr>
- <tr class="hidentr">
- <td colspan="5" class="nopad">
- <asp:Panel ID="EditingPanel" runat="server" Visible="false" CssClass="padding">
- <article:panel runat="server" ID="articlePanel"></article:panel>
- <asp:Button ID="SaveArticle" runat="server" Text="Uložit" OnClick="SaveArticle_Click" />
- </asp:Panel>
- </ItemTemplate>
- <EditItemTemplate>
- <asp:Button ID="CancelEdit" runat="server" Text="Zrušit" OnClick="CancelEdit_Click" class="center" />
- </EditItemTemplate>
- <FooterTemplate>
- <asp:Button ID="CancelNew" runat="server" Text="Zrušit" OnClick="CancelNew_Click" class="center" />
- </FooterTemplate>
- </asp:TemplateField>
- </Columns>
- </asp:GridView>
- <div class="spanbox">
- <span class="error">
- <asp:PlaceHolder ID="errorBox" runat="server"></asp:PlaceHolder>
- </span>
- </div>
- <asp:LinqDataSource ID="LinqSource" runat="server" ContextTypeName="aspnet_administartion.DataClasses1DataContext"
- EntityTypeName="" OnSelecting="LinqSource_Selecting" OnSelected="LinqSource_Selected" Select="new (Name, Phone, Email)" TableName="Restaurants">
- </asp:LinqDataSource>
- </div>
- </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement