protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { lblmessage.Text = ""; if (txtsearch.Text.Length > 0) { if (DropDownList1.SelectedValue == "0") { try { WebServiceAccountsRepository pair = new WebServiceAccountsRepository(); Session["stddatafindid"] = pair.Searchid(txtsearch.Text.ToInt()); GridView1.DataSource = Session["stddatafindid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", pair.webacountcount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["stddatafindid"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } if (DropDownList1.SelectedValue == "1") { try { PersonsAdminsRepository pair = new PersonsAdminsRepository(); Session["stddatafindcode"] = pair.SearchFirstName(txtsearch.Text); GridView1.DataSource = Session["stddatafindcode"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", pair.PersonAdmincount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["stddatafindcode"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } else { LoadStdData(); } } }
public void LoadStdData() { //try //{ WebServiceAccountsRepository pair = new WebServiceAccountsRepository(); Session["padata"] = pair.GetAlldata(); GridView1.DataSource = Session["padata"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", pair.webacountcount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["padata"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount); //} //catch //{ // Redirector.Goto(Redirector.PageName.errorpage); //} }