-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomer.aspx.cs
52 lines (48 loc) · 2.07 KB
/
Customer.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace AlTarwadaWebStore
{
public partial class Customer : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void click_submit_cus(object sender, EventArgs e)
{
string PID = Request.QueryString["PID"];
string Fname=fname.Text;
string Lname = lname.Text;
string tell = telno.Text;
string mail = email.Text;
string emi = city.Text;
string add1 = addr1.Text;
string add2 = addr2.Text;
string contr = cntry.Text;
Session["User"] = tell;
using (SqlConnection connection = new SqlConnection(@"Data Source=DHANYA-SUDHA\SQLEXPRESS01;Initial Catalog=Database_class_Data;Integrated Security=True"))
{
string sql = "INSERT INTO customer_details VALUES(@cust_First_name, @cust_Last_name, @cust_mob, @cust_email, @emirate, @cust_Address1, @cust_Address2, @country)";
using (SqlCommand cmd = new SqlCommand(sql, connection))
{
connection.Open();
cmd.Parameters.AddWithValue("@cust_First_name", Fname);
cmd.Parameters.AddWithValue("@cust_Last_name", Lname);
cmd.Parameters.AddWithValue("@cust_mob", tell);
cmd.Parameters.AddWithValue("@cust_email", mail);
cmd.Parameters.AddWithValue("@emirate", emi);
cmd.Parameters.AddWithValue("@cust_Address1", add1);
cmd.Parameters.AddWithValue("@cust_Address2", add2);
cmd.Parameters.AddWithValue("@country", contr);
cmd.ExecuteNonQuery();
}
}
Response.Redirect("~/ProductView.aspx");
}
}
}