Академический Документы
Профессиональный Документы
Культура Документы
Net &
SQL CSE Final Year Project
November 15, 2011 by Thousand Projects
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class customer_CostomerRegistration : System.Web.UI.Page
{
SqlConnection
con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString)
;
SqlCommand cmd;
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Label1.Text == "Username is Available.")
{
if (TextBox1.Text != "" && TextBox2.Text != "")
{
cmd = new SqlCommand("insert into
tbl_login(uname,password,gender,email,status,type,cdate)values('"+TextBox1.Text+"','"+Tex
tBox2.Text+"','"+DropDownList1.SelectedItem.ToString()
+"','"+TextBox5.Text+"','Activate','Customer',getdate())", con);
con.Open();
int user = cmd.ExecuteNonQuery();
con.Close();
if (user == 1)
{
cmd = new SqlCommand("insert into
tbl_contact(uid,country,state,city,contactno,cdate)values(" +
Convert.ToInt32(GetUid(TextBox1.Text)) + ",'" + TextBox6.Text + "','" +
TextBox7.Text + "','" + TextBox8.Text + "','" + TextBox9.Text + "',getdate())", con);
user = 0;
con.Open();
user = cmd.ExecuteNonQuery();
if (user == 1)
{
string s = "Your Registration successfully completed.";
Response.Redirect("~/customer/CustomerLogin.aspx?rconfirm=" + s.ToString());
}
}
}
}
else
{
Label2.Text = "The Username is already taken.Choose another Name.";
}
}
private int GetUid(string uname)
{
cmd = new SqlCommand("select uid from tbl_login where uname='" + uname.ToString() + "'
and type='Customer' ", con);
con.Open();
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
int n = 0;
if (dr.Read())
{
n= Convert.ToInt32(dr[0].ToString());
}
dr.Close();
return n;
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Software Requirements:
Operating System : Windows 2000/xp/Vista
Front End Software
Database
Hardware Requirements:
Processor
Memory
: 256 MB
Hard Disk
: 40 GB
Download Hotel Management System C#.Net & SQL CSE Final Year Project