Lab Report No. 05

This report contains the code for all files used in Lab 05.

1. FoodSearch.aspx

This file contains the HTML and CSS for the Food Search interface.

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="FoodSearch.aspx.vb" Inherits="FoodSearch" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Search Foods</title>
    <style>
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #f1f3f6;
            margin: 0;
            padding: 0;
            color: #333;
        }
        ...
    </style>
</head>
<body>
    <header>Search Available Foods</header>

    <div class="container">
        <h2>Food Search</h2>
        <form id="form1" runat="server">
            <div class="form-group">
                <label for="txtFoodID">Food ID:</label>
                <asp:TextBox ID="txtFoodID" runat="server" />
            </div>
            ...
        </form>
    </div>
</body>
</html>
        

2. FoodSearch.aspx.vb

This file contains the code-behind logic for the Food Search interface.

Imports System.Data

Partial Class FoodSearch
    Inherits System.Web.UI.Page

    Protected Sub btnSearch_Click(sender As Object, e As EventArgs)
        Dim foodID As String = txtFoodID.Text.Trim()
        Dim category As String = txtCategory.Text.Trim()
        Dim restaurant As String = txtRestaurant.Text.Trim()

        ' Sample DataTable with mock food data
        Dim dt As New DataTable()
        dt.Columns.Add("FoodID")
        dt.Columns.Add("Category")
        dt.Columns.Add("Restaurant")
        dt.Columns.Add("Availability")

        ' Sample rows (replace with DB query later)
        dt.Rows.Add("F101", "Pizza", "Cheese Factory", "Available")
        dt.Rows.Add("F102", "Burger", "Grill House", "Unavailable")
        dt.Rows.Add("F103", "Biryani", "Pak Dhaba", "Available")

        ' Bind data to GridView
        GridView1.DataSource = dt
        GridView1.DataBind()
    End Sub
End Class
        

3. UserRegistration.aspx

This file contains the HTML and CSS for the User Registration interface.

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="UserRegistration.aspx.vb" Inherits="UserRegistration" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Food Reservation System</title>
    <style>
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #f1f3f6;
            margin: 0;
            padding: 0;
            color: #333;
        }
        ...
    </style>
</head>
<body>
    <header>Food Reservation System</header>

    <div class="container">
        <h2>User Registration</h2>
        <form runat="server">
            <div class="form-group">
                <label for="txtName">Name:</label>
                <asp:TextBox ID="txtName" runat="server" />
            </div>
            ...
        </form>
    </div>
</body>
</html>
        

4. UserRegistration.aspx.vb

This file contains the code-behind logic for the User Registration interface.

Partial Class UserRegistration
    Inherits System.Web.UI.Page

    Protected Sub btnRegister_Click(sender As Object, e As EventArgs)
        ' Fetch user input
        Dim name As String = txtName.Text.Trim()
        Dim email As String = txtEmail.Text.Trim()
        Dim phone As String = txtPhone.Text.Trim()
        Dim address As String = txtAddress.Text.Trim()
        Dim gender As String = ddlGender.SelectedValue
        Dim dob As String = txtDOB.Text

        ' Here you can add logic to store into DB
        ' For now, simple success message
        Response.Write("<script>alert('User Registered Successfully!');</script>")

        ' Clear form fields
        txtName.Text = ""
        txtEmail.Text = ""
        txtPhone.Text = ""
        txtAddress.Text = ""
        txtDOB.Text = ""
        ddlGender.SelectedIndex = 0
    End Sub
End Class
        

5. MainMenu.aspx

This file contains the HTML and CSS for the Main Menu interface.

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="MainMenu.aspx.vb" Inherits="MainMenu" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Main Menu - Food Reservation System</title>
    <style>
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #f1f3f6;
            margin: 0;
            padding: 0;
            color: #333;
        }
        ...
    </style>
</head>
<body>
    <header>Food Reservation System</header>

    <div class="container">
        <h2>Main Menu</h2>
        <p>Welcome to the Food Reservation System. Please choose an option below to continue:</p>

        <div class="action-btns">
            <a href="UserRegistration.aspx">
                <button class="sub-btn">User Registration</button>
            </a>
            <a href="FoodSearch.aspx">
                <button class="sub-btn">Food Search</button>
            </a>
        </div>
    </div>
</body>
</html>
        

6. MainMenu.aspx.vb

This file contains the code-behind logic for the Main Menu interface.

Imports System

Partial Public Class MainMenu
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As EventArgs)
        ' You can add any page load logic here if needed
    End Sub
End Class
        
Web hosting by Somee.com