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); }
public int add_cylinder(int id,int count) { cylinder_comp_keeper ck = new cylinder_comp_keeper(); cylinder_dealer_keeper dk = new cylinder_dealer_keeper(); if (ck.get_count() == 0) { return 0; } else { for (int i = 0; i < count; i++) { cylinder_class cyl = ck.extract(); ck.update(cyl._id, id); dk.insert(cyl, id); } return 1; } }
private void GetData(int ch) { if (ch != 0) { cylinder_dealer_keeper cd = new cylinder_dealer_keeper(); ArrayList arr = cd.GetData(ch) ; Session["da"] = arr[0]; Session["ds"] = arr[1]; } else { cylinder_comp_keeper ck = new cylinder_comp_keeper(); ArrayList arr = ck.GetData(ch); Session["da"] = arr[0]; Session["ds"] = arr[1]; } }
public void update(dealer_class dc) { SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=egas;Integrated Security=True;Pooling=False"); SqlDataAdapter da = new SqlDataAdapter("select * from dealer", con); DataSet ds = new DataSet(); da.Fill(ds, "dealer"); cylinder_dealer_keeper cdk = new cylinder_dealer_keeper(); dc._stock_no = cdk.count(dc._id); foreach (DataRow dr in ds.Tables[0].Rows) { if (int.Parse(dr[0].ToString()) == dc._id) { dr.BeginEdit(); dr[1] = dc._name; dr[2] = dc._address; dr[3] = dc._city; dr[4] = dc._state; dr[5] = dc._pincode; dr[6] = dc._stock_no; dr[7] = dc._password; dr[8] = dc._status; dr[9] = dc._contact; dr.EndEdit(); } } SqlCommandBuilder cb = new SqlCommandBuilder(da); da.Update(ds.Tables[0]); }
public void update_count(int id) { SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=egas;Integrated Security=True;Pooling=False"); SqlDataAdapter da = new SqlDataAdapter("select * from dealer", con); DataSet ds = new DataSet(); da.Fill(ds, "dealer"); cylinder_dealer_keeper cdk = new cylinder_dealer_keeper(); int stock = cdk.count(id); foreach (DataRow dr in ds.Tables[0].Rows) { if (int.Parse(dr[0].ToString()) == id) { dr.BeginEdit(); dr[6] = stock; dr.EndEdit(); } } SqlCommandBuilder cb = new SqlCommandBuilder(da); da.Update(ds.Tables[0]); }