async void SelectOne(object sender, EventArgs args) { ImagePreviwer.SetValue(IsVisibleProperty, true); PreviuseButton.SetValue(IsVisibleProperty, true); NextButton.SetValue(IsVisibleProperty, true); SelectGrid.SetValue(IsVisibleProperty, false); }
protected void btngo_Click(object sender, EventArgs e) { try { DataSet dscon = new DataSet(); DataTable data = new DataTable(); DataRow drow; string seltqry = ""; data.Columns.Add("Consultant"); data.Columns.Add("Agent"); data.Columns.Add("pincode"); data.Columns.Add("Address"); data.Columns.Add("City"); data.Columns.Add("District"); data.Columns.Add("State"); data.Columns.Add("Phone"); data.Columns.Add("Email"); data.Columns.Add("Remark"); data.Columns.Add("considno"); if (txt_Consultant.Text != "") { seltqry = "select * from Student_Refer_Details where refer_name='" + txt_Consultant.Text + "'"; } else if (TextAgent.Text != "") { seltqry = "select * from Student_Refer_Details where refer_agent_name='" + TextAgent.Text + "'"; } else if (txt_Consultant.Text != "" && TextAgent.Text != "") { seltqry = "select * from Student_Refer_Details where refer_name='" + txt_Consultant.Text + "' and refer_agent_name='" + TextAgent.Text + "'"; } else { seltqry = "select * from Student_Refer_Details"; } dscon.Clear(); dscon = d2.select_method_wo_parameter(seltqry, "Text"); if (dscon.Tables.Count > 0 && dscon.Tables[0].Rows.Count > 0) { for (int i = 0; i < dscon.Tables[0].Rows.Count; i++) { drow = data.NewRow(); drow["Consultant"] = dscon.Tables[0].Rows[i]["refer_name"]; drow["Agent"] = dscon.Tables[0].Rows[i]["refer_agent_name"]; drow["pincode"] = dscon.Tables[0].Rows[i]["agent_pincode"]; drow["Address"] = dscon.Tables[0].Rows[i]["agent_address"]; drow["City"] = dscon.Tables[0].Rows[i]["agent_city"]; drow["District"] = dscon.Tables[0].Rows[i]["agent_district"]; drow["State"] = dscon.Tables[0].Rows[i]["agent_state"]; drow["Phone"] = dscon.Tables[0].Rows[i]["refer_phoneno"]; drow["Email"] = dscon.Tables[0].Rows[i]["refer_email"]; drow["Remark"] = dscon.Tables[0].Rows[i]["refer_remark"]; drow["considno"] = dscon.Tables[0].Rows[i]["IdNo"]; data.Rows.Add(drow); } if (data.Columns.Count > 0 && data.Rows.Count > 0) { SelectGrid.DataSource = data; SelectGrid.DataBind(); SelectGrid.Visible = true; griddiv.Visible = true; } } else { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), UniqueID, "alert('No Record Found!')", true); } } catch { } }