public void LoadvpnData() { VPNsRepository vpnir = new VPNsRepository(); Session["VPNData"] = vpnir.GetAllvpns(); GridView1.DataSource = Session["VPNData"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", vpnir.VPNCount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["VPNData"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount); }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { lblmessage.Text = ""; if (txtsearch.Text.Length > 0) { if (DropDownList1.SelectedValue == "0") { try { VPNsRepository vpnir = new VPNsRepository(); Session["ecid"] = vpnir.Searchusername(txtsearch.Text); GridView1.DataSource = Session["ecid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", vpnir.VPNCount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["ecid"] 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 { VPNsRepository vpnir = new VPNsRepository(); Session["ecutid"] = vpnir.SearchUserTypeid(txtsearch.Text.ToInt()); GridView1.DataSource = Session["ecutid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", vpnir.VPNCount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["ecutid"] 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 == "2") { try { VPNsRepository vpnir = new VPNsRepository(); Session["ecuid"] = vpnir.SearchUserid(txtsearch.Text.ToInt()); GridView1.DataSource = Session["ecuid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", vpnir.VPNCount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["ecuid"] 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 { LoadvpnData(); } }