public void BindGrid() { int rowcount = ucCustomPagerItems.isCountRecord; //int? isfavorite = null; if (ddlFavorite.SelectedValue != "2") isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString()); //int? Rulecode = null; if (ddlSearchRule.SelectedValue != "0") Rulecode = Convert.ToInt32(ddlSearchRule.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 = BLL_QMS_RestHours.GetRestHoursRulesSearch(null, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (ds.Tables[0].Rows.Count > 0) { GridViewRHRules.DataSource = ds.Tables[0]; GridViewRHRules.DataBind(); } else { GridViewRHRules.DataSource = ds.Tables[0]; GridViewRHRules.DataBind(); } }
public void BindGrid() { int rowcount = ucCustomPagerItems.isCountRecord; string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].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 = BLL_QMS_RestHours.GetRestHoursRulesSearch(null, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (ds.Tables[0].Rows.Count > 0) { gvDeckLogBook.DataSource = ds.Tables[0]; gvDeckLogBook.DataBind(); } else { gvDeckLogBook.DataSource = ds.Tables[0]; gvDeckLogBook.DataBind(); } }
protected void ImgExpExcel_Click(object sender, EventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; //int? isfavorite = null; if (ddlFavorite.SelectedValue != "2") isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString()); //int? Rulecode = null; if (ddlSearchRule.SelectedValue != "0") Rulecode = Convert.ToInt32(ddlSearchRule.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 = BLL_QMS_RestHours.GetRestHoursRulesSearch(null, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); string[] HeaderCaptions = { "Description", "Value", "Period" }; string[] DataColumnsName = { "Rule_Description", "Rule_Value", "Rule_Period" }; GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "Rest Hour rules", "Resthour rules", ""); }