예제 #1
0
    protected void onUpdate(object source, CommandEventArgs e)
    {
        HiddenFlag.Value = "Edit";
        OperationMode    = "Edit Vessel";



        DataTable dt = new DataTable();

        // dt = objBLL.GetVesselDetails_ByID(Convert.ToInt32(e.CommandArgument.ToString()));

        dt = objBLL.GetSURVEYVesselDetails_ByID(Convert.ToInt32(e.CommandArgument.ToString()));

        ddlVesselManager.SelectedValue = dt.Rows[0]["Vessel_Manager"].ToString() != "" ? dt.Rows[0]["Vessel_Manager"].ToString() : "0";
        Load_FleetList_AddVessel();
        //Load_VesselList();
        Load_VesselList(int.Parse(Session["USERCOMPANYID"].ToString()));
        //ddlFleet_AddVessel.SelectedValue = dt.Rows[0]["FleetCode"].ToString() != "" ? dt.Rows[0]["FleetCode"].ToString() : "0";
        ddlvessel_AddType.SelectedValue = dt.Rows[0]["Vessel_type"].ToString() != "" ? dt.Rows[0]["Vessel_type"].ToString() : "0";
        txtVesselID.Text        = dt.Rows[0]["Vessel_ID"].ToString();
        txtVessel.Text          = dt.Rows[0]["Vessel_Name"].ToString();
        txtVesselShortName.Text = dt.Rows[0]["Vessel_Short_Name"].ToString();
        txtEmailID.Text         = dt.Rows[0]["Vessel_email"].ToString();
        dtTakeoverDate.Text     = dt.Rows[0]["Takeover_Date"].ToString();
        dtHandoverDate.Text     = dt.Rows[0]["Handover_Date"].ToString();
        txtMinimumCTM.Text      = dt.Rows[0]["Min_CTM"].ToString();
        txtMMSI.Text            = dt.Rows[0]["Vessel_MMSI_No"].ToString();
        txtIMONo.Text           = dt.Rows[0]["Vessel_IMO_No"].ToString();
        txtYearBuilt.Text       = dt.Rows[0]["vessel_YearBuilt"].ToString();
        txtLength.Text          = dt.Rows[0]["Vessel_Length_OA"].ToString();
        txtCallSign.Text        = dt.Rows[0]["Vessel_Call_sign"].ToString();

        ddlVesselFlage_AddVessel.SelectedValue = dt.Rows[0]["L_Vessel_Flag"].ToString() != "" ? dt.Rows[0]["L_Vessel_Flag"].ToString() : "0";

        if (dt.Rows[0]["ODM_ENABLED"].ToString() == "-1")
        {
            chkSyncEnable.Checked = true;
        }
        else
        {
            chkSyncEnable.Checked = false;
        }

        lnkAttachment.Text = dt.Rows[0]["ME_Power_Curve"].ToString();

        lnkAttachment.NavigateUrl = @"\" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + @"\Uploads\MEPowerCurve\" + lnkAttachment.Text;


        if (lnkAttachment.Text != "")
        {
            lnkAttachment.Visible    = true;
            ImgTempAttDelete.Visible = true;
        }
        else
        {
            lnkAttachment.Visible    = false;
            ImgTempAttDelete.Visible = false;
        }



        string InfoDiv = "Get_Record_Information_Details('LIB_VESSELS','Vessel_ID=" + txtVesselID.Text + "')";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "InfoDiv", InfoDiv, true);

        string AddNewVessel = String.Format("showModal('dvAddNewVessel',false);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddNewVessel", AddNewVessel, true);
    }