public void LoadFacultyData() { FacultiesRepositpry fir = new FacultiesRepositpry(); Session["FacultyData"] = fir.GetAllFaculties(); GridView1.DataSource = Session["FacultyData"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", fir.FacultyCount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["FacultyData"] 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 { FacultiesRepositpry fir = new FacultiesRepositpry(); Session["Facultydatafindid"] = fir.Searchid(txtsearch.Text.ToInt()); GridView1.DataSource = Session["Facultydatafindid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", fir.FacultyCount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["Facultydatafindid"] 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 { FacultiesRepositpry fir = new FacultiesRepositpry(); Session["Facultydatafindtitle"] = fir.SearchTitle(txtsearch.Text.ToString()); GridView1.DataSource = Session["Facultydatafindtitle"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", fir.FacultyCount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["Facultydatafindtitle"] 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 { LoadFacultyData(); } }