Ejemplo n.º 1
0
    private void BindParticipantAttachment()
    {
        DataSet ds = BLL_OPS_DeckLog.Get_DeckLogBook_Incident_Participant_Att_Search(int.Parse(Request.QueryString["Incident_ID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (ds.Tables[0].Rows.Count > 0)
        {
            //Bind the header

            lblIncidentDate.Text    = ds.Tables[0].Rows[0]["INCIDENT_DATE"].ToString();
            lblIncidentType.Text    = ds.Tables[0].Rows[0]["INCIDENT_TYPE"].ToString();
            txtActionTaken.Text     = ds.Tables[0].Rows[0]["ACTION_TAKEN"].ToString();
            txtIncidentDetails.Text = ds.Tables[0].Rows[0]["DETAILS_OF_INCIDENT"].ToString();
        }

        if (ds.Tables[1].Rows.Count > 0)
        {
            //Bind the Photos
            rptDrillImages.DataSource = ds.Tables[1];
            rptDrillImages.DataBind();

            string FileName = ds.Tables[1].Rows[0]["PhotoUrl"].ToString();
            string FilePath = "../../Uploads/Incident/" + Path.GetFileName(ds.Tables[1].Rows[0]["PhotoUrl"].ToString());

            if (System.IO.File.Exists(Server.MapPath(FilePath)) == true)
            {
                Random r   = new Random();
                string ver = r.Next().ToString();
                frmContract.Attributes.Add("src", FilePath + "?ver=" + ver);
            }
        }
    }
Ejemplo n.º 2
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_OPS_DeckLog.Get_DeckLogBook_Index(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();
        }
    }
Ejemplo n.º 3
0
    public string Get_DeckLogBook_Water_In_Tank_Values_Changes(string Vessel_Id, string WaterInTank_Dtl_ID, string Hold_Tank_ID, string Column_Name)
    {
        DataTable dt = BLL_OPS_DeckLog.Get_DeckLogBook_Water_In_Tank_Values_Changes(UDFLib.ConvertToInteger(Vessel_Id), UDFLib.ConvertToInteger(WaterInTank_Dtl_ID), UDFLib.ConvertToInteger(Hold_Tank_ID), Column_Name);

        return(UDFLib.CreateHtmlTableFromDataTable(dt
                                                   , new string[] { "Old Value", "New Value", "PC Name", "Modified By" }
                                                   , new string[] { "OLD_VALUE", "NEW_VAULE", "PC_Name", "Created_By" }, ""));
    }
Ejemplo n.º 4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int retVal = BLL_OPS_DeckLog.Insert_DeckLogBook_Water_In_Hold_Thrashold(int.Parse(Request.QueryString["Vessel_ID"].ToString())
                                                                                , UDFLib.ConvertDecimalToNull(txtSoundingMin.Text), UDFLib.ConvertDecimalToNull(txtSoundingMax.Text)
                                                                                , int.Parse(Session["UserID"].ToString()));

        String msg = String.Format("javascript:parent.fnReloadParent();");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
    }
Ejemplo n.º 5
0
    public void BindDeckLogBookThrasholdList(int?Threshold_Id = null)
    {
        DataSet ds = BLL_OPS_DeckLog.Get_DeckLogBook_Thrashold_List(int.Parse(ViewState["VESSELID"].ToString()), UDFLib.ConvertIntegerToNull(lblLOGBOOKID.Value), Threshold_Id);



        ds.Tables[0].Rows[0]["Vessel_Id"] = UDFLib.ConvertIntegerToNull(ViewState["VESSELID"]);

        if (Threshold_Id == null)
        {
            DDLVersion.DataSource     = ds.Tables[1];
            DDLVersion.DataTextField  = "Version";
            DDLVersion.DataValueField = "ID";
            DDLVersion.DataBind();

            if (ds.Tables[1].Rows.Count == 0)
            {
                DDLVersion.Enabled = false;
                DDLVersion.Items.Insert(0, new ListItem("-No Records found-", "0"));
            }
            else
            {
                DDLVersion.Enabled = true;
            }
        }
        if (ds.Tables[0].Rows[0]["ID"].ToString() != "")
        {
            DDLVersion.SelectedValue = ds.Tables[0].Rows[0]["ID"].ToString();
        }
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddlVesselMain.SelectedValue = ds.Tables[0].Rows[0]["Vessel_Id"].ToString();
            FormView1.DataSource        = ds.Tables[0];
            FormView1.DataBind();

            if (ds.Tables[0].Rows[0]["Active_Status"].ToString() == "0")
            {
                //btnAddTo.Enabled = false;
                btnCopy.Enabled = false;
                //  btnOK.Enabled = false;
                btnSave.Enabled = false;
            }
            else
            {
                //btnAddTo.Enabled = false;
                btnCopy.Enabled = true;
                //  btnOK.Enabled = false;
                btnSave.Enabled = true;
            }
        }
    }
