예제 #1
0
    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_OverTime(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.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();
        }
    }
예제 #2
0
    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_OverTime(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text)
                                                                , sortbycoloumn, sortdirection, 1, UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CountTotalRec), ref rowcount);


        string[] HeaderCaptions  = { "Vessel", "Staff Code", "Staff Name", "Rank", "Ship's Clocked Hours", "Rest Hours", "Work Hours", "Overtime (Hours)" };
        string[] DataColumnsName = { "Vessel_Name", "Staff_Code", "Staff_Name", "Staff_rank_Code", "Total_SHIPS_CLOCKED_HOURS", "Total_REST_HOURS", "Total_WORKING_HOURS", "Total_OVERTIME" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Overtime", "Over Time Details from  " + UDFLib.ConvertDateToNull(txtfrom.Text).Value.ToString("dd/MMM/yyyy") + " to " + UDFLib.ConvertDateToNull(txtto.Text).Value.ToString("dd/MMM/yyyy"), "");
    }