Ejemplo n.º 1
0
    protected void BindReport(DataRow dr)
    {
        int PKID = dr != null?Convert.ToInt32(dr["pkid"]) : Convert.ToInt32(Request.QueryString["id"]);

        if (PKID != 0)
        {
            DataTable dtDep = BLL_OPS_VoyageReports.Get_DepartureReport(PKID);
            ViewState["dtVesselROB"] = dtDep.Copy();
            fvdepature.DataSource    = dtDep;
            fvdepature.DataBind();
            lblVessel.Text = Convert.ToString(dtDep.Rows[0]["vesselname"]);
            lbtncrwlist.CommandArgument = Convert.ToString(dtDep.Rows[0]["Vessel_Short_Name"]);

            if (dtDep.Rows.Count > 0)
            {
                dtVesselInfo = BLL_OPS_VoyageReports.OPS_Get_VesselInfo(UDFLib.ConvertToInteger(dtDep.Rows[0]["Vessel_ID"]));
                if (dtVesselInfo.Rows.Count > 0)
                {
                    lblIMONO.Text    = Convert.ToString(dtVesselInfo.Rows[0]["Vessel_IMO_No"]);
                    lblCallSign.Text = Convert.ToString(dtVesselInfo.Rows[0]["Vessel_Call_sign"]);
                }
                if (dtDep.Rows[0]["LO_Offlanded"].ToString() == "YES")
                {
                    DataTable dtLOSamples  = BLL_OPS_VoyageReports.Get_DepartureReport_LOSamples(Int32.Parse(Request.QueryString["id"].ToString()), UDFLib.ConvertToInteger(dtDep.Rows[0]["Vessel_ID"]));
                    Repeater  rptLOSamples = (Repeater)fvdepature.FindControl("rptLOSamples");
                    if (rptLOSamples != null)
                    {
                        rptLOSamples.DataSource = dtLOSamples;
                        rptLOSamples.DataBind();
                    }
                }
            }

            Page.Title = dtDep.Rows[0]["Vessel_Short_Name"].ToString() + " / DEP / " + dtDep.Rows[0]["Report_Date"].ToString();
        }
    }