Ejemplo n.º 6
0
    public void BindWaterInHoldThrasholdList()
    {
        DataTable dt = BLL_OPS_DeckLog.Get_DeckLogBook_Water_In_Hold_Thrashold_List(int.Parse(Request.QueryString["Vessel_ID"].ToString()), int.Parse(Request.QueryString["LogBookId"].ToString()));

        if (dt.Rows.Count > 0)
        {
            txtSoundingMin.Text = dt.Rows[0]["MIN_Water_In_Hold_Sounding"].ToString();
            txtSoundingMax.Text = dt.Rows[0]["MAX_Water_In_Hold_Sounding"].ToString();
            if (dt.Rows[0]["Active_Status"].ToString() == "0")
            {
                btnSave.Enabled = false;
            }
        }
    }
Ejemplo n.º 7
0
    private void BindDeckLogBookDetails()
    {
        DataTable dt = BLL_OPS_DeckLog.Get_DeckLogBook_Details(int.Parse(Request.QueryString["DeckLogBookID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (dt.Rows.Count > 0)
        {
            dt.DefaultView.RowFilter   = "Log_Hours_ID < 13";
            rpDeckLogBook01.DataSource = dt;
            rpDeckLogBook01.DataBind();

            dt.DefaultView.RowFilter   = "Log_Hours_ID > 12";
            rpDeckLogBook02.DataSource = dt;
            rpDeckLogBook02.DataBind();
        }

        DataTable dt_wheel = BLL_OPS_DeckLog.Get_DeckLogBook_Wheel_Look_Out_Details(int.Parse(Request.QueryString["DeckLogBookID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (dt.Rows.Count > 0)
        {
            rpWheelLookOut.DataSource = dt_wheel;
            rpWheelLookOut.DataBind();
        }

        DataTable dt_Wanter_Hold = BLL_OPS_DeckLog.Get_DeckLogBook_Water_In_Hold_Details(int.Parse(Request.QueryString["DeckLogBookID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (dt_Wanter_Hold.Rows.Count > 0)
        {
            rpWaterInHold.DataSource = dt_Wanter_Hold;
            rpWaterInHold.DataBind();
        }

        DataTable dt_Wanter_Tank = BLL_OPS_DeckLog.Get_DeckLogBook_Water_In_Tank_Details(int.Parse(Request.QueryString["DeckLogBookID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (dt_Wanter_Tank.Rows.Count > 0)
        {
            rpWaterInTank.DataSource = dt_Wanter_Tank;
            rpWaterInTank.DataBind();
        }


        DataTable dt_Incident = BLL_OPS_DeckLog.Get_DeckLogBook_Incident_Report_Search(int.Parse(Request.QueryString["DeckLogBookID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (dt_Incident.Rows.Count > 0)
        {
            rpIncidentReport.DataSource = dt_Incident;
            rpIncidentReport.DataBind();
        }
    }
    public void BindParticipantList()
    {
        DataSet ds = BLL_OPS_DeckLog.Get_DeckLogBook_Incident_Participant_Search(int.Parse(Request.QueryString["Incident_ID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (ds.Tables[0].Rows.Count > 0)
        {
            lblIncidentDate.Text    = ds.Tables[0].Rows[0]["INCIDENT_DATE"].ToString();
            lblIncidentType.Text    = ds.Tables[0].Rows[0]["INCIDENT_TYPE"].ToString();
            txtActionTaken.Text     = ds.Tables[0].Rows[0]["ACTION_TAKEN"].ToString();
            txtIncidentDetails.Text = ds.Tables[0].Rows[0]["DETAILS_OF_INCIDENT"].ToString();
        }

        if (ds.Tables[1].Rows.Count > 0)
        {
            rpIncidentParticipant.DataSource = ds.Tables[1];
            rpIncidentParticipant.DataBind();
        }
    }
Ejemplo n.º 9
0
    protected void btnCopy_Click(object sender, EventArgs e)
    {
        int    copyfromvessel = int.Parse(ddlVessel.SelectedValue);
        string js             = "";
        int    i = BLL_OPS_DeckLog.CopyDeckLogBookThreshold(int.Parse(ViewState["VESSELID"].ToString()), copyfromvessel, int.Parse(Session["USERID"].ToString()));

        if (i <= 0)
        {
            js = "alertmessage(0);";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            return;
        }

        js = "alert('Threshold Values are copied successfully from " + ddlVessel.SelectedItem.Text + " to  " + ddlVesselMain.SelectedItem.Text + "!');";
        ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        lblLOGBOOKID.Value = null;
        BindDeckLogBookThrasholdList(null);
    }
Ejemplo n.º 10
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_OPS_DeckLog.Get_DeckLogBook_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue)
                                                             , UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), 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", "");
    }
Ejemplo n.º 11
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int retVal = BLL_OPS_DeckLog.Insert_DeckLogBook_Thrashold(UDFLib.ConvertIntegerToNull(((Label)FormView1.Row.Cells[0].FindControl("lblthresHoldID")).Text), int.Parse(ViewState["VESSELID"].ToString())
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtAirTempMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtAirTempMax")).Text)
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtBarometerMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtBarometerMax")).Text)
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtErrorGyroMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtErrorGyroMax")).Text)
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtErrorStandardMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtErrorStandardMax")).Text)
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtSeaMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtSeaMax")).Text)
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtSeaTempMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtSeaTempMax")).Text)
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtVisibilityMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtVisibilityMax")).Text)
                                                                  , null, null
                                                                  , UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtWindsForceMin")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtWindsForceMax")).Text),
                                                                  UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtCapacity100MinHold")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtCapacity100MaxHold")).Text),
                                                                  UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtCapacity100MinTank")).Text), UDFLib.ConvertDecimalToNull(((TextBox)FormView1.Row.Cells[0].FindControl("txtCapacity100MaxTank")).Text),
                                                                  int.Parse(Session["UserID"].ToString()));



        string js = "alertmessage(1);";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        lblLOGBOOKID.Value = null;
        BindDeckLogBookThrasholdList(null);
    }
Ejemplo n.º 12
0
    private void BindDeckLogBookHeaderDetails()
    {
        DataTable dt = BLL_OPS_DeckLog.Get_DeckLogBook_List(int.Parse(Request.QueryString["DeckLogBookID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (dt.Rows.Count > 0)
        {
            lblVessel.Text     = dt.Rows[0]["Vessel_Name"].ToString();
            lblFrom.Text       = dt.Rows[0]["From_Port"].ToString();
            lblTo.Text         = dt.Rows[0]["To_Port"].ToString();
            lblReportDate.Text = dt.Rows[0]["Report_Date"].ToString();
            // lblTo.Text = dt.Rows[0]["Remarks"].ToString();
            txtAdditionalRemark.Text = dt.Rows[0]["Remarks"].ToString();
            lblCurrentSetDrift.Text  = dt.Rows[0]["Current_Set_Drift"].ToString();

            lblTotalEngineRevs.Text = dt.Rows[0]["Total_Engine_Revs"].ToString();

            lbltrueCourseNoon.Text = dt.Rows[0]["True_Course_Made_To_Noon"].ToString();

            lblDaysRun.Text = dt.Rows[0]["DistNauticalMiles_DaysRun"].ToString();
            lblTotal.Text   = dt.Rows[0]["Dis_Nau_Miles_Total"].ToString();

            lbllati_Acnt.Text = dt.Rows[0]["Latitude_ByAcnt"].ToString();
            lbllati_Obs.Text  = dt.Rows[0]["Latitude_Obs"].ToString();

            lblLong_Acnt.Text = dt.Rows[0]["Longitude_ByAcnt"].ToString();
            lblLong_Obs.Text  = dt.Rows[0]["Longitude_Obs"].ToString();

            lblSteeringDay.Text     = dt.Rows[0]["SteamingTime_Day"].ToString();
            lblSteeringDayToal.Text = dt.Rows[0]["SteamingTime_Total"].ToString();

            lblSpeedAvg.Text      = dt.Rows[0]["Speed_Average"].ToString();
            lblSpeedTotalAvg.Text = dt.Rows[0]["Speed_TotalAvg"].ToString();

            lblDistperLog.Text = dt.Rows[0]["Distance_Per_Log"].ToString();
            lblErrPercent.Text = dt.Rows[0]["Error_Percent"].ToString();

            lblMagneticVariation.Text = dt.Rows[0]["MagneticVariation"].ToString();
            if (dt.Rows[0]["FromMidNightTill"].ToString() != "")
            {
                lblFromMidnight.Text = dt.Rows[0]["FromMidNightTill"].ToString();
            }
            if (dt.Rows[0]["TillMidNight"].ToString() != "")
            {
                lblTillMidnight.Text = dt.Rows[0]["TillMidNight"].ToString();
            }

            txtSickList.Text = dt.Rows[0]["Sick_List"].ToString();

            //if (dt.Rows[0]["VslMasterID"].ToString() != "" && dt.Rows[0]["VslMasterID"].ToString() != "0")
            //{
            //    lnkMaster.Text = dt.Rows[0]["VslMasterName"].ToString();
            //    lnkMaster.NavigateUrl = "~/crew/crewdetails.aspx?ID=" + dt.Rows[0]["VslMasterID"].ToString();
            //    lnkMaster.Target = "_blank";
            //    imgMaster.ImageUrl = hdnBaseURL.Value + "uploads/CrewImages/" + dt.Rows[0]["PhotoUrl1"].ToString();
            //    lnkMaster.Visible = true;
            //    imgMaster.Visible = true;
            //}
            //else
            //{
            //    lnkMaster.Visible = false;
            //    imgMaster.Visible = false;
            //}

            //if (dt.Rows[0]["VslChiefOfficerID"].ToString() != "" && dt.Rows[0]["VslChiefOfficerID"].ToString() != "0")
            //{
            //    lnkChiefOfficer.Text = dt.Rows[0]["VslChiefOfficerName"].ToString();
            //    lnkChiefOfficer.NavigateUrl = "~/crew/crewdetails.aspx?ID=" + dt.Rows[0]["VslChiefOfficerID"].ToString();
            //    lnkChiefOfficer.Target = "_blank";
            //    imgChiefOfficer.ImageUrl = hdnBaseURL.Value + "uploads/CrewImages/" + dt.Rows[0]["PhotoUrl2"].ToString();
            //    lnkChiefOfficer.Visible = true;
            //    imgChiefOfficer.Visible = true;
            //}
            //else
            //{
            //    lnkChiefOfficer.Visible = false;
            //    imgChiefOfficer.Visible = false;
            //}
        }
    }