Пример #1
0
    private void UpdateERLog(int ids)
    {
        int updateRecords;

        if (ids == 1)
        {
            updateRecords = BLL_Tec_ErLog.ErLog_FODA_THRESHOLD_Update(int.Parse(ViewState["logid"].ToString()), UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(txtFODA_HO_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_ME.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_AE.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_BLR.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_TC.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_HTG.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_TTL.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_RCVD.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_AMEND.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_HO_ROB.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_ME.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_AE.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_BLR.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_TC.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_HTG.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_TTL.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_RCVD.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_AMEND.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_DO_ROB.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_ME.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_AE.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_BLR.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_TC.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_HTG.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_TTL.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_RCVD.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_AMEND.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_GO_ROB.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_ROB_PNN_max.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_ME_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_AE_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_BLR_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_TC_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_HTG_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_CONS_TTL_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_HO_AMEND_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_HO_ROB_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_ME_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_AE_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_BLR_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_TC_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_HTG_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_CONS_TTL_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_DO_AMEND_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_DO_ROB_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_ME_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_AE_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_BLR_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_TC_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_HTG_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_CONS_TTL_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtFODA_GO_AMEND_Max.Text),
                                                                      UDFLib.ConvertIntegerToNull(txtFODA_GO_ROB_Max.Text), Convert.ToInt32(Session["USERID"]));
            string js = "alert('Changes are updated ');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        }
        if (ids == 2)
        {
            updateRecords = BLL_Tec_ErLog.ErLog_FWDa_THRESHOLD_Update(int.Parse(ViewState["logid"].ToString()), UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(txtFWDA_POT_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_PROD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_RCVD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_CNSMP.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_ROB.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_PROD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_RCVD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_CNSMP.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_ROB.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_PROD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_RCVD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_CNSMP.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_ROB.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_PROD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_RCVD.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_CNSMP.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_ROB.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFWDA_POT_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_PROD_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_CNSMP_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_POT_ROB_max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_PROD_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_RCVD_max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_CNSMP_max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHP_ROB_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_PROD_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_CNSMP_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_WASHS_ROB_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_PROD_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_CNSMP_Max.Text), UDFLib.ConvertDecimalToNull(txtFWDA_DISTL_ROB_Max.Text), Convert.ToInt32(Session["USERID"]));
            string js = "alert('Changes are updated ');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        }
        if (ids == 3)
        {
            updateRecords = BLL_Tec_ErLog.ErLog_WRKHRS_THRESHOLD_Update(int.Parse(ViewState["logid"].ToString()), UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), null, UDFLib.ConvertDecimalToNull(txtWRKHRS_ME_NN_Min.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE1_NN_min.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE2_NN_min.Text)
                                                                        , null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE3_NN_min.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE4_NN_min.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_TA_NN_Min.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_SG_NN_Min.Text)
                                                                        , null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_ME_NN_max.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE1_NN_Max.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE2_NN_Max.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE3_NN_Max.Text)
                                                                        , null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_AE4_NN_Max.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_TA_NN_Max.Text), null, null, UDFLib.ConvertDecimalToNull(txtWRKHRS_SG_NN_Max.Text), null, Convert.ToInt32(Session["USERID"]));
            string js = "alert('Changes are updated ');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        }
        if (ids == 4)
        {
            updateRecords = BLL_Tec_ErLog.ErLog_LODA_THRESHOLD_Update(int.Parse(ViewState["logid"].ToString()), UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(txtLODA_MECC_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECC_RCVD.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECC_CNSMP.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtLODA_MECC_ROB.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECYL_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECYL_RCVD.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECYL_CNSMP.Text)
                                                                      , UDFLib.ConvertDecimalToNull(txtLODA_MECYL_ROB.Text), UDFLib.ConvertDecimalToNull(txtLODA_AECC_ROB_PNN.Text), UDFLib.ConvertDecimalToNull(txtLODA_AECC_RCVD.Text), UDFLib.ConvertDecimalToNull(txtLODA_AECC_CNSMP.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtLODA_AECC_ROB.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECC_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECC_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECC_CNSMP_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtLODA_MECC_ROB_Max.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECYL_ROB_PNN_Max.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECYL_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtLODA_MECYL_CNSMP_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtLODA_MECYL_ROB_Max.Text), UDFLib.ConvertDecimalToNull(txtLODA_AECC_ROB_PNN_max.Text), UDFLib.ConvertDecimalToNull(txtLODA_AECC_RCVD_Max.Text), UDFLib.ConvertDecimalToNull(txtLODA_AECC_CNSMP_Max.Text),
                                                                      UDFLib.ConvertDecimalToNull(txtLODA_AECC_ROB_Max.Text), Convert.ToInt32(Session["USERID"]));
            string js = "alert('Changes are updated ');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        }
        if (ids == 5)
        {
            //updateRecords = BLL_Tec_ErLog.(int.Parse(ViewState["logid"].ToString()), UDFLib.ConvertIntegerToNull(txtDP_WIND_FORCE.Text), txtDP_WIND_DIR.Text, txtDP_SEA_COND.Text, UDFLib.ConvertIntegerToNull(txtDP_SWELL.Text), txtDP_SWELL_DIR.Text, txtDP_CURR.Text, UDFLib.ConvertIntegerToNull(txtDP_REVS_NTN.Text)
            //     , UDFLib.ConvertIntegerToNull(txtDP_AVG_RPM.Text), UDFLib.ConvertIntegerToNull(txtDP_ENG_DIST.Text), UDFLib.ConvertIntegerToNull(txtDP_OBS_DIST.Text), UDFLib.ConvertIntegerToNull(txtDP_TTL_DIST.Text), UDFLib.ConvertIntegerToNull(txtDP_HRS_FUL_SPD.Text), UDFLib.ConvertIntegerToNull(txtDP_SLIP.Text),
            //     UDFLib.ConvertIntegerToNull(txtDP_DIST_TOGO.Text), txtDP_HRS_RED_SPD.Text, UDFLib.ConvertIntegerToNull(txtDP_HRS_STOPD.Text), UDFLib.ConvertIntegerToNull(txtDP_OBS_SPD.Text), UDFLib.ConvertDateToNull(txtETA.Text),"", 1);
            //string js = "alert('Changes are updated ');";
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        }
    }