Exemple #1
0
    public void BindUnit()
    {
        int rowcount     = ucCustomPagerItems.isCountRecord;
        int Record_Count = 0;
        //int? isfavorite = null; if (ddlFavorite.SelectedValue != "2") isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString());
        //int? countrycode = null; if (ddlSearchCountry.SelectedValue != "0") countrycode = Convert.ToInt32(ddlSearchCountry.SelectedValue.ToString());

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }


        DataSet ds = objBLL.GetAlarmUnits(txtUnit.Text.Trim(), ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize);

        //     , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref  rowcount);


        //Commented by by anjali DT : 02-05-2016 JIT:9296
        //if (ucCustomPagerItems.isCountRecord == 1)
        //{
        //    if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[1].Rows[0]["Column1"])))
        //    {
        //        ucCustomPagerItems.CountTotalRec = ds.Tables[1].Rows[0]["Column1"].ToString();
        //        ucCustomPagerItems.BuildPager();
        //    }
        //}


        //if (ds.Tables[0].Rows.Count > 0)
        //{
        //    GridViewcurrency.DataSource = ds.Tables[0];
        //    GridViewcurrency.DataBind();
        //}
        //else
        //{
        //    GridViewcurrency.DataSource = ds.Tables[0];
        //    GridViewcurrency.DataBind();
        //}
        //Commented by by anjali DT : 02-05-2016 JIT:9296

        //Added by anjali DT : 02-05-2016 JIT:9296
        GridViewcurrency.DataSource = ds.Tables[0];
        GridViewcurrency.DataBind();

        if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[1].Rows[0]["Column1"])))
        {
            Record_Count = Convert.ToInt32(ds.Tables[1].Rows[0]["Column1"].ToString());
        }

        ucCustomPagerItems.CountTotalRec = Record_Count.ToString();
        ucCustomPagerItems.BuildPager();
        //Added by anjali DT : 02-05-2016 JIT:9296
    }
Exemple #2
0
    public void BindCurrency()
    {
        int rowcount   = ucCustomPagerItems.isCountRecord;
        int?isfavorite = null; if (ddlFavorite.SelectedValue != "2")
        {
            isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString());
        }
        int?countrycode = null; if (ddlSearchCountry.SelectedValue != "0")
        {
            countrycode = Convert.ToInt32(ddlSearchCountry.SelectedValue.ToString());
        }

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }


        DataTable dt = objBLL.SearchCurrency(txtfilter.Text != "" ? txtfilter.Text : null, countrycode, isfavorite, sortbycoloumn, sortdirection
                                             , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }


        if (dt.Rows.Count > 0)
        {
            GridViewcurrency.DataSource = dt;
            GridViewcurrency.DataBind();
        }
        else
        {
            GridViewcurrency.DataSource = dt;
            GridViewcurrency.DataBind();
        }
    }