Ejemplo n.º 1
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        string sortdirection = null;

        if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = ViewState["SORTDIRECTION"].ToString();
        }



        DataTable dt = BLL_JRA_Hazards.GET_ASSESSMENT_SEARCH(DDLVessel.SelectedIndex <= 0 ? null : DDLVessel.SelectedValue,
                                                             null,
                                                             ddlChildWorkCateg.SelectedIndex <= 0 ? null : ddlChildWorkCateg.SelectedValue, ddlAssessmentStatus.SelectedIndex <= 0 ? null : ddlAssessmentStatus.SelectedValue.ToString(),
                                                             UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text),
                                                             "", GetSessionUserID(),
                                                             null, null, sortbycoloumn,
                                                             sortdirection, ref rowcount).Tables[0];

        string Header = (ddlChildWorkCateg.SelectedIndex > 0 ? ddlChildWorkCateg.SelectedItem.Text : "") + " Risk Assessment";

        string[] HeaderCaptions  = { "Vessel Name  ", "Assessment No.", "Job Assessed", "Current Assessment Date", "Last Assessment Date", "Assessment Status", };
        string[] DataColumnsName = { "Vessel_Name", "Work_Categ_Value", "Work_Category_Name", "Current_Assessment_Date", "Last_Assessment_Date", "Assessment_Status" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "JobRiskAssessmentIndex", Header, "");
    }
Ejemplo n.º 2
0
    public void BindAssessmentTemplateGrid()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        string sortdirection = null;

        if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = ViewState["SORTDIRECTION"].ToString();
        }


        DataTable dt = BLL_JRA_Hazards.GET_ASSESSMENT_SEARCH(DDLVessel.SelectedIndex <= 0?null:DDLVessel.SelectedValue,
                                                             null,
                                                             ddlChildWorkCateg.SelectedIndex <= 0 ? null : ddlChildWorkCateg.SelectedValue, ddlAssessmentStatus.SelectedIndex <= 0?null:ddlAssessmentStatus.SelectedValue.ToString(),
                                                             UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text),
                                                             "", GetSessionUserID(),
                                                             ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, sortbycoloumn,
                                                             sortdirection, ref rowcount).Tables[0];


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

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