예제 #1
0
    public void BindVesselGrid()
    {
        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.SearchVessel(txtfilter.Text != "" ? txtfilter.Text : null, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue)
        //    , UDFLib.ConvertIntegerToNull(ddlFilterVesselManager.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVesselFlag.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFilterVesselManager.SelectedValue), null, UDFLib.ConvertIntegerToNull(ddlvesselType.SelectedValue)
        //    , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref  rowcount);

        DataTable dt = objBLL.Search_SURVEY_Vessel(txtfilter.Text != "" ? txtfilter.Text : null, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue)
                                                   , UDFLib.ConvertIntegerToNull(ddlFilterVesselManager.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVesselFlag.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFilterVesselManager.SelectedValue), null, UDFLib.ConvertIntegerToNull(ddlvesselType.SelectedValue)
                                                   , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, Session["USERCOMPANYID"].ToString(), ref rowcount);

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

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