protected void Button1_Click(object sender, EventArgs e) { for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox chk = ((CheckBox)(GridView1.Rows[i].FindControl("CheckBox1"))); if (chk.Checked) { GridViewRow gr = GridView1.Rows[i]; int customer_id = int.Parse(((Label)(gr.FindControl("Label2"))).Text); int porting_id = int.Parse(((Label)(gr.FindControl("Label1"))).Text); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(customer_id ); dealer_keeper dk = new dealer_keeper(); port_keeper pk = new port_keeper(); port_class pc = pk.GetDataFull(porting_id); cc._address = pc._new_address; cc._dealer_id = pc._new_dist_id; dealer_class dc = dk.GetFullDealerData(pc._new_dist_id); cc._dist = dc._name; pc._status = "Accepted"; pk.update(pc); ck.update(cc); GetData(); } } }
protected void Button3_Click(object sender, EventArgs e) { for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox chk = ((CheckBox)(GridView1.Rows[i].FindControl("CheckBox1"))); if (chk.Checked) { GridViewRow gr = GridView1.Rows[i]; int id = int.Parse(((Label)(gr.FindControl("Label7"))).Text); customer_keeper ck = new customer_keeper(); customer_class cc = ck.GetData(id); cc._status = "Accepted"; cc._dealer_id = int.Parse(Session["dealer_id"].ToString()); cc._renewal = DateTime.Today.AddMonths(12); ck.update(cc); GetData(); SetData(); } } }