0% found this document useful (0 votes)
2 views3 pages

User Interface and Data Handling Code

The document outlines a web application that includes a user interface for inputting personal information, a business class for handling data logic, and a data access layer for database interactions. It features a form with fields for ID, names, sex, date of birth, age, and address, along with a submit button. The business class manages data insertion and error handling, while the data access layer executes SQL commands to store the information in a database.

Uploaded by

aginchewlewutie3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

User Interface and Data Handling Code

The document outlines a web application that includes a user interface for inputting personal information, a business class for handling data logic, and a data access layer for database interactions. It features a form with fields for ID, names, sex, date of birth, age, and address, along with a submit button. The business class manages data insertion and error handling, while the data access layer executes SQL commands to store the information in a database.

Uploaded by

aginchewlewutie3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

USER INTERFACE

<%@ Page Title="" Language="C#" MasterPageFile="~/[Link]" AutoEventWireup="true"


CodeBehind="user [Link]" Inherits="Mid_Exam.user_int" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<table>
<tr><td>ID</td><td><asp:TextBox ID="id" runat="server"></asp:TextBox></td></tr>
<tr><td>First Name</td><td><asp:TextBox ID="Fname" runat="server"></asp:TextBox></td></tr>
<tr><td>Middle Name</td><td><asp:TextBox ID="Mname" runat="server"></asp:TextBox></td></tr>
<tr><td>Last Name</td><td><asp:TextBox ID="Lname" runat="server"></asp:TextBox></td></tr>
<tr><td>Sex</td><td><asp:TextBox ID="sex" runat="server"></asp:TextBox></td></tr>
<tr><td>Date of Birth</td><td><asp:TextBox ID="dbt" runat="server"></asp:TextBox></td></tr>
<tr><td>Age</td><td><asp:TextBox ID="age" runat="server"></asp:TextBox></td></tr>
<tr><td>Address</td><td><asp:TextBox ID="address" runat="server"></asp:TextBox></td></tr>
<td><asp:Button ID="Button" Text="Submit" runat="server" /></td>
<td><asp:Label ID="label" runat="server"></asp:Label></td>
</table>
</asp:Content>

BUSINESS CLASS
using System;
using [Link];
using [Link];
using [Link];
using Mid_Exam.data_mid;
namespace Mid_Exam.bis_mid
{
public class bmid
{
public string id;
public string fname;
public string mname;
public string lname;
public string sex;
public DateTime dbt;
public int age;
public string address;
public string n;
dmid g = new dmid();
public string inser(bmid j)
{
try
{
[Link](j);
n = " completelly inserted";
}
catch(Exception)
{
n = "not inserted";
}
return n;
}

}
}
DATA ACCESS LAYER
using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using Mid_Exam.bis_mid;
namespace Mid_Exam.data_mid
{
public class dmid
{
SqlConnection con = new
SqlConnection([Link][""].ConnectionString);
public void insert (bmid p)
{
[Link]();
SqlCommand cmd = new SqlCommand("", con);
[Link] = [Link];
[Link]("@id", [Link]);
[Link]("@fname", [Link]);
[Link]("@mname", [Link]);
[Link]("@lname", [Link]);
[Link]("@sex", [Link]);
[Link]("@dbt", [Link]);
[Link]("@age", [Link]);
[Link]("@address", [Link]);
[Link]();
[Link]();
}
}
}
CODE BEHIND
using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using Mid_Exam.bis_mid;
namespace Mid_Exam
{
public partial class user_int : [Link]
{
bmid x = new bmid();
protected void Page_Load(object sender, EventArgs e)
{
[Link] = [Link];
[Link] = [Link];
[Link] = [Link];
[Link] = [Link];
[Link] = [Link];
[Link] = [Link]([Link]);
[Link] = [Link]([Link]);
[Link] = [Link];
}
}
}

You might also like