Beruflich Dokumente
Kultur Dokumente
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+,+TextBox2. Text+,+DropDownList1.SelectedItem.ToString()+,+TextBox5.Text+,Activate,'Customer,ge tdate()), 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) { cmd = new SqlCommand(select uname from tbl_login where uname= + TextBox1.Text + and type=Customer , con); con.Open(); dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (dr.Read()) { Label1.Text = Username is not Available.; Label1.BackColor = System.Drawing.Color.Red; TextBox1.Focus(); } else { Label1.Text = Username is Available.; Label1.BackColor = System.Drawing.Color.Green; TextBox2.Focus(); } dr.Close(); } } Software Requirements: Operating System : Windows 2000/xp/Vista Front End Software : Microsoft Visual studio 2005, C#.Net
Database
Hardware Requirements: Processor Memory Hard Disk : Pentium 4.0(1.6 GHz) and Higher : 256 MB : 40 GB
Click Here To Download Hotel Management System C#.Net & SQL CSE Final Year Project