protected void Button1_Click(object sender, EventArgs e) { string user = TextBox1.Text ; string pass = TextBox2.Text ; int id = int.Parse(user); customer_keeper dk = new customer_keeper(); int ch = dk.search_user(id, pass); if (ch == 1) { Session["logged"] = 1; Session["user"] = "******" + id.ToString(); Session["user_id"] = id; customer_class cc = dk.GetData(id); Session["dealer_id"] = cc._dealer_id; Response.Redirect("~/customer/account_history.aspx"); } else if (ch == 2) { Session["logged"] = 0; Label3.Text = "This account has not been verified yet."; } else { Session["logged"] = 0; Label3.Text = "Invalid Username or Password"; } }
protected void Page_Load(object sender, EventArgs e) { if (Session.IsNewSession) { Response.Redirect("~/cust_login.aspx"); } else { if (!IsPostBack) { if (Session["logged"] == null) { Session["logged"] = 0; Session["user"] = ""; Session["user_id"] = 0; } if (int.Parse(Session["logged"].ToString()) == 1) { user.Text = Session["user"].ToString(); TextBox1.Text = Session["user_id"].ToString(); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(int.Parse(Session["user_id"].ToString())); Session["customer"] = cc; TextBox2.Text = cc._renewal.ToString(); if (DateTime.Today < cc._renewal) Button1.Enabled = false; } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session.IsNewSession) { Response.Redirect("~/cust_login.aspx"); } else { if (!IsPostBack) { if (Session["logged"] == null) { Session["logged"] = 0; Session["user"] = ""; Session["user_id"] = 0; } if (int.Parse(Session["logged"].ToString()) == 1) { user.Text = Session["user"].ToString(); TextBox1.Text = Session["user_id"].ToString(); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(int.Parse(Session["user_id"].ToString())); Session["customer"] = cc; TextBox2.Text = cc._name; TextBox3.Text = cc._pass; TextBox5.Text = cc._email; TextBox6.Text = cc._contact; } } } }
protected void Button1_Click(object sender, EventArgs e) { order_cust_keeper ok = new order_cust_keeper(); cylinder_dealer_keeper ck = new cylinder_dealer_keeper(); customer_keeper cust = new customer_keeper(); customer_class cc = cust.GetData(int.Parse(Session["user_id"].ToString())); cc._booking_count++; if (cc._subsidy_count > 0) { cc._subsidy_count--; } int cylinder_id = ck.assign(cc._dealer_id ); int id = ok.get_id(); ok.insert(id, int.Parse(Session["user_id"].ToString()), cylinder_id); TextBox7.Text = cylinder_id.ToString (); TextBox4.Text = id.ToString() ; cust.update(cc); }
protected void Button1_Click(object sender, EventArgs e) { customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(int.Parse(TextBox1.Text)); if (CheckBox1.Checked) { cc._pass = TextBox3.Text; } cc._email = TextBox5.Text; cc._contact = TextBox6.Text; ck.update(cc); Label8.Text = "Account Successfully Updated!"; }
protected void Page_Load(object sender, EventArgs e) { if (Session.IsNewSession) { Response.Redirect("~/cust_login.aspx"); } else { if (!IsPostBack) { if (Session["logged"] == null) { Session["logged"] = 0; Session["user"] = ""; Session["user_id"] = 0; Session["dealer_id"] = 0; } if (int.Parse(Session["logged"].ToString()) == 1) { user.Text = Session["user"].ToString(); TextBox1.Text = Session["user_id"].ToString(); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(int.Parse(Session["user_id"].ToString())); TextBox2.Text = cc._name; TextBox3.Text = cc._address; if (cc._subsidy_count > 0) TextBox6.Text = "Rs 410/-"; else TextBox6.Text = "Rs 990/-"; if (cc._status.Equals("PENDING")) { Label8.Text = "Sorry, but your account is not yet active! Please wait for your dealer to verify!"; Button1.Enabled = false; } } } } }
public void insert(int id,int customer_id,int cylinder_id) { SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=egas;Integrated Security=True;Pooling=False"); SqlCommand cmd = new SqlCommand("insert into order_from_customer_to_dealer values (@var1,@var2,@var3,@var4,@var5,@var6)", con); con.Open(); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(customer_id); cmd.Parameters.AddWithValue("@var1", id); cmd.Parameters.AddWithValue("@var2", customer_id); cmd.Parameters.AddWithValue("@var3", DateTime.Today); cmd.Parameters.AddWithValue("@var4", "PENDING"); cmd.Parameters.AddWithValue("@var5", cylinder_id ); cmd.Parameters.AddWithValue("@var6", cc._dealer_id); cmd.ExecuteNonQuery(); con.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["comp_type"] = "Un-Delivered"; if (Session["logged"] == null) { Session["logged"] = 0; Session["user"] = ""; Session["user_id"] = 0; } if (int.Parse(Session["logged"].ToString()) == 1) { user.Text = Session["user"].ToString(); TextBox3.Text = (Session["user_id"].ToString()); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(int.Parse(Session["user_id"].ToString())); TextBox4.Text = cc._dealer_id.ToString (); Session["cc"] = cc; } } }
protected void Page_Load(object sender, EventArgs e) { if (Session.IsNewSession) { Response.Redirect("~/cust_login.aspx"); } else { if (!IsPostBack) { if (Session["logged"] == null) { Session["logged"] = 0; Session["user"] = ""; Session["user_id"] = 0; } if (int.Parse(Session["logged"].ToString()) == 1) { user.Text = Session["user"].ToString(); TextBox1.Text = Session["user_id"].ToString(); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(int.Parse(Session["user_id"].ToString())); Label3.Text = cc._renewal.ToString(); Label5.Text = cc._subsidy_count.ToString(); Label7.Text = cc._booking_count.ToString(); dealer_keeper dk = new dealer_keeper(); dealer_class dc = dk.GetFullDealerData(cc._dealer_id); Label9.Text = dc._name.ToString() + ", " + dc._city + ", " + dc._state; GetData(int.Parse(Session["user_id"].ToString())); SetData(); } } } }
public customer_class getdata(int id) { customer_keeper ck = new customer_keeper(); return ck.GetData(id); }