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 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 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) { if ((TextBox1.Text =="" ) || (TextBox3.Text == "") || (TextBox4.Text == "") || (TextBox5.Text == "") || (TextBox6.Text == "") || (TextBox7.Text == "") || (DropDownList1.SelectedItem.ToString() == "Select") || (DropDownList2.SelectedItem.ToString() == "Select") || (DropDownList3.SelectedItem.ToString() == "Select")) { Label13.Text = "Error in submitting application! Please resubmit!"; } else { customer_keeper ck = new customer_keeper(); int id = ck.get_id(); customer_class cc = new customer_class(); cc._id = id; cc._name = TextBox1.Text; cc._father = TextBox4.Text; cc._address = TextBox3.Text; cc._email = TextBox2.Text; cc._contact = TextBox6.Text; cc._dist = DropDownList3.SelectedItem.ToString(); cc._pin = TextBox5.Text; cc._dob = TextBox7.Text; dealer_keeper dk = new dealer_keeper(); int dealer = dk.GetDealerID(cc._dist); cc._dealer_id = dealer; ck.insert(cc); Label12.Text = "Your New connection request has been submitted for Validation."; Label13.Text = "Customer ID " + id.ToString(); } }
public int register_check(int id) { customer_keeper ck = new customer_keeper(); string res = ck.get_pass(id); if (res == "empty") return 1; else if (res == "error") return 2; else return 0; }
private void GetData() { customer_keeper ck = new customer_keeper(); ArrayList arr = ck.GetDataByDealer(Session["distributor"].ToString()); Session["da"] = arr[0]; Session["ds"] = arr[1]; }
protected void Button2_Click(object sender, EventArgs e) { customer_keeper ck = new customer_keeper(); string pass = TextBox4.Text; customer_class cc = (customer_class)Session["cc"]; cc._pass = pass; ck.update(cc); Label5.Text = "Customer Registered!"; }
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); }