Пример #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string filepath  = "";
        string Shipimage = "";

        if (ShipImageUpload.HasFile)
        {
            filepath = Server.MapPath("shipImage\\" + txtVeseelCode.Text + ShipImageUpload.FileName);
            ShipImageUpload.SaveAs(filepath);
            Shipimage = txtVeseelCode.Text + ShipImageUpload.FileName;
        }
        else
        {
            Shipimage = Session["Shipimage"].ToString();
        }
        string TankImagePath = "";
        string TankImage     = "";

        if (TankImageUpload.HasFile)
        {
            TankImagePath = Server.MapPath("ShipLayout\\" + txtVeseelCode.Text + TankImageUpload.FileName);
            TankImageUpload.SaveAs(TankImagePath);
            TankImage = txtVeseelCode.Text + TankImageUpload.FileName;
        }
        else
        {
            TankImage = Session["TankImg"].ToString();
        }


        try
        {
            //IeLogService_INFClient ObjElog = Global.Client;

            //Vessel objNewVessel = new Vessel();

            //objNewVessel.EXNAME1 = txtExName.Text;
            //objNewVessel.EXNAME2 = txtExName.Text;
            //objNewVessel.EXNAME3 = txtExName.Text;
            //objNewVessel.EXNAME4 = txtExName.Text;
            //objNewVessel.VESSELCODE = txtVeseelCode.Text;
            //objNewVessel.ACC_CODE = int.Parse(txtAccCode.Text);
            //objNewVessel.OWNER = txtVesselOwner.Text;
            //objNewVessel.OPERATOR = txtOperator.Text;
            //objNewVessel.FLAG = DDLFlag.SelectedItem.Text;
            //objNewVessel.CALLSIGN = txtCallSign.Text;
            //objNewVessel.IMONO = int.Parse(txtIMO.Text);
            //objNewVessel.OFCNO = int.Parse(txtOffcialNo.Text);
            //objNewVessel.CLASSNAME = DDLClass.SelectedItem.Text;
            //objNewVessel.CLASSNO = txtClassNo.Text;
            //objNewVessel.SERVSPEED = float.Parse(txtServSpeed.Text);
            //objNewVessel.VESSELTYPE = DDLVesselType.SelectedItem.Text;
            //objNewVessel.SIZE = DDLTankSize.SelectedItem.Text;
            //objNewVessel.KEELDT = txtKeellaiddt.Text.ToString().Trim();
            //objNewVessel.DLVRYDT = txtDlvrydt.Text.ToString().Trim();
            //objNewVessel.VESSELYARD = txtyard.Text;
            //objNewVessel.HULLNO = int.Parse(txtHullNo.Text);
            //objNewVessel.HULLLTYPE = DDLHullType.SelectedItem.Text;
            //objNewVessel.LENGTHOA = float.Parse(txtLength.Text);
            //objNewVessel.LENGTHBP = float.Parse(txtBpLength.Text);
            //objNewVessel.DEPTH = float.Parse(txtDepth.Text);
            //objNewVessel.BREADTH = float.Parse(txtBreadth.Text);
            //objNewVessel.MASTKEEL = float.Parse(txtMastTopfrmKeel.Text);
            //objNewVessel.MMISNO = int.Parse(txtMMSI.Text);
            //objNewVessel.CARGOTKCAP = float.Parse(txtCargoTkCap.Text);
            //objNewVessel.SLOPTKCAP = float.Parse(txtSloptkCap.Text);
            //objNewVessel.BALLASTTKCAP = float.Parse(txtBallastTkCap.Text);
            //objNewVessel.DW_TROP = float.Parse(txtDw_Trop.Text);
            //objNewVessel.DW_SUMM = (float)Convert.ToSingle(txtDw_Summ.Text);
            //objNewVessel.DW_WINT = float.Parse(txt_Dw_wint.Text);
            //objNewVessel.DW_BALLAST = float.Parse(txtDw_Ballast.Text);
            //objNewVessel.DISP_TROP = float.Parse(txtDisp_Trop.Text);
            //objNewVessel.DISP_SUMM = float.Parse(txtDisp_summ.Text);
            //objNewVessel.DISP_WINT = float.Parse(txtDisp_Winter.Text);
            //objNewVessel.DISP_BALLAST = float.Parse(txtDisp_Ballast.Text);
            //objNewVessel.DRFT_TROP = float.Parse(txtdrft_trop.Text);
            //objNewVessel.DRFT_SUMM = float.Parse(txtdrft_summ.Text);
            //objNewVessel.DRFT_WINT = float.Parse(txtdrft_wint.Text);
            //objNewVessel.DRFT_BALLAST = float.Parse(txtdrft_Ballast.Text);
            //objNewVessel.GRT_INTER = float.Parse(txgrttInter.Text);
            //objNewVessel.GRT_SUEZ = float.Parse(txtGrtSuez.Text);
            //objNewVessel.GRT_PANAMA = float.Parse(txtGrtpanama.Text);
            //objNewVessel.NRT_INTER = float.Parse(txtNrtInter.Text);
            //objNewVessel.NRT_SUEZ = float.Parse(txtNrtSuez.Text);
            //objNewVessel.NRT_PANAM = float.Parse(txtNrtPanama.Text);
            //objNewVessel.LWT_INTER = float.Parse(txtLwtInter.Text);
            //objNewVessel.LWT_SUEZ = float.Parse(txtLwtSuez.Text);
            //objNewVessel.LWT_PANAMA = float.Parse(txtLwtPanama.Text);
            //objNewVessel.AUX_BOILER = txtME.Text;
            //objNewVessel.AUX_BOILER = txtAuxBoil.Text;
            //objNewVessel.AE_KW = txtAuxKw.Text;
            //objNewVessel.ME_MCR = txtMCR.Text;
            //objNewVessel.ME_NCR = txtNCR.Text;
            //objNewVessel.COP_CAP = txtCopCap.Text;
            //objNewVessel.AUX_ENGINE = txtAunEng.Text;
            //objNewVessel.DECK_MECH = DDLDeckMech.SelectedItem.Text;
            //objNewVessel.AE_KW = txtAuxKw.Text;
            //objNewVessel.TURB_GENT = txtturbEng.Text;
            //objNewVessel.TG_KW = txtturbengKw.Text;
            //objNewVessel.DRY_LAST = txtDrtLast.Text;
            //objNewVessel.DRY_NEXT = txtDryNext.Text.ToString().Trim();
            //objNewVessel.DRY_LATEST = txtDryLatest.Text.ToString().Trim();
            //objNewVessel.SPL_LAST = txtSplLast.Text.ToString().Trim();
            //objNewVessel.SPL_NEXT = txtSplNext.Text.ToString().Trim();
            //objNewVessel.SPL_LATEST = txtSplLatest.Text.ToString().Trim();
            //objNewVessel.TAIL_LAST = txtTailLast.Text.ToString().Trim();
            //objNewVessel.TAIL_NEXT = txtTailNext.Text.ToString().Trim();
            //objNewVessel.TAIL_LATEST = txtTailLatest.Text.ToString().Trim();
            //objNewVessel.SHIPIMAGE = Shipimage;
            //objNewVessel.TANKIMAGE = TankImage;
            //objNewVessel.EMAIL = txtemail.Text;


            objBLL.AddVesselDetails(txtExName.Text, txtExName.Text, txtExName.Text, txtExName.Text, txtVeseelCode.Text, int.Parse(txtAccCode.Text), txtVesselOwner.Text, txtOperator.Text,
                                    DDLFlag.SelectedItem.Text, txtCallSign.Text, int.Parse(txtIMO.Text), int.Parse(txtOffcialNo.Text), DDLClass.SelectedItem.Text,
                                    txtClassNo.Text, float.Parse(txtServSpeed.Text), DDLVesselType.SelectedItem.Text, DDLTankSize.SelectedItem.Text, txtKeellaiddt.Text.ToString().Trim(),
                                    txtDlvrydt.Text.ToString().Trim(), txtyard.Text, int.Parse(txtHullNo.Text), DDLHullType.SelectedItem.Text, float.Parse(txtLength.Text), float.Parse(txtBpLength.Text),
                                    float.Parse(txtDepth.Text), float.Parse(txtBreadth.Text), float.Parse(txtMastTopfrmKeel.Text), int.Parse(txtMMSI.Text), float.Parse(txtCargoTkCap.Text), float.Parse(txtSloptkCap.Text),
                                    float.Parse(txtBallastTkCap.Text), float.Parse(txtDw_Trop.Text), (float)Convert.ToSingle(txtDw_Summ.Text), float.Parse(txt_Dw_wint.Text), float.Parse(txtDw_Ballast.Text), float.Parse(txtDisp_Trop.Text),
                                    float.Parse(txtDisp_summ.Text), float.Parse(txtDisp_Winter.Text), float.Parse(txtDisp_Ballast.Text), float.Parse(txtdrft_trop.Text), float.Parse(txtdrft_summ.Text), float.Parse(txtdrft_wint.Text),
                                    float.Parse(txtdrft_Ballast.Text), float.Parse(txgrttInter.Text), float.Parse(txtGrtSuez.Text), float.Parse(txtGrtpanama.Text), float.Parse(txtNrtInter.Text), float.Parse(txtNrtSuez.Text),
                                    float.Parse(txtNrtPanama.Text), float.Parse(txtLwtInter.Text), float.Parse(txtLwtSuez.Text), float.Parse(txtLwtPanama.Text), txtME.Text, txtAuxBoil.Text, txtAuxKw.Text, txtMCR.Text, txtNCR.Text, txtCopCap.Text,
                                    txtAunEng.Text, DDLDeckMech.SelectedItem.Text, txtAuxKw.Text, txtturbEng.Text, txtturbengKw.Text, txtDrtLast.Text.ToString().Trim(), txtDryNext.Text.ToString().Trim(), txtDryLatest.Text.ToString().Trim(),
                                    txtSplLast.Text.ToString().Trim(), txtSplNext.Text.ToString().Trim(), txtSplLatest.Text.ToString().Trim(), txtTailLast.Text.ToString().Trim(), txtTailNext.Text.ToString().Trim(), txtTailLatest.Text.ToString().Trim(), Shipimage, TankImage, 2, txtemail.Text);


            EmptyTexbox(this);
        }
        catch (Exception ex)
        {
        }
    }