protected void ddl_reduce_SelectedIndexChanged1(object sender, EventArgs e) { string u = ddl_reduce.SelectedItem.Value; class_list_locations obj = new class_list_locations(); ds = obj.showdata1(u); if (ds.Tables[0].Rows.Count > 0) { grd_list_tutors.DataSource = ds; grd_list_tutors.DataBind(); lbl_error.Visible = false; } else { grd_list_tutors.DataSource = null; grd_list_tutors.DataBind(); lbl_error.Visible = true; } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string a = ds.Tables[0].Rows[i]["loc_name"].ToString(); int o = obj.findtutors(ds.Tables[0].Rows[i].ItemArray[1].ToString()); if (o > 0) { grd_list_tutors.Rows[i].Cells[4].Text = "<a href='list_tutors.aspx?Loc_id=" + ds.Tables[0].Rows[i].ItemArray[0].ToString() + "'>" + o.ToString() + "</a>"; //o.ToString(); } else { grd_list_tutors.Rows[i].Cells[4].Text = "0"; } } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string a = ds.Tables[0].Rows[i]["loc_name"].ToString(); int o = obj.findstudents(ds.Tables[0].Rows[i].ItemArray[1].ToString()); if (o > 0) { grd_list_tutors.Rows[i].Cells[5].Text = "<a href='list_students.aspx?Loc_id=" + ds.Tables[0].Rows[i].ItemArray[0].ToString() + "'>" + o.ToString() + "</a>"; } else { grd_list_tutors.Rows[i].Cells[5].Text = "0"; } } }
protected void btn_search_Click1(object sender, EventArgs e) { string search = txt_search.Text; class_list_locations obj = new class_list_locations(); ds1 = obj.filter(search); if (ds1.Tables[0].Rows.Count > 0) { grd_list_tutors.DataSource = ds1; grd_list_tutors.DataBind(); lbl_error.Visible = false; } else { grd_list_tutors.DataSource = null; grd_list_tutors.DataBind(); lbl_error.Visible = true; } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string a = ds.Tables[0].Rows[i].ItemArray[1].ToString(); int o = obj.findtutors(ds.Tables[0].Rows[i].ItemArray[1].ToString()); if (o > 0) { grd_list_tutors.Rows[i].Cells[4].Text = "<a href='list_tutors.aspx?Loc_id=" + ds.Tables[0].Rows[i].ItemArray[0].ToString() + "'>" + o.ToString() + "</a>"; //o.ToString(); } else { grd_list_tutors.Rows[i].Cells[4].Text = "0"; } } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string a = ds.Tables[0].Rows[i]["loc_name"].ToString(); int o = obj.findstudents(ds.Tables[0].Rows[i].ItemArray[1].ToString()); if (o > 0) { grd_list_tutors.Rows[i].Cells[5].Text = "<a href='list_students.aspx?Loc_id=" + ds.Tables[0].Rows[i].ItemArray[0].ToString() + "'>" + o.ToString() + "</a>"; } else { grd_list_tutors.Rows[i].Cells[5].Text = "0"; } } }