public void LoadTendencyData()
        {
            VEduTendenciesRepository vtr = new VEduTendenciesRepository();

            Session["TendencyData"] = vtr.GetAllTendency();

            GridView1.DataSource = Session["TendencyData"];


            GridView1.DataBind();

            lblrecordcount.Text = string.Format("{0} : {1}", vtr.tendencycount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount);

            lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["TendencyData"] 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
                    {
                        VEduTendenciesRepository vtrir = new VEduTendenciesRepository();
                        Session["Tendencydatafindid"] = vtrir.Searchid(txtsearch.Text.ToInt());
                        GridView1.DataSource          = Session["Tendencydatafindid"];
                        GridView1.DataBind();

                        lblrecordcount.Text       = string.Format("{0} : {1}", vtrir.tendencycount().ToString(), Resources.DashboardText.RecordCount);
                        lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["Tendencydatafindid"] 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
                    {
                        VEduTendenciesRepository vtrir = new VEduTendenciesRepository();

                        Session["Tendencydatafindtitle"] = vtrir.Searchtitle(txtsearch.Text.ToString());
                        GridView1.DataSource             = Session["Tendencydatafindtitle"];
                        GridView1.DataBind();

                        lblrecordcount.Text       = string.Format("{0} : {1}", vtrir.tendencycount().ToString(), Resources.DashboardText.RecordCount);
                        lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["Departmentdatafindtitle"] 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
                    {
                        VEduTendenciesRepository vtrir = new VEduTendenciesRepository();

                        Session["Tendencydatafindtitle"] = vtrir.searchFieldtitle(txtsearch.Text.ToString());
                        GridView1.DataSource             = Session["Tendencydatafindtitle"];
                        GridView1.DataBind();

                        lblrecordcount.Text       = string.Format("{0} : {1}", vtrir.tendencycount().ToString(), Resources.DashboardText.RecordCount);
                        lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["Departmentdatafindtitle"] 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
            {
                LoadTendencyData();
            }
        }