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()); } DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue) , UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } else { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } }
public void BindGrid() { int rowcount = 0; 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()); } DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(null, null, null, null , null, null, sortbycoloumn, sortdirection , 1, 100, ref rowcount); if (dt.Rows.Count > 0) { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } else { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } }
protected void btnExport_Click(object sender, ImageClickEventArgs e) { 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()); } DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue), UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection , 1, null, ref rowcount); string[] HeaderCaptions = { "Vessel", "Date", "Code", "Crew Name", "Rank", "Ship's Clocked Hours", "Working Hours", "Rest Hours", "Rest Hours Any 24", "Over Time", "Seafarer's Remarks", "Verifier's Remarks" }; string[] DataColumnsName = { "Vessel_Name", "REST_HOURS_DATE", "Staff_Code", "Staff_Name", "Staff_rank_Code", "SHIPS_CLOCKED_HOURS", "WORKING_HOURS", "REST_HOURS", "REST_HOURS_ANY24", "OverTime_HOURS", "Seafarer_Remarks", "Verifier_Remarks" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Rest Hour", "Rest_Hours_Index", ""); //ExcelDataExport objexp = new ExcelDataExport(); //objexp.WriteExcell(dt); }
protected void btnExport_Click(object sender, ImageClickEventArgs e) { 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()); } DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), null, null , UDFLib.ConvertDateToNull(null), UDFLib.ConvertDateToNull(null), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); string[] HeaderCaptions = { "Vessel", "From Date", "To Date", "Remarks" }; string[] DataColumnsName = { "Vessel_Name", "From_Date", "To_Date", "Remarks" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "DeckLogBook", "Deck Log Book", ""); }
protected void btnExport_Click(object sender, ImageClickEventArgs e) { int rowcount = 0; 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()); } DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(null, null, null, null , null, null, sortbycoloumn, sortdirection , 1, 100, ref rowcount); string[] HeaderCaptions = { "Vessel", "From Date", "To Date", "Remarks" }; string[] DataColumnsName = { "Vessel_Name", "From_Date", "To_Date", "Remarks" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "DeckLogBook", "Deck Log Book", ""); }