Ejemplo n.º 1
0
    /// <summary>
    /// Bind Oil Majors
    /// </summary>
    public void BindOilMajorsRuleGroup()
    {
        try
        {
            int rowcount = ucCustomPagerItems.isCountRecord;

            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.CRUD_OilMajorsRuleGroup("", 0, "R", 0, 0, txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection
                                                          , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount, ref Result);


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

            if (dt.Rows.Count > 0)
            {
                gvOilMajorsRuleGroup.DataSource = dt;
                gvOilMajorsRuleGroup.DataBind();
                ImgExpExcel.Visible = true;
            }
            else
            {
                gvOilMajorsRuleGroup.DataSource = null;
                gvOilMajorsRuleGroup.DataBind();
                ImgExpExcel.Visible = false;
            }
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }