protected void btnsave_Click(object sender, EventArgs e)
    {
        DateTime Dt_EffectiveDate = DateTime.Parse("1900/01/01");

        if (!UDFLib.DateCheck(txtEffectiveDate.Text))
        {
            string js = "alert('Enter valid  Date" + TodayDateFormat + "');" + String.Format("showModal('divadd',false);");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "DateFormat", js, true);
            return;
        }
        try
        {
            txtEffectiveDate.Text = txtEffectiveDate.Text != "" ? UDFLib.ConvertToDefaultDt(txtEffectiveDate.Text) : txtEffectiveDate.Text;
            if (HiddenFlag.Value == "Add")
            {
                int retval = objBLL.Insert_Crew_Contract_Withhold(UDFLib.ConvertToInteger(txtContractNumber.Text), UDFLib.ConvertDecimalToNull(txtAmount.Text), txtWithholdType.Text
                                                                  , UDFLib.ConvertToInteger(ddlEntryType.SelectedValue), UDFLib.ConvertDateToNull(txtEffectiveDate.Text), Convert.ToInt32(Session["USERID"]));
            }
            else
            {
                int retval = objBLL.Edit_Crew_Contract_Withhold(UDFLib.ConvertIntegerToNull(txtContractWithholdID.Text.Trim()), UDFLib.ConvertToInteger(txtContractNumber.Text)
                                                                , UDFLib.ConvertDecimalToNull(txtAmount.Text), txtWithholdType.Text
                                                                , UDFLib.ConvertToInteger(ddlEntryType.SelectedValue), UDFLib.ConvertDateToNull(txtEffectiveDate.Text), Convert.ToInt32(Session["USERID"]));
            }

            BindCrewWithhold();

            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        catch (Exception)
        {
            return;
        }
    }
Exemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Repeater fvDetails = (Repeater)FormView1.Row.Cells[0].FindControl("Repeater1");

        foreach (RepeaterItem ritem in fvDetails.Items)
        {
            Label   lblid     = (Label)ritem.FindControl("lblid");
            Label   lblVessel = (Label)ritem.FindControl("lblVessel");
            TextBox tx1       = (TextBox)ritem.FindControl("txtCYL_OIL_DAY_TK");
            TextBox tx2       = (TextBox)ritem.FindControl("txtME_SUMP");
            TextBox tx3       = (TextBox)ritem.FindControl("txtHEAVY_OIL_SETTL_TK");
            TextBox tx4       = (TextBox)ritem.FindControl("txtHEAVY_OIL_SERV_TK");
            TextBox tx5       = (TextBox)ritem.FindControl("txtBELENDED_OIL");
            TextBox tx6       = (TextBox)ritem.FindControl("txtDO_SERV_TK");
            TextBox tx01      = (TextBox)ritem.FindControl("txtCYL_OIL_DAY_TK_Max");
            TextBox tx02      = (TextBox)ritem.FindControl("txtME_SUMP_Max");
            TextBox tx03      = (TextBox)ritem.FindControl("txtHEAVY_OIL_SETTL_TK_Max");
            TextBox tx04      = (TextBox)ritem.FindControl("txtHEAVY_OIL_SERV_TK_Max");
            TextBox tx05      = (TextBox)ritem.FindControl("txtBELENDED_OIL_Max");
            TextBox tx06      = (TextBox)ritem.FindControl("txtDO_SERV_TK_Max");
            bool    valstatus = true;
            if ((UDFLib.ConvertDecimalToNull(tx1.Text) != null) && (UDFLib.ConvertDecimalToNull(tx01.Text) != null) && (decimal.Parse(tx1.Text) > decimal.Parse(tx01.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx2.Text) != null) && (UDFLib.ConvertDecimalToNull(tx02.Text) != null) && (decimal.Parse(tx2.Text) > decimal.Parse(tx02.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx3.Text) != null) && (UDFLib.ConvertDecimalToNull(tx03.Text) != null) && (decimal.Parse(tx3.Text) > decimal.Parse(tx03.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx4.Text) != null) && (UDFLib.ConvertDecimalToNull(tx04.Text) != null) && (decimal.Parse(tx4.Text) > decimal.Parse(tx04.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx5.Text) != null) && (UDFLib.ConvertDecimalToNull(tx05.Text) != null) && (decimal.Parse(tx5.Text) > decimal.Parse(tx05.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx6.Text) != null) && (UDFLib.ConvertDecimalToNull(tx06.Text) != null) && (decimal.Parse(tx6.Text) > decimal.Parse(tx06.Text)))
            {
                valstatus = false;
            }
            if (valstatus)
            {
                int i = BLL_Tec_ErLog.ErLog_TANK_LEVELS_THRESHOLD_Update(UDFLib.ConvertIntegerToNull(lblid.Text), UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(tx1.Text), UDFLib.ConvertDecimalToNull(tx2.Text),
                                                                         UDFLib.ConvertDecimalToNull(tx3.Text), UDFLib.ConvertDecimalToNull(tx4.Text), UDFLib.ConvertDecimalToNull(tx5.Text), UDFLib.ConvertDecimalToNull(tx6.Text), UDFLib.ConvertDecimalToNull(tx01.Text),
                                                                         UDFLib.ConvertDecimalToNull(tx02.Text), UDFLib.ConvertDecimalToNull(tx03.Text), UDFLib.ConvertDecimalToNull(tx04.Text), UDFLib.ConvertDecimalToNull(tx05.Text), UDFLib.ConvertDecimalToNull(tx06.Text), Convert.ToInt32(Session["USERID"]));
                string js = "alert('Changes are updated ');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
            else
            {
                string js = "alert('Please check your data');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
        }
    }
Exemplo n.º 3
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);
    }
    protected void SaveItemPrice()
    {
        DataTable dtItemPrice = new DataTable();

        dtItemPrice.Columns.Add("pkid", typeof(int));
        dtItemPrice.Columns.Add("rate", typeof(decimal));
        dtItemPrice.Columns.Add("discount", typeof(decimal));
        dtItemPrice.Columns.Add("unit", typeof(string));
        dtItemPrice.Columns.Add("supp_remark");

        DataRow dr;

        foreach (GridViewRow gr in gvContractDetails.Rows)
        {
            dr             = dtItemPrice.NewRow();
            dr["pkid"]     = Convert.ToInt32(((TextBox)gr.FindControl("txtrate")).ToolTip.Trim());
            dr["rate"]     = UDFLib.ConvertToDecimal(((TextBox)gr.FindControl("txtrate")).Text.Trim());
            dr["discount"] = UDFLib.ConvertToDecimal(((TextBox)gr.FindControl("txtDiscount")).Text.Trim());
            dr["unit"]     = ((TextBox)gr.FindControl("lbtnUnitsPKg")).Text.Trim();
            dtItemPrice.Rows.Add(dr);
        }

        DataTable dtCharges = new DataTable();

        dtCharges.Columns.Add("Currency");
        dtCharges.Columns.Add("Truck_Charge");
        dtCharges.Columns.Add("Barge_Charge");
        dtCharges.Columns.Add("Freight_Charge");
        dtCharges.Columns.Add("Pkg_Hld_Charge");
        dtCharges.Columns.Add("Other_Charge");
        dtCharges.Columns.Add("Vat");
        dtCharges.Columns.Add("Discount");


        DataRow drCharges = dtCharges.NewRow();

        drCharges["Currency"]       = UDFLib.ConvertStringToNull(DDLCurrency.SelectedItem.Text.Trim());
        drCharges["Truck_Charge"]   = UDFLib.ConvertDecimalToNull(txtTruckCharge.Text);
        drCharges["Barge_Charge"]   = UDFLib.ConvertDecimalToNull(txtBargeCharge.Text);
        drCharges["Freight_Charge"] = UDFLib.ConvertDecimalToNull(txtFrieghtCharge.Text);
        drCharges["Pkg_Hld_Charge"] = UDFLib.ConvertDecimalToNull(txtPkgCharge.Text);
        drCharges["Other_Charge"]   = UDFLib.ConvertDecimalToNull(txtOtherCharge.Text);
        drCharges["Vat"]            = UDFLib.ConvertDecimalToNull(txtVat.Text);
        drCharges["Discount"]       = UDFLib.ConvertDecimalToNull(txtDiscount.Text);

        dtCharges.Rows.Add(drCharges);

        if (dtItemPrice.Rows.Count > 0)
        {
            BLL_PURC_CTP.Upd_Ctp_Items_Price(Convert.ToInt32(Request.QueryString["Quotation_ID"]), dtItemPrice, Convert.ToInt32(Session["userid"].ToString()), isfinalizing, dtCharges);
        }
    }
Exemplo n.º 5
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         string Retval = BLL_POLOG_Register.POLOG_Insert_Payment_Details(txtPaymodeID.Text, UDFLib.ConvertToInteger(txtPayment_Year.Text), txtSupplierCode.Text, UDFLib.ConvertDecimalToNull(txtPaymentAmount.Text), txtBankRef.Text,
                                                                         UDFLib.ConvertDateToNull(txtPayDate.Text), ddlPayMode.SelectedValue, ddlAccount.SelectedValue,
                                                                         UDFLib.ConvertDecimalToNull(txtBankAmt.Text), UDFLib.ConvertDecimalToNull(txtBankCharge.Text), rdbPaymode.SelectedValue, txtRemarks.Text, GetSessionUserID());
         GetPaymentDetails();
     }
     catch { }
     {
     }
 }
Exemplo n.º 6
0
    protected void btnTask_Click(object sender, EventArgs e)
    {
        //If request("DA_Status") = "DRAFT" Then
        string Request_Type = "PLANNED";
        int    ActiVityType = 2;
        int    STR          = objPortCall.Insert_PortCall_Activity(UDFLib.ConvertToInteger(ViewState["ActiVityID"]), UDFLib.ConvertToInteger(Request.QueryString["PCID"]), UDFLib.ConvertToInteger(Request.QueryString["VId"]), UDFLib.ConvertDateToNull(txtCheckDate.Text), Request_Type,
                                                                   UDFLib.ConvertDecimalToNull(0), UDFLib.ConvertStringToNull(txtPlanDesc.Text),
                                                                   UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()), ActiVityType);

        BindTask();
        ClearTaskControl();
        btnTask.Text            = "Add Plan";
        ViewState["ActiVityID"] = null;
    }
    protected void btnPayAmount_Click(object sender, EventArgs e)
    {
        try
        {
            string Invoice_Type  = "WITHHOLD";
            string Withhold_Mode = "UnWithHold";
            String msg2          = null;
            int    retval        = 0;

            if (UDFLib.ConvertDecimalToNull(txtNetAmount.Text) * -1 >= UDFLib.ConvertDecimalToNull(txtAmount.Text))
            {
                retval = BLL_POLOG_Register.POLog_Insert_Withhold_Invoice(UDFLib.ConvertStringToNull(txtInvoiceCode.Text), UDFLib.ConvertIntegerToNull(txtPOCode.Text), 0, Invoice_Type
                                                                          , UDFLib.ConvertDecimalToNull(txtAmount.Text), "", UDFLib.ConvertToInteger(GetSessionUserID()), Withhold_Mode, txtInvoiceCurrency.Text);
            }
            else
            {
                msg2 = String.Format("alert('UnWithhold amount cant be greater then Withhold amount.')");
            }
            if (retval > 0)
            {
                BindWithholdInvoice();
                BindInvoice(txtPOCode.Text);
                foreach (GridViewRow row in gvPOWithhold.Rows)
                {
                    //storyGridView.DataKeys[row.RowIndex].Values[0].ToString();
                    string ID = gvPOWithhold.DataKeys[row.RowIndex].Values[0].ToString();
                    if (txtPOCode.Text == ID)
                    {
                        row.BackColor = System.Drawing.Color.Yellow;
                    }
                    else
                    {
                        row.BackColor = System.Drawing.Color.White;
                    }
                }
            }
            else
            {
                msg2 = String.Format("alert('UnWithhold amount cant be greater then Invoice amount.')");
            }

            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg2, true);
            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        catch { }
        {
        }
    }
    protected void btnStatus_OnClick(object sender, EventArgs e)
    {
        string hidemodal = "";

        if ((lblEntitled.Text.Trim() == "NO" || UDFLib.ConvertDecimalToNull(txtActAmount.Text.Trim()) != UDFLib.ConvertDecimalToNull(lblRJBAmount.Text.Trim())) && txtRemark.Text.Trim() == "")
        {
            hidemodal = String.Format("alert('If the Crew is not Entitled for Rejoining Bonus or Actual amount is different from Calculated then the Remark is mandatory!');showModal('dvExport',false);");
        }
        else
        {
            int Reslt = objCrew.Update_RJBApproval(Convert.ToInt32(hdnStatus.Value), Convert.ToInt32(hdnID.Value), GetSessionUserID(), UDFLib.ConvertDecimalToNull(txtActAmount.Text), txtRemark.Text.Trim(), hdnStatus.Value == "1" ? "APPROVE" : "REJECT");
            //BindRJBGrid();
            hidemodal = String.Format("hideModal('dvExport');$('#BtnSearch').click();");
        }
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
Exemplo n.º 9
0
    protected void btnActivity_Click(object sender, EventArgs e)
    {
        //If request("DA_Status") = "DRAFT" Then
        string Request_Type = "URGENT";
        int    ActiVityType = 1;
        int    STR          = objPortCall.Insert_PortCall_Activity(UDFLib.ConvertToInteger(ViewState["ActiVityID"]), UDFLib.ConvertToInteger(Request.QueryString["PCID"]), UDFLib.ConvertToInteger(Request.QueryString["VId"]), UDFLib.ConvertDateToNull(txtActivateDate.Text), Request_Type,
                                                                   UDFLib.ConvertDecimalToNull(txtCost.Text), UDFLib.ConvertStringToNull(txtDesc.Text),
                                                                   UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()), ActiVityType);

        BindActivity();

        ClearControl();
        btnActivity.Text        = "Add Activity";
        btnTask.Visible         = false;
        ViewState["ActiVityID"] = null;
    }
Exemplo n.º 10
0
    protected void btnDraft_Click(object sender, EventArgs e)
    {
        try
        {
            //string Confirm_Unit = "PC";
            int retval = BLL_POLOG_Delivery.POLog_Insert_Delivery_Item(UDFLib.ConvertIntegerToNull(Request.QueryString["ID"].ToString()), UDFLib.ConvertIntegerToNull(txtDeliveryID.Text),
                                                                       txtName.Text.Trim(), UDFLib.ConvertDecimalToNull(txtPoQty.Text.Trim()), UDFLib.ConvertDecimalToNull(txtPoPrice.Text.Trim()), txtDeliveryUnit.Text,
                                                                       UDFLib.ConvertDecimalToNull(txtConQty.Text.Trim()), UDFLib.ConvertDecimalToNull(txtConPrice.Text.Trim()), txtRemarks.Text.Trim(), UDFLib.ConvertToInteger(GetSessionUserID()));


            string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
        }
        catch
        {
        }
    }
Exemplo n.º 11
0
    public List <AvgPricePerTicket> AsyncGet_AvgPricePerTicket()
    {
        BLL_TRV_TravelRequest    objtr = new BLL_TRV_TravelRequest();
        DataTable                dt_AvgPricePerTicket = objtr.Get_AvgPricePerTicket();
        List <AvgPricePerTicket> dataList             = new List <AvgPricePerTicket>();

        foreach (DataRow dtrow in dt_AvgPricePerTicket.Rows)
        {
            AvgPricePerTicket details = new AvgPricePerTicket();

            details.MonthName = dtrow[1].ToString();

            details.avgAmt = UDFLib.ConvertDecimalToNull(dtrow[4]);

            dataList.Add(details);
        }
        return(dataList);
    }
Exemplo n.º 12
0
    protected void btnDraft_Click(object sender, EventArgs e)
    {
        string responseid = BLL_POLOG_Lib.POLOG_INS_Approval_Limit(UDFLib.ConvertStringToNull(txtLimit.Text), UDFLib.ConvertStringToNull(DDLGroup.SelectedValue), UDFLib.ConvertIntegerToNull(ddlAdvanceApprover.SelectedValue),
                                                                   UDFLib.ConvertDecimalToNull(txtMinApprovalLimit.Text), UDFLib.ConvertDecimalToNull(txtMaxApprovalLimit.Text), UDFLib.ConvertIntegerToNull(GetSessionUserID()));

        if (responseid != "0")
        {
            txtLimit.Text = Convert.ToString(responseid);
            SaveApprover();
            string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
        }
        else
        {
            string message = "alert('Approval limit already exist for this amount.')";
            ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
        }
    }
Exemplo n.º 13
0
    public List <TotalAmount> AsyncGet_TotalAmount()
    {
        BLL_TRV_TravelRequest objtr          = new BLL_TRV_TravelRequest();
        DataTable             dt_TotalAmount = objtr.Get_TotalAmount();
        List <TotalAmount>    dataList       = new List <TotalAmount>();

        foreach (DataRow dtrow in dt_TotalAmount.Rows)
        {
            TotalAmount details = new TotalAmount();

            details.MonthName = dtrow[1].ToString();

            details.totalAmount = UDFLib.ConvertDecimalToNull(dtrow[4]);

            dataList.Add(details);
        }
        return(dataList);
    }
Exemplo n.º 14
0
    protected void btnSaveUserDetails_Click(object sender, EventArgs e)
    {
        int retval = objUserBLL.Update_UserDetails(Convert.ToInt32(txtUserID.Text), txtFirstName.Text, "", txtLastName.Text, txtEMail.Text
                                                   , UDFLib.ConvertIntegerToNull(ddlDepartment.SelectedValue), UDFLib.ConvertIntegerToNull(ddlManager.SelectedValue)
                                                   , UDFLib.ConvertDecimalToNull(txtApprovalLimit.Text), txtDesignation.Text, txtMobileNo.Text
                                                   , UDFLib.ConvertDateToNull(txtDateOfBirth.Text), UDFLib.ConvertDateToNull(txtDateOfJoining.Text)
                                                   , UDFLib.ConvertDateToNull(txtDateOfProbation.Text)
                                                   , txtPermanentAddress.Text
                                                   , txtPresentAddress.Text, UDFLib.ConvertStringToNull(ddlUserType.SelectedValue)
                                                   , UDFLib.ConvertIntegerToNull(ddlCompany.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFleet.SelectedValue)
                                                   , null
                                                   , null
                                                   , int.Parse(ddlNationality.SelectedValue));


        BindUserGrid();

        string hidemodal = String.Format("hideModal('divadd')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
Exemplo n.º 15
0
    public List <tktBooked> AsyncGet_tktBooked()
    {
        BLL_TRV_TravelRequest objtr        = new BLL_TRV_TravelRequest();
        DataTable             dt_tktBooked = objtr.Get_tktBooked();
        List <tktBooked>      dataList     = new List <tktBooked>();

        foreach (DataRow dtrow in dt_tktBooked.Rows)
        {
            tktBooked details = new tktBooked();

            details.MonthName = dtrow[1].ToString();

            details.avgtkt = UDFLib.ConvertDecimalToNull(dtrow[7]);

            details.vslcount = UDFLib.ConvertIntegerToNull(dtrow[5]);

            details.totalticket = UDFLib.ConvertIntegerToNull(dtrow[4]);

            dataList.Add(details);
        }
        return(dataList);
    }
Exemplo n.º 16
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);
    }
Exemplo n.º 17
0
    protected DataTable Save_Orders()
    {
        DataTable dtItems = new DataTable();

        dtItems.Columns.Add("VESSEL_ID");
        dtItems.Columns.Add("ITEM_REF_CODE");
        dtItems.Columns.Add("ORD_QTY");

        DataTable dtvesselList = (DataTable)ViewState["vessellist"];

        foreach (GridViewRow gr in gvItemsSplit.Rows)
        {
            int    i             = 0;
            string item_ref_code = gr.Cells[0].Text;
            foreach (TableCell cell in gr.Cells)
            {
                DataRow dr = dtItems.NewRow();

                decimal?ord_qty = 0;
                if (i > lastFixedColumnID)
                {
                    ord_qty = UDFLib.ConvertDecimalToNull(((TextBox)cell.FindControl(i.ToString())).Text);

                    dr["VESSEL_ID"]     = ((HiddenField)gvItemsSplit.HeaderRow.Cells[i].FindControl("hdf" + i.ToString())).Value;
                    dr["ITEM_REF_CODE"] = item_ref_code;
                    dr["ORD_QTY"]       = ord_qty;

                    dtItems.Rows.Add(dr);
                }

                i++;
            }
        }

        return(BLL_PURC_Common.UPD_Reqsn_Split_IntoVessel(Request.QueryString["ReqsnCode"], dtItems, UDFLib.ConvertToInteger(Session["userid"].ToString())));
    }
Exemplo n.º 18
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        if (HiddenFlag.Value == "Add")
        {
            //int responseid = objBLLExchRate.Insert_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text)
            //    , UDFLib.ConvertDateToNull(dtpCurrentDate.Text), Convert.ToInt32(Session["USERID"]),txtBaseCurr.Text);
            if (!check(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDateToNull(dtpCurrentDate.Text)))
            {
                string js = "alert('Todays Currency Code AllReady Exist!');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert9", js, true);
                string Countrymodal = String.Format("showModal('divadd',false);");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Countrymodal", Countrymodal, true);
                ddlCurrency.Focus();

                return;
            }
            int responseid = objBLLExchRate.Insert_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text)
                                                                , UDFLib.ConvertDateToNull(dtpCurrentDate.Text));
        }
        else
        {
            //int responseid = objBLLExchRate.Edit_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text)
            //    , UDFLib.ConvertDateToNull(dtpCurrentDate.Text), Convert.ToInt32(Session["USERID"]));

            int responseid = objBLLExchRate.Edit_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text)
                                                              , UDFLib.ConvertDateToNull(dtpCurrentDate.Text));
        }

        BindExchRate();
        string hidemodal = String.Format("hideModal('divadd')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
Exemplo n.º 19
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Label   lblthresHoldID                    = (Label)FormView1.Row.Cells[0].FindControl("lblThresHoldId");
        TextBox txt01ME_TEMP_EXH_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_TEMP_EXH_Min");
        TextBox txt01ME_TEMP_EXH_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_TEMP_EXH_Max");
        TextBox txt01METB_T_EXH_INLET_MIN         = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_INLET_MIN");
        TextBox txt01METB_T_EXH_INLET_MAX         = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_INLET_MAX");
        TextBox txt01METB_T_EXH_OUTLET_MIN        = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_OUTLET_MIN");
        TextBox txt01METB_T_EXH_OUTLET_Max        = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_OUTLET_Max");
        TextBox txt01METB_T_EXH_AIR_IN_MIN        = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_AIR_IN_MIN");
        TextBox txt01METB_T_EXH_AIR_OUT_MIN       = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_AIR_OUT_MIN");
        TextBox txt01METB_T_EXH_AIR_IN_Max        = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_AIR_IN_Max");
        TextBox txt01METB_T_EXH_AIR_OUT_Max       = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_EXH_AIR_OUT_Max");
        TextBox txt01METB_T_SCAVENGE_MIN          = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_SCAVENGE_MIN");
        TextBox txt01METB_T_SCAVENGE_Max          = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_SCAVENGE_Max");
        TextBox txt01METB_T_LO_B_MIN              = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_LO_B_MIN");
        TextBox txt01METB_T_LO_B_MAX              = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_LO_B_MAX");
        TextBox txt01METB_T_LO_T_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_LO_T_Min");
        TextBox txt01METB_T_LO_T_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_T_LO_T_Max");
        TextBox txt01METB_P_PD_AC_Min             = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_P_PD_AC_Min");
        TextBox txt01METB_P_PD_AC_Max             = (TextBox)FormView1.Row.Cells[0].FindControl("txtMETB_P_PD_AC_Max");
        TextBox txt01ME_MB_IN_Min                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_MB_IN_Min");
        TextBox txt01ME_MB_IN_Max                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_MB_IN_Max");
        TextBox txt01ME_MB_OUT_Min                = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_MB_OUT_Min");
        TextBox txt01ME_MB_OUT_Max                = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_MB_OUT_Max");
        TextBox txt01ME_JC_IN_Min                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_IN_Min");
        TextBox txt01ME_JC_IN_Max                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_IN_Max");
        TextBox txt01ME_JC_OUT_Min                = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_OUT_Min");
        TextBox txt01ME_JC_OUT_Max                = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_OUT_Max");
        TextBox txt01ME_PC_IN_Min                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_IN_Min");
        TextBox txt01ME_PC_IN_Max                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_IN_Max");
        TextBox txt01ME_PC_OUT_Min                = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_OUT_Min");
        TextBox txt01ME_PC_OUT_Max                = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_OUT_Max");
        TextBox txt01ME_FUEL_OIL_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_FUEL_OIL_Min");
        TextBox txt01ME_FUEL_OIL_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_FUEL_OIL_Max");
        TextBox txt01ME_JC_FW_IN_min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_FW_IN_min");
        TextBox txt01ME_JC_FW_IN_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_FW_IN_Max");
        TextBox txt01ME_JC_FW_OUT_Min             = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_FW_OUT_Min");
        TextBox txt01ME_JC_FW_OUT_Max             = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_JC_FW_OUT_Max");
        TextBox txt01ME_LC_LO_IN_min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_LC_LO_IN_min");
        TextBox txt01ME_LC_LO_IN_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_LC_LO_IN_Max");
        TextBox txt01ME_LC_LO_OUT_Min             = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_LC_LO_OUT_Min");
        TextBox txt01ME_LC_LO_OUT_Max             = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_LC_LO_OUT_Max");
        TextBox txt01ME_PC_LO_IN_min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_LO_IN_min");
        TextBox txt01ME_PC_LO_IN_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_LO_IN_Max");
        TextBox txt01ME_PC_LO_OUT_min             = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_LO_OUT_min");
        TextBox txt01ME_PC_LO_OUT_Max             = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_PC_LO_OUT_Max");
        TextBox txt01ME_P_JACKET_WATER_min        = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_JACKET_WATER_min");
        TextBox txt01ME_P_JACKET_WATER_Max        = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_JACKET_WATER_Max");
        TextBox txt01ME_P_BEARING_XND_LO_Min      = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_BEARING_XND_LO_Min");
        TextBox txt01ME_P_BEARING_XND_LO_Max      = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_BEARING_XND_LO_Max");
        TextBox txt01ME_P_CAMSHAFT_LO_Min         = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_CAMSHAFT_LO_Min");
        TextBox txt01ME_P_CAMSHAFT_LO_Max         = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_CAMSHAFT_LO_Max");
        TextBox txt01ME_P_FV_COOLING_Min          = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_FV_COOLING_Min");
        TextBox txt01ME_P_FV_COOLING_Max          = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_FV_COOLING_Max");
        TextBox txt01ME_P_FUEL_OIL_min            = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_FUEL_OIL_min");
        TextBox txt01ME_P_FUEL_OIL_Max            = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_FUEL_OIL_Max");
        TextBox txt01ME_P_PISTON_COOLING_Min      = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_PISTON_COOLING_Min");
        TextBox txt01ME_P_PISTON_COOLING_Max      = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_PISTON_COOLING_Max");
        TextBox txt01ME_P_CONTROL_AIR_min         = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_CONTROL_AIR_min");
        TextBox txt01ME_P_CONTROL_AIR_Max         = (TextBox)FormView1.Row.Cells[0].FindControl("txtME_P_CONTROL_AIR_Max");
        TextBox txt01REF_MEAT_TEMP_Min            = (TextBox)FormView1.Row.Cells[0].FindControl("txtREF_MEAT_TEMP_Min");
        TextBox txt01REF_MEAT_TEMP_Max            = (TextBox)FormView1.Row.Cells[0].FindControl("txtREF_MEAT_TEMP_Max");
        TextBox txt01REF_FISH_TEMP_Min            = (TextBox)FormView1.Row.Cells[0].FindControl("txtREF_FISH_TEMP_Min");
        TextBox txt01REF_FISH_TEMP_Max            = (TextBox)FormView1.Row.Cells[0].FindControl("txtREF_FISH_TEMP_Max");
        TextBox txt01REF_VEG_LOBBY_TEMP_Min       = (TextBox)FormView1.Row.Cells[0].FindControl("txtREF_VEG_LOBBY_TEMP_Min");
        TextBox txt01REF_VEG_LOBBY_TEMP_Max       = (TextBox)FormView1.Row.Cells[0].FindControl("txtREF_VEG_LOBBY_TEMP_Max");
        TextBox txt01FWGEN_VACCUM_Min             = (TextBox)FormView1.Row.Cells[0].FindControl("txtFWGEN_VACCUM_Min");
        TextBox txt01FWGEN_VACCUM_Max             = (TextBox)FormView1.Row.Cells[0].FindControl("txtFWGEN_VACCUM_Max");
        TextBox txt01FWGEN_SHELL_TEMP_Min         = (TextBox)FormView1.Row.Cells[0].FindControl("txtFWGEN_SHELL_TEMP_Min");
        TextBox txt01FWGEN_SHELL_TEMP_Max         = (TextBox)FormView1.Row.Cells[0].FindControl("txtFWGEN_SHELL_TEMP_Max");
        TextBox txt01FWGEN_SALINITY_PPM_Min       = (TextBox)FormView1.Row.Cells[0].FindControl("txtFWGEN_SALINITY_PPM_Min");
        TextBox txt01FWGEN_SALINITY_PPM_Max       = (TextBox)FormView1.Row.Cells[0].FindControl("txtFWGEN_SALINITY_PPM_Max");
        TextBox txt01PUR_HO_TEMP_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtPUR_HO_TEMP_Min");
        TextBox txt01PUR_HO_TEMP_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtPUR_HO_TEMP_Max");
        TextBox txt01PUR_LO_TEMP_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtPUR_LO_TEMP_Min");
        TextBox txt01PUR_LO_TEMP_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtPUR_LO_TEMP_Max");
        TextBox txt01MISC_THRUST_BRG_TEMP_Min     = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_THRUST_BRG_TEMP_Min");
        TextBox txt01MISC_THRUST_BRG_TEMP_Max     = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_THRUST_BRG_TEMP_Max");
        TextBox txt01MISC_INTERM_BRG_TEMP_Min     = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_INTERM_BRG_TEMP_Min");
        TextBox txt01MISC_INTERM_BRG_TEMP_Max     = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_INTERM_BRG_TEMP_Max");
        TextBox txt01MISC_STERN_TUBE_OIL_TEMP_Min = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_STERN_TUBE_OIL_TEMP_Min");
        TextBox txt01MISC_STERN_TUBE_OIL_TEMP_Max = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_STERN_TUBE_OIL_TEMP_Max");
        TextBox txt01MISC_HO_SETT_1_Min           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SETT_1_Min");
        TextBox txt01MISC_HO_SETT_1_Max           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SETT_1_Max");
        TextBox txt01MISC_HO_SETT_2_Min           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SETT_2_Min");
        TextBox txt01MISC_HO_SETT_2_Max           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SETT_2_Max");
        TextBox txt01MISC_HO_SERV_1_Min           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SERV_1_Min");
        TextBox txt01MISC_HO_SERV_1_Max           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SERV_1_Max");
        TextBox txt01MISC_HO_SERV_2_Min           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SERV_2_Min");
        TextBox txt01MISC_HO_SERV_2_Max           = (TextBox)FormView1.Row.Cells[0].FindControl("txtMISC_HO_SERV_2_Max");
        TextBox txt01GE_TEMP_EXH_MAX_Min          = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_EXH_MAX_Min");
        TextBox txt01GE_TEMP_EXH_MAX_Max          = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_EXH_MAX_Max");
        TextBox txt01GE_TEMP_EXH_MIN_Min          = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_EXH_MIN_Min");
        TextBox txt01GE_TEMP_EXH_MIN_Max          = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_EXH_MIN_Max");
        TextBox txt01GE_TEMP_CW_IN_Min            = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_CW_IN_Min");
        TextBox txt01GE_TEMP_CW_IN_Max            = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_CW_IN_Max");
        TextBox txt01GE_TEMP_CW_OUT_Min           = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_CW_OUT_Min");
        TextBox txt01GE_TEMP_CW_OUT_Max           = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_CW_OUT_Max");
        TextBox txt01GE_TEMP_LO_IN_Min            = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_LO_IN_Min");
        TextBox txt01GE_TEMP_LO_IN_Max            = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_LO_IN_Max");
        TextBox txt01GE_TEMP_LO_OUT_Min           = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_LO_OUT_Min");
        TextBox txt01GE_TEMP_LO_OUT_Max           = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_TEMP_LO_OUT_Max");
        TextBox txt01GE_PRESS_LO_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_PRESS_LO_Min");
        TextBox txt01GE_PRESS_LO_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_PRESS_LO_Max");
        TextBox txt01GE_PRESS_CW_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_PRESS_CW_Min");
        TextBox txt01GE_PRESS_CW_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtGE_PRESS_CW_Max");
        TextBox txt01SG_LO_PRESS_Min              = (TextBox)FormView1.Row.Cells[0].FindControl("txtSG_LO_PRESS_Min");
        TextBox txt01SG_LO_PRESS_Max              = (TextBox)FormView1.Row.Cells[0].FindControl("txtSG_LO_PRESS_Max");
        TextBox txt01SG_LO_TEMP_Min               = (TextBox)FormView1.Row.Cells[0].FindControl("txtSG_LO_TEMP_Min");
        TextBox txt01SG_LO_TEMP_Max               = (TextBox)FormView1.Row.Cells[0].FindControl("txtSG_LO_TEMP_Max");
        TextBox txt01CREATED_BY                   = (TextBox)FormView1.Row.Cells[0].FindControl("txtCREATED_BY");
        TextBox txt01CREATED_DATE                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtCREATED_DATE");
        TextBox txt01MODIFIED_BY                  = (TextBox)FormView1.Row.Cells[0].FindControl("txtMODIFIED_BY");
        TextBox txt01MODIFIED_DATE                = (TextBox)FormView1.Row.Cells[0].FindControl("txtMODIFIED_DATE");
        TextBox txt01DELETED_BY                   = (TextBox)FormView1.Row.Cells[0].FindControl("txtDELETED_BY");
        TextBox txt01DELETED_DATE                 = (TextBox)FormView1.Row.Cells[0].FindControl("txtDELETED_DATE");
        TextBox txt01ACTIVE_STATUS                = (TextBox)FormView1.Row.Cells[0].FindControl("txtACTIVE_STATUS");

        int i = BLL_Tec_ErLog.Inser_Update_ErLogBookThresHold(UDFLib.ConvertIntegerToNull(lblthresHoldID.Text), int.Parse(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(txt01ME_TEMP_EXH_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_TEMP_EXH_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_INLET_MIN.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_INLET_MAX.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_OUTLET_MIN.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_OUTLET_Max.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_AIR_IN_MIN.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_AIR_OUT_MIN.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_AIR_IN_Max.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_EXH_AIR_OUT_Max.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_SCAVENGE_MIN.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01METB_T_SCAVENGE_Max.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_LO_B_MIN.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_LO_B_MAX.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01METB_T_LO_T_Min.Text), UDFLib.ConvertDecimalToNull(txt01METB_T_LO_T_Max.Text), UDFLib.ConvertDecimalToNull(txt01METB_P_PD_AC_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01METB_P_PD_AC_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_MB_IN_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_MB_IN_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_MB_OUT_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_MB_OUT_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_JC_IN_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_JC_IN_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_JC_OUT_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_JC_OUT_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_PC_IN_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_PC_IN_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_PC_OUT_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_PC_OUT_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_FUEL_OIL_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_FUEL_OIL_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_JC_FW_IN_min.Text), UDFLib.ConvertDecimalToNull(txt01ME_JC_FW_IN_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_JC_FW_OUT_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_JC_FW_OUT_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_LC_LO_IN_min.Text), UDFLib.ConvertDecimalToNull(txt01ME_LC_LO_IN_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_LC_LO_OUT_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_LC_LO_OUT_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_PC_LO_IN_min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_PC_LO_IN_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_PC_LO_OUT_min.Text), UDFLib.ConvertDecimalToNull(txt01ME_PC_LO_OUT_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_P_JACKET_WATER_min.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_JACKET_WATER_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_BEARING_XND_LO_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_P_BEARING_XND_LO_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_CAMSHAFT_LO_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_CAMSHAFT_LO_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_P_FV_COOLING_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_FV_COOLING_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_FUEL_OIL_min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_P_FUEL_OIL_Max.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_PISTON_COOLING_Min.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_PISTON_COOLING_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01ME_P_CONTROL_AIR_min.Text), UDFLib.ConvertDecimalToNull(txt01ME_P_CONTROL_AIR_Max.Text), UDFLib.ConvertDecimalToNull(txt01REF_MEAT_TEMP_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01REF_MEAT_TEMP_Max.Text), UDFLib.ConvertDecimalToNull(txt01REF_FISH_TEMP_Min.Text), UDFLib.ConvertDecimalToNull(txt01REF_FISH_TEMP_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01REF_VEG_LOBBY_TEMP_Min.Text), UDFLib.ConvertDecimalToNull(txt01REF_VEG_LOBBY_TEMP_Max.Text), UDFLib.ConvertDecimalToNull(txt01FWGEN_VACCUM_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01FWGEN_VACCUM_Max.Text), UDFLib.ConvertDecimalToNull(txt01FWGEN_SHELL_TEMP_Min.Text), UDFLib.ConvertDecimalToNull(txt01FWGEN_SHELL_TEMP_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01FWGEN_SALINITY_PPM_Min.Text), UDFLib.ConvertDecimalToNull(txt01FWGEN_SALINITY_PPM_Max.Text), UDFLib.ConvertDecimalToNull(txt01PUR_HO_TEMP_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01PUR_HO_TEMP_Max.Text), UDFLib.ConvertDecimalToNull(txt01PUR_LO_TEMP_Min.Text), UDFLib.ConvertDecimalToNull(txt01PUR_LO_TEMP_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01MISC_THRUST_BRG_TEMP_Min.Text), UDFLib.ConvertDecimalToNull(txt01MISC_THRUST_BRG_TEMP_Max.Text), UDFLib.ConvertDecimalToNull(txt01MISC_INTERM_BRG_TEMP_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01MISC_INTERM_BRG_TEMP_Max.Text), UDFLib.ConvertDecimalToNull(txt01MISC_STERN_TUBE_OIL_TEMP_Min.Text), UDFLib.ConvertDecimalToNull(txt01MISC_STERN_TUBE_OIL_TEMP_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01MISC_HO_SETT_1_Min.Text), UDFLib.ConvertDecimalToNull(txt01MISC_HO_SETT_1_Max.Text), UDFLib.ConvertDecimalToNull(txt01MISC_HO_SETT_2_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01MISC_HO_SETT_2_Max.Text), UDFLib.ConvertDecimalToNull(txt01MISC_HO_SERV_1_Min.Text), UDFLib.ConvertDecimalToNull(txt01MISC_HO_SERV_1_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01MISC_HO_SERV_2_Min.Text), UDFLib.ConvertDecimalToNull(txt01MISC_HO_SERV_2_Max.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_EXH_MAX_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01GE_TEMP_EXH_MAX_Max.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_EXH_MIN_Min.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_EXH_MIN_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01GE_TEMP_CW_IN_Min.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_CW_IN_Max.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_CW_OUT_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01GE_TEMP_CW_OUT_Max.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_LO_IN_Min.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_LO_IN_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01GE_TEMP_LO_OUT_Min.Text), UDFLib.ConvertDecimalToNull(txt01GE_TEMP_LO_OUT_Max.Text), UDFLib.ConvertDecimalToNull(txt01GE_PRESS_LO_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01GE_PRESS_LO_Max.Text), UDFLib.ConvertDecimalToNull(txt01GE_PRESS_CW_Min.Text), UDFLib.ConvertDecimalToNull(txt01GE_PRESS_CW_Max.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01SG_LO_PRESS_Min.Text), UDFLib.ConvertDecimalToNull(txt01SG_LO_PRESS_Max.Text), UDFLib.ConvertDecimalToNull(txt01SG_LO_TEMP_Min.Text),
                                                              UDFLib.ConvertDecimalToNull(txt01SG_LO_TEMP_Max.Text), Convert.ToInt32(Session["USERID"].ToString()));
        string js = "alertmessage(1);";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
        lblLogId.Text       = null;
        lblthresHoldID.Text = null;
        BindViews(null);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Repeater fvDetails = (Repeater)FormView1.Row.Cells[0].FindControl("rpEngine1");

        foreach (RepeaterItem ritem in fvDetails.Items)
        {
            DataTable dt = (fvDetails.DataSource as DataTable);

            Label   lblid       = (Label)ritem.FindControl("lblid");
            Label   lblVesselid = (Label)ritem.FindControl("lblVessel");
            TextBox tx1         = (TextBox)ritem.FindControl("txt1");
            TextBox tx2         = (TextBox)ritem.FindControl("txt2");
            TextBox tx3         = (TextBox)ritem.FindControl("txt3");
            TextBox tx4         = (TextBox)ritem.FindControl("txt4");
            TextBox tx5         = (TextBox)ritem.FindControl("txt5");
            TextBox tx6         = (TextBox)ritem.FindControl("txt6");
            TextBox tx7         = (TextBox)ritem.FindControl("txt7");
            TextBox tx8         = (TextBox)ritem.FindControl("txt8");
            TextBox tx9         = (TextBox)ritem.FindControl("txt9");
            TextBox tx10        = (TextBox)ritem.FindControl("txt10");
            TextBox tx11        = (TextBox)ritem.FindControl("txt11");
            TextBox tx12        = (TextBox)ritem.FindControl("txt12");
            TextBox tx13        = (TextBox)ritem.FindControl("txt13");
            TextBox tx14        = (TextBox)ritem.FindControl("txt14");
            TextBox tx15        = (TextBox)ritem.FindControl("txt15");
            TextBox tx16        = (TextBox)ritem.FindControl("txt16");
            TextBox tx17        = (TextBox)ritem.FindControl("txt17");
            TextBox tx18        = (TextBox)ritem.FindControl("txt18");
            TextBox tx19        = (TextBox)ritem.FindControl("txt19");
            TextBox tx20        = (TextBox)ritem.FindControl("txt20");
            TextBox tx21        = (TextBox)ritem.FindControl("txt21");
            TextBox tx22        = (TextBox)ritem.FindControl("txt22");
            TextBox tx23        = (TextBox)ritem.FindControl("txt23");
            TextBox tx24        = (TextBox)ritem.FindControl("txt24");
            TextBox tx01        = (TextBox)ritem.FindControl("txt01");
            TextBox tx02        = (TextBox)ritem.FindControl("txt02");
            TextBox tx03        = (TextBox)ritem.FindControl("txt03");
            TextBox tx04        = (TextBox)ritem.FindControl("txt04");
            TextBox tx05        = (TextBox)ritem.FindControl("txt05");
            TextBox tx06        = (TextBox)ritem.FindControl("txt06");
            TextBox tx07        = (TextBox)ritem.FindControl("txt07");
            TextBox tx08        = (TextBox)ritem.FindControl("txt08");
            TextBox tx09        = (TextBox)ritem.FindControl("txt09");
            TextBox tx010       = (TextBox)ritem.FindControl("txt010");
            TextBox tx011       = (TextBox)ritem.FindControl("txt011");
            TextBox tx012       = (TextBox)ritem.FindControl("txt012");
            TextBox tx013       = (TextBox)ritem.FindControl("txt013");
            TextBox tx014       = (TextBox)ritem.FindControl("txt014");
            TextBox tx015       = (TextBox)ritem.FindControl("txt015");
            TextBox tx016       = (TextBox)ritem.FindControl("txt016");
            TextBox tx017       = (TextBox)ritem.FindControl("txt017");
            TextBox tx018       = (TextBox)ritem.FindControl("txt018");
            TextBox tx019       = (TextBox)ritem.FindControl("txt019");
            TextBox tx020       = (TextBox)ritem.FindControl("txt020");
            TextBox tx021       = (TextBox)ritem.FindControl("txt021");
            TextBox tx022       = (TextBox)ritem.FindControl("txt022");
            TextBox tx023       = (TextBox)ritem.FindControl("txt023");
            TextBox tx024       = (TextBox)ritem.FindControl("txt024");
            bool    valstatus   = true;
            if ((UDFLib.ConvertDecimalToNull(tx1.Text) != null) && (UDFLib.ConvertDecimalToNull(tx01.Text) != null) && (decimal.Parse(tx1.Text) > decimal.Parse(tx01.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx2.Text) != null) && (UDFLib.ConvertDecimalToNull(tx02.Text) != null) && (decimal.Parse(tx2.Text) > decimal.Parse(tx02.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx3.Text) != null) && (UDFLib.ConvertDecimalToNull(tx03.Text) != null) && (decimal.Parse(tx3.Text) > decimal.Parse(tx03.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx4.Text) != null) && (UDFLib.ConvertDecimalToNull(tx04.Text) != null) && (decimal.Parse(tx4.Text) > decimal.Parse(tx04.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx5.Text) != null) && (UDFLib.ConvertDecimalToNull(tx05.Text) != null) && (decimal.Parse(tx5.Text) > decimal.Parse(tx05.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx6.Text) != null) && (UDFLib.ConvertDecimalToNull(tx06.Text) != null) && (decimal.Parse(tx6.Text) > decimal.Parse(tx06.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx7.Text) != null) && (UDFLib.ConvertDecimalToNull(tx07.Text) != null) && (decimal.Parse(tx7.Text) > decimal.Parse(tx07.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx8.Text) != null) && (UDFLib.ConvertDecimalToNull(tx08.Text) != null) && (decimal.Parse(tx8.Text) > decimal.Parse(tx08.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx9.Text) != null) && (UDFLib.ConvertDecimalToNull(tx09.Text) != null) && (decimal.Parse(tx9.Text) > decimal.Parse(tx09.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx10.Text) != null) && (UDFLib.ConvertDecimalToNull(tx010.Text) != null) && (decimal.Parse(tx10.Text) > decimal.Parse(tx010.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx11.Text) != null) && (UDFLib.ConvertDecimalToNull(tx011.Text) != null) && (decimal.Parse(tx11.Text) > decimal.Parse(tx011.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx12.Text) != null) && (UDFLib.ConvertDecimalToNull(tx012.Text) != null) && (decimal.Parse(tx12.Text) > decimal.Parse(tx012.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx13.Text) != null) && (UDFLib.ConvertDecimalToNull(tx013.Text) != null) && (decimal.Parse(tx13.Text) > decimal.Parse(tx013.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx14.Text) != null) && (UDFLib.ConvertDecimalToNull(tx014.Text) != null) && (decimal.Parse(tx14.Text) > decimal.Parse(tx014.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx15.Text) != null) && (UDFLib.ConvertDecimalToNull(tx015.Text) != null) && (decimal.Parse(tx15.Text) > decimal.Parse(tx015.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx16.Text) != null) && (UDFLib.ConvertDecimalToNull(tx016.Text) != null) && (decimal.Parse(tx16.Text) > decimal.Parse(tx016.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx17.Text) != null) && (UDFLib.ConvertDecimalToNull(tx017.Text) != null) && (decimal.Parse(tx17.Text) > decimal.Parse(tx017.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx18.Text) != null) && (UDFLib.ConvertDecimalToNull(tx018.Text) != null) && (decimal.Parse(tx18.Text) > decimal.Parse(tx018.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx19.Text) != null) && (UDFLib.ConvertDecimalToNull(tx019.Text) != null) && (decimal.Parse(tx19.Text) > decimal.Parse(tx019.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx20.Text) != null) && (UDFLib.ConvertDecimalToNull(tx020.Text) != null) && (decimal.Parse(tx20.Text) > decimal.Parse(tx020.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx21.Text) != null) && (UDFLib.ConvertDecimalToNull(tx021.Text) != null) && (decimal.Parse(tx21.Text) > decimal.Parse(tx021.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx22.Text) != null) && (UDFLib.ConvertDecimalToNull(tx022.Text) != null) && (decimal.Parse(tx22.Text) > decimal.Parse(tx022.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx23.Text) != null) && (UDFLib.ConvertDecimalToNull(tx023.Text) != null) && (decimal.Parse(tx23.Text) > decimal.Parse(tx023.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx24.Text) != null) && (UDFLib.ConvertDecimalToNull(tx024.Text) != null) && (decimal.Parse(tx24.Text) > decimal.Parse(tx024.Text)))
            {
                valstatus = false;
            }

            if (valstatus)
            {
                int i = BLL_Tec_ErLog.ErLog_ME_01_THRESHOLD_Update(UDFLib.ConvertIntegerToNull(lblid.Text), int.Parse(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(tx1.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx2.Text), UDFLib.ConvertDecimalToNull(tx3.Text), UDFLib.ConvertDecimalToNull(tx4.Text), UDFLib.ConvertDecimalToNull(tx5.Text), UDFLib.ConvertDecimalToNull(tx6.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx7.Text), UDFLib.ConvertDecimalToNull(tx8.Text), UDFLib.ConvertDecimalToNull(tx9.Text), UDFLib.ConvertDecimalToNull(tx10.Text), UDFLib.ConvertDecimalToNull(tx01.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx02.Text), UDFLib.ConvertDecimalToNull(tx03.Text), UDFLib.ConvertDecimalToNull(tx04.Text), UDFLib.ConvertDecimalToNull(tx05.Text), UDFLib.ConvertDecimalToNull(tx06.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx07.Text), UDFLib.ConvertDecimalToNull(tx08.Text), UDFLib.ConvertDecimalToNull(tx09.Text), UDFLib.ConvertDecimalToNull(tx010.Text), UDFLib.ConvertDecimalToNull(tx11.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx011.Text), UDFLib.ConvertDecimalToNull(tx12.Text), UDFLib.ConvertDecimalToNull(tx012.Text), UDFLib.ConvertDecimalToNull(tx13.Text), UDFLib.ConvertDecimalToNull(tx013.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx14.Text), UDFLib.ConvertDecimalToNull(tx014.Text), UDFLib.ConvertDecimalToNull(tx15.Text), UDFLib.ConvertDecimalToNull(tx015.Text), UDFLib.ConvertDecimalToNull(tx16.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx016.Text), UDFLib.ConvertDecimalToNull(tx17.Text), UDFLib.ConvertDecimalToNull(tx017.Text), UDFLib.ConvertDecimalToNull(tx18.Text), UDFLib.ConvertDecimalToNull(tx018.Text)
                                                                   , UDFLib.ConvertDecimalToNull(tx19.Text), UDFLib.ConvertDecimalToNull(tx019.Text), UDFLib.ConvertDecimalToNull(tx20.Text), UDFLib.ConvertDecimalToNull(tx020.Text), UDFLib.ConvertDecimalToNull(tx21.Text),
                                                                   UDFLib.ConvertDecimalToNull(tx021.Text), UDFLib.ConvertDecimalToNull(tx22.Text), UDFLib.ConvertDecimalToNull(tx022.Text), UDFLib.ConvertDecimalToNull(tx23.Text), UDFLib.ConvertDecimalToNull(tx023.Text)
                                                                   , UDFLib.ConvertDecimalToNull(tx24.Text), UDFLib.ConvertDecimalToNull(tx024.Text), 1);
                string js = "alert('Changes are updated ');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
            else
            {
                string js = "alert('Please check your data');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
        }
    }
Exemplo n.º 21
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        try
        {
            if (FileUpload1.HasFile)
            {
                //FileUpload1.
                string strLocalPath = FileUpload1.PostedFile.FileName;

                string FileName = Path.GetFileName(strLocalPath);

                if (Path.GetExtension(FileName).ToUpper() == ".XLS")
                {
                    try
                    {
                        FileUpload1.PostedFile.SaveAs(Server.MapPath("TempUpload\\" + FileName));


                        string strPath = Server.MapPath("TempUpload\\" + FileName).ToString();


                        //string[] arrfn = FileName.Split('\\');
                        // string strPath = Server.MapPath("SendRFQ") + "\\" + arrfn[arrfn.Length - 1];

                        ExlApp     = new Microsoft.Office.Interop.Excel.Application();
                        ExlWrkBook = ExlApp.Workbooks.Open(strPath,
                                                           0,
                                                           true,
                                                           5,
                                                           "", "",
                                                           true,
                                                           Microsoft.Office.Interop.Excel.XlPlatform.xlWindows,
                                                           "\t",
                                                           false,
                                                           false,
                                                           0,
                                                           true,
                                                           1,
                                                           0);
                        ExlWrkSheet = (Microsoft.Office.Interop.Excel.Worksheet)ExlWrkBook.ActiveSheet;


                        int Quotation_ID   = UDFLib.ConvertToInteger(((ExcelNS.Range)ExlWrkSheet.Cells[6, 15]).Value2);
                        int QuotationIDrow = Convert.ToInt32(hdf_QuotationID.Value);
                        if (Quotation_ID == QuotationIDrow)
                        {
                            DataTable dtCharges = new DataTable();
                            dtCharges.Columns.Add("Currency");
                            dtCharges.Columns.Add("Truck_Charge");
                            dtCharges.Columns.Add("Barge_Charge");
                            dtCharges.Columns.Add("Freight_Charge");
                            dtCharges.Columns.Add("Pkg_Hld_Charge");
                            dtCharges.Columns.Add("Other_Charge");
                            dtCharges.Columns.Add("Vat");
                            dtCharges.Columns.Add("Discount");


                            DataRow drCharges = dtCharges.NewRow();
                            drCharges["Currency"]       = UDFLib.ConvertIntegerToNull(((ExcelNS.Range)ExlWrkSheet.Cells[5, 3]).Value2);
                            drCharges["Truck_Charge"]   = UDFLib.ConvertDecimalToNull(((ExcelNS.Range)ExlWrkSheet.Cells[9, 3]).Value2);
                            drCharges["Barge_Charge"]   = UDFLib.ConvertDecimalToNull(((ExcelNS.Range)ExlWrkSheet.Cells[9, 9]).Value2);
                            drCharges["Freight_Charge"] = UDFLib.ConvertDecimalToNull(((ExcelNS.Range)ExlWrkSheet.Cells[5, 9]).Value2);
                            drCharges["Pkg_Hld_Charge"] = UDFLib.ConvertDecimalToNull(((ExcelNS.Range)ExlWrkSheet.Cells[7, 9]).Value2);
                            drCharges["Other_Charge"]   = UDFLib.ConvertDecimalToNull(((ExcelNS.Range)ExlWrkSheet.Cells[8, 9]).Value2);
                            drCharges["Vat"]            = UDFLib.ConvertDecimalToNull(((ExcelNS.Range)ExlWrkSheet.Cells[9, 7]).Value2);
                            drCharges["Discount"]       = UDFLib.ConvertDecimalToNull(((ExcelNS.Range)ExlWrkSheet.Cells[8, 3]).Value2);

                            dtCharges.Rows.Add(drCharges);

                            DataTable dtItemPrice = new DataTable();
                            dtItemPrice.Columns.Add("pkid", typeof(int));
                            dtItemPrice.Columns.Add("rate", typeof(decimal));
                            dtItemPrice.Columns.Add("discount", typeof(decimal));
                            dtItemPrice.Columns.Add("unit", typeof(string));
                            dtItemPrice.Columns.Add("supp_remark");

                            DataRow drNew;
                            int     i = 15;
                            while (((ExcelNS.Range)ExlWrkSheet.Cells[i, 1]).Value2 != null)
                            {
                                double value = 0;
                                if (double.TryParse(((ExcelNS.Range)ExlWrkSheet.Cells[i, 1]).Value2.ToString(), out value))
                                {
                                    drNew         = dtItemPrice.NewRow();
                                    drNew["pkid"] = ((ExcelNS.Range)ExlWrkSheet.Cells[i, 4]).Value2.ToString();


                                    if (((ExcelNS.Range)ExlWrkSheet.Cells[i, 6]).Value2 != null)
                                    {
                                        drNew["unit"] = ((ExcelNS.Range)ExlWrkSheet.Cells[i, 6]).Value2.ToString();
                                    }
                                    else
                                    {
                                        drNew["unit"] = "";
                                    }

                                    if (((ExcelNS.Range)ExlWrkSheet.Cells[i, 8]).Value2 != null)
                                    {
                                        drNew["rate"] = ((ExcelNS.Range)ExlWrkSheet.Cells[i, 8]).Value2.ToString();
                                    }
                                    else
                                    {
                                        drNew["rate"] = "0";
                                    }
                                    if (((ExcelNS.Range)ExlWrkSheet.Cells[i, 9]).Value2 != null)
                                    {
                                        drNew["discount"] = ((ExcelNS.Range)ExlWrkSheet.Cells[i, 9]).Value2.ToString();
                                    }
                                    else
                                    {
                                        drNew["discount"] = "0";
                                    }

                                    if (((ExcelNS.Range)ExlWrkSheet.Cells[i, 12]).Value2 != null)
                                    {
                                        drNew["supp_remark"] = ((ExcelNS.Range)ExlWrkSheet.Cells[i, 12]).Value2.ToString();
                                    }
                                    else
                                    {
                                        drNew["supp_remark"] = "";
                                    }

                                    dtItemPrice.Rows.Add(drNew);
                                }
                                i = i + 3;
                            }
                            dtItemPrice.AcceptChanges();

                            if (dtItemPrice.Rows.Count > 0)
                            {
                                if (dtItemPrice.Select("rate > 0").Length > 0)
                                {
                                    BLL_PURC_CTP.Upd_Ctp_Items_Price(Quotation_ID, dtItemPrice, Convert.ToInt32(Session["userid"].ToString()), 1, dtCharges);
                                    BindDataItems();
                                }
                            }
                        }
                        else
                        {
                        }
                    }
                    catch { }
                    finally
                    {
                        ExlWrkBook.Close(null, null, null);
                        //ExlApp.Workbooks.Close();
                        ExlApp.Quit();
                        Marshal.ReleaseComObject(ExlApp);
                        Marshal.ReleaseComObject(ExlWrkSheet);
                        Marshal.ReleaseComObject(ExlWrkBook);
                    }
                }
                else
                {
                    String msg = String.Format("alert('The uploaded file do not belong to the selected supplier');");
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msginvalidSupplier", msg, true);
                }
            }
        }
        catch (Exception ex)
        {
            String msg = String.Format("alert('The uploaded file do not belong to the selected supplier');");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
        }
    }
Exemplo n.º 22
0
    protected void btnSaveCostItem_Click(object sender, EventArgs e)
    {
        try
        {
            string js;
            if (txtExp_Date.Text.Trim().Length == 0)
            {
                js = "alert('Date is not Valid!');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true);
                js = "showModal('dvPopupCostItem');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "updated1", js, true);
                UpdatePanel2.Update();
                return;
            }
            else
            {
                try
                {
                    DateTime dt = DateTime.Parse(UDFLib.ConvertToDefaultDt(txtExp_Date.Text));
                }
                catch
                {
                    js = "alert('Enter valid  Date" + TodayDateFormat + "')";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "scripts", js, true);
                    js = "showModal('dvPopupCostItem');";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true);
                    UpdatePanel2.Update();
                    return;
                }
            }
            if (txtDesc.Text.ToString().Length == 0 || ddlExpType.SelectedIndex <= 0 || ddlLocalCurr.SelectedIndex == 0 || txtLocalAmt.Text.Trim().Length == 0)
            {
                js = "showModal('dvPopupCostItem');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "updated1", js, true);
                UpdatePanel2.Update();
                return;
            }

            int Vessel_ID    = UDFLib.ConvertToInteger(Request.QueryString["Vessel_ID"]);
            int Office_ID    = UDFLib.ConvertToInteger(Request.QueryString["Office_ID"]);
            int Cost_Item_ID = BLL_Crew_MedHistory.INSERT_Med_Cost_Item(UDFLib.ConvertToInteger(hdnCaseID.Value), Vessel_ID, Office_ID, UDFLib.ConvertToDefaultDt(Convert.ToString(txtExp_Date.Text)), txtDesc.Text, UDFLib.ConvertToInteger(ddlExpType.SelectedValue), UDFLib.ConvertToInteger(ddlLocalCurr.SelectedValue), UDFLib.ConvertDecimalToNull(txtLocalAmt.Text), UDFLib.ConvertDecimalToNull(txtUSDAmt.Text), GetSessionUserID());

            Upload_CostItemAttachments(Cost_Item_ID);

            Load_Crew_MedHistory_Details(UDFLib.ConvertToInteger(hdnCaseID.Value), Vessel_ID, Office_ID);

            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
        finally
        {
            Session["MedicalCostItemAttachments"] = null;
        }
    }
    protected int InvoiceUpload(string FileStatus, string Action_On_Data_Form)
    {
        int ret = 0;

        try
        {
            if (FileUploader.HasFile)
            {
                if (FileUploader.FileName != "")
                {
                    string strLocalPath  = FileUploader.PostedFile.FileName;
                    string FileName      = Path.GetFileName(strLocalPath);
                    string FileExtension = Path.GetExtension(strLocalPath);
                    int    TYPE          = 0;
                    string InvoiceType   = "CREDIT";
                    Guid   FileGuid      = System.Guid.NewGuid();

                    FileUploader.PostedFile.SaveAs(Server.MapPath(@"~/Uploads\\ASL\\Invoice\\" + FileGuid + FileExtension));

                    ret = BLL_ASL_Supplier.Supplier_Upload_Document_Insert(UDFLib.ConvertIntegerToNull(txtFileID.Text.Trim()), UDFLib.ConvertStringToNull(GetSupplierCode()), UDFLib.ConvertStringToNull(GetSuppID()), FileName, FileGuid + FileExtension, FileExtension
                                                                           , txtInvioceRef.Text.Trim(), UDFLib.ConvertDateToNull(txtInvoiceDate.Text), UDFLib.ConvertDecimalToNull(txtInvoiceAmount.Text), UDFLib.ConvertDecimalToNull(txtTaxAmount.Text), txtRemarks.Text.Trim(),
                                                                           UDFLib.ConvertDateToNull(txtDueDate.Text), FileStatus, Action_On_Data_Form, InvoiceType, UDFLib.ConvertIntegerToNull(Session["userid"]), TYPE);
                }
            }
            else if (lblFileName.Text != "")
            {
                string FileName      = "";
                string FileExtension = "";
                int    TYPE          = 0;
                string InvoiceType   = "CREDIT";
                Guid   FileGuid      = System.Guid.NewGuid();
                ret = BLL_ASL_Supplier.Supplier_Upload_Document_Insert(UDFLib.ConvertIntegerToNull(txtFileID.Text.Trim()), UDFLib.ConvertStringToNull(GetSupplierCode()), UDFLib.ConvertStringToNull(GetSuppID()), FileName, "", FileExtension
                                                                       , txtInvioceRef.Text.Trim(), UDFLib.ConvertDateToNull(txtInvoiceDate.Text), UDFLib.ConvertDecimalToNull(txtInvoiceAmount.Text), UDFLib.ConvertDecimalToNull(txtTaxAmount.Text), txtRemarks.Text.Trim(),
                                                                       UDFLib.ConvertDateToNull(txtDueDate.Text), FileStatus, Action_On_Data_Form, InvoiceType, UDFLib.ConvertIntegerToNull(Session["userid"]), TYPE);
            }
            return(ret);
        }

        catch { return(ret); }
        {
        }
    }
Exemplo n.º 24
0
 protected void btnWithhold_Click(object sender, EventArgs e)
 {
     try
     {
         string Invoice_Type  = "WITHHOLD";
         string Withhold_Mode = "WITHHOLD";
         String msg2          = null;
         int    retval        = BLL_POLOG_Register.POLog_Insert_Withhold_Invoice(UDFLib.ConvertStringToNull(txtInvoiceCode.Text), UDFLib.ConvertIntegerToNull(txtPOCode.Text), 0, Invoice_Type
                                                                                 , UDFLib.ConvertDecimalToNull(txtAmount.Text), txtReason.Text, UDFLib.ConvertToInteger(GetSessionUserID()), Withhold_Mode, null);
         if (retval > 0)
         {
             txtReason.Text = "";
             txtAmount.Text = "";
             int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(txtInvoiceCode.Text), "Withhold Invoice", "WithholdInvoice", UDFLib.ConvertToInteger(GetSessionUserID()));
             msg2 = String.Format("alert('Invoice amount Submitted for Withhold.')");
             //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg2, true);
             BindGrid();
         }
         else
         {
             msg2 = String.Format("alert('Withhold amount Cant be more then Invoice amount.')");
         }
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg2, true);
     }
     catch {}
     {
     }
 }
Exemplo n.º 25
0
    protected void cmdSave_Click(object sender, EventArgs e)
    {
        BLL_TRV_QuoteRequest Qr  = new BLL_TRV_QuoteRequest();
        IATAList             lst = new IATAList();
        int QuoteID = 0;;

        try
        {
            if (txtFare.Text.Trim() != "" && txtTax.Text.Trim() != "" && txtTicketDeadline.Text.Trim() != "" && txtGDSLocator.Text.Trim() != "")
            {
                if (!string.IsNullOrEmpty(Request.QueryString["QuoteID"]))
                {
                    QuoteID = Convert.ToInt32(Request.QueryString["QuoteID"]);
                }

                QuoteID = Qr.AddQuotation(RequestID, AgentID, txtGDSLocator.Text.Trim(),
                                          Convert.ToDateTime(txtTicketDeadline.Text.Trim()),
                                          Convert.ToDecimal(txtFare.Text.Trim()), Convert.ToDecimal(txtTax.Text.Trim()),
                                          txtPNRText.Text.Trim(), cmbCurrency.SelectedValue, Convert.ToInt32(Session["USERID"].ToString()),
                                          cmbHours.SelectedItem.Text, cmbMins.SelectedItem.Text, QuoteID,
                                          UDFLib.ConvertDecimalToNull(txtbaggageallowances.Text),
                                          UDFLib.ConvertDecimalToNull(txtDateChangeAllow.Text),
                                          UDFLib.ConvertDecimalToNull(txtCancellationCharge.Text));
                int cnt = 0;
                foreach (GridViewRow grFlt in GrdFlight.Rows)
                {
                    int Flight_ID = GrdFlight.DataKeys[grFlt.RowIndex].Values["ID"].ToString().Contains("-") ? 0 : Convert.ToInt32(GrdFlight.DataKeys[grFlt.RowIndex].Values["ID"].ToString());

                    Qr.AddQuotationFlights(QuoteID,
                                           (grFlt.FindControl("txtAirlineLocator") as TextBox).Text,
                                           (grFlt.FindControl("txtFrom") as TextBox).Text,
                                           (grFlt.FindControl("txtTo") as TextBox).Text,
                                           "",
                                           (grFlt.FindControl("txtFlight") as TextBox).Text,
                                           (grFlt.FindControl("cmbTravelClass") as DropDownList).SelectedValue,
                                           Convert.ToDateTime((grFlt.FindControl("txtDeparureDate") as TextBox).Text),
                                           Convert.ToDateTime((grFlt.FindControl("txtArrivalDate") as TextBox).Text),
                                           (grFlt.FindControl("cmbFlightStatus") as DropDownList).SelectedValue,
                                           (grFlt.FindControl("txtFlightRemark") as TextBox).Text,
                                           UDFLib.ConvertToInteger(Session["USERID"].ToString()),
                                           (grFlt.FindControl("cmbArrHours") as DropDownList).SelectedItem.Value,
                                           (grFlt.FindControl("cmbArrMins") as DropDownList).SelectedItem.Value,
                                           (grFlt.FindControl("cmbDepHours") as DropDownList).SelectedItem.Value,
                                           (grFlt.FindControl("cmbDepMins") as DropDownList).SelectedItem.Value,
                                           Flight_ID);



                    lst.fromIATA = (grFlt.FindControl("txtFrom") as TextBox).Text;
                    lst.toIATA   = (grFlt.FindControl("txtTo") as TextBox).Text;



                    cnt++;
                }
            }

            string js = "parent.newQuote_Closed();parent.hideModal('dvPopUp');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "closewindow", js, true);
        }
        catch { throw; }
        finally { Qr = null; }
    }
Exemplo n.º 26
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        //FilterRefreash();
        lblMessage.Text = "";
        string strLocalPath = FileUploader.PostedFile.FileName;

        string strVslImgPath = VesselImageUploader.PostedFile.FileName;

        string    FileName        = "";
        string    VslImg_FileName = "";
        DataTable dt = new DataTable();

        dt = objUploadFilesize.Get_Module_FileUpload("INF_");
        string datasize = dt.Rows[0]["Size_KB"].ToString();

        /*Added BY PRANALI_07032015 TO SAVE VESSEL IMAGE ATTACHMENT IN TABLE AND UPLOADS/VESSELIMAGE FOLDER.*/
        #region GET VESSEL IMAGE FILE NAME.
        if (VesselImageUploader.HasFile)
        {
            VslImg_FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss") + "_" + "VesselImage" + Path.GetExtension(strVslImgPath);
            VesselImageUploader.PostedFile.SaveAs(Server.MapPath("~/Uploads/VesselImage/" + VslImg_FileName));
        }
        #endregion

        #region FINAL SAVE CODE.
        int Retval = 0;
        if (HiddenFlag.Value == "Add")
        {
            if (FileUploader.HasFile)
            {
                if (FileUploader.PostedFile.ContentLength < Int32.Parse(dt.Rows[0]["Size_KB"].ToString()) * 1024)
                {
                    FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss") + "_" + "PowerCurve" + Path.GetExtension(strLocalPath);

                    Retval = objBLL.INSERT_New_Vessel_WithImageName(null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, UDFLib.ConvertToInteger(ddlFleet_AddVessel.SelectedValue),
                                                                    UDFLib.ConvertToInteger(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                                                    UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                                                    UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", FileName, (VslImg_FileName == "" ? null : VslImg_FileName), UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue), Convert.ToBoolean(chkIsVessel.Checked), txtImoNo.Text, txtCallSign.Text);

                    FileUploader.PostedFile.SaveAs(Server.MapPath("~/Uploads/MEPowerCurve/" + FileName));
                }
                else
                {
                    lblMessage1.Text = datasize + " KB File size exceeds maximum limit";
                }
            }
            else
            {
                FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss") + "_" + "PowerCurve" + Path.GetExtension(strLocalPath);
                Retval   = objBLL.INSERT_New_Vessel_WithImageName(null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, UDFLib.ConvertToInteger(ddlFleet_AddVessel.SelectedValue),
                                                                  UDFLib.ConvertToInteger(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                                                  UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                                                  UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", null, (VslImg_FileName == "" ? null : VslImg_FileName), UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue), Convert.ToBoolean(chkIsVessel.Checked), txtImoNo.Text, txtCallSign.Text);
            }
        }
        else
        if (FileUploader.HasFile)
        {
            if (FileUploader.PostedFile.ContentLength < Int32.Parse(dt.Rows[0]["Size_KB"].ToString()) * 1024)
            {
                FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss") + "_" + "PowerCurve" + Path.GetExtension(strLocalPath);
                if (!VesselImageUploader.HasFile)
                {
                    VslImg_FileName = lnkVslImage.Text;
                }
                Retval = objBLL.UPDATE_Vessel_WithImageName(Convert.ToInt32(txtVesselID.Text), null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, Convert.ToInt32(ddlFleet_AddVessel.SelectedValue)
                                                            , Convert.ToInt32(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                                            UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                                            UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", FileName, (VslImg_FileName == "" ? null : VslImg_FileName), UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue), Convert.ToBoolean(chkIsVessel.Checked), txtImoNo.Text, txtCallSign.Text);
                FileUploader.PostedFile.SaveAs(Server.MapPath("~/Uploads/MEPowerCurve/" + FileName));
            }
            else
            {
                lblMessage1.Text = datasize + " KB File size exceeds maximum limit";
            }
        }
        else
        {
            FileName = lnkAttachment.Text;
            if (!VesselImageUploader.HasFile)
            {
                VslImg_FileName = lnkVslImage.Text;
            }

            Retval = objBLL.UPDATE_Vessel_WithImageName(Convert.ToInt32(txtVesselID.Text), null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, Convert.ToInt32(ddlFleet_AddVessel.SelectedValue)
                                                        , Convert.ToInt32(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                                        UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                                        UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", FileName, (VslImg_FileName == "" ? null : VslImg_FileName), UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue), Convert.ToBoolean(chkIsVessel.Checked), txtImoNo.Text, txtCallSign.Text);
        }
        if (Retval > 0)
        {
            BindVesselGrid();
            string hidemodal = String.Format("hideModal('dvAddNewVessel')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        else
        {
            if (Retval == -1)
            {
                lblMessage1.Text = "Vessel name already exist.";
            }
            if (Retval == -2)
            {
                lblMessage1.Text = "Vessel short name already exist.";
            }
            if (Retval == -3)
            {
                lblMessage1.Text = "Vessel short name already exist for deleted vessel.(Vessel short name should be unique)";
            }
            string AddNewVessel = String.Format("showModal('dvAddNewVessel',false);");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddNewVessel", AddNewVessel, true);
        }
        #endregion
    }
Exemplo n.º 27
0
    protected void btnSaveItem_Click(object sender, EventArgs e)
    {
        try
        {
            StringBuilder     insetItem      = new StringBuilder();
            string            strCrtical     = null;
            Boolean           Catalogue_Item = true;
            BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();

            if (ViewState["Reqsn_Type"].ToString() == "SP")
            {
                strCrtical = ddlCritical.SelectedValue;
            }
            else if (ViewState["Reqsn_Type"].ToString() == "RP")
            {
                strCrtical = ddlCritical.SelectedValue;
            }
            if (ViewState["Item_Type"].ToString() == "Free_Item")
            {
                Catalogue_Item = false;
            }
            else
            {
                Catalogue_Item = true;
            }
            string val = objTechService.LibraryItemSave(Convert.ToInt32(GetSessionUserID()), Convert.ToString(GetCatalogue()), Convert.ToString(GetSubCatalogue()),
                                                        txtItemPartNumber.Text.Trim(), txtItemName.Text.Trim(), txtItemDescription.Text.Trim(), txtItemDrawingNumber.Text.Trim(), ddlUnit.SelectedItem.Text, UDFLib.ConvertDecimalToNull(txtMinQty.Text.Trim()), UDFLib.ConvertDecimalToNull(txtMaxQty.Text.Trim()), ViewState["VesselID"].ToString(),
                                                        UDFLib.ConvertIntegerToNull(ddlItemCategory.SelectedValue), hdnImageURL.Value, hdnProductURL.Value, UDFLib.ConvertIntegerToNull(strCrtical), Catalogue_Item);



            if (val == "0")
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Item Name with same part no already exists..');", true);
            }
            else
            {
                if (ViewState["Item_Type"].ToString() == "Free_Item")
                {
                    SaveInventryItem(val);
                }

                BindItem(val);
                string message = "alert('Item Added successfully.')";
                ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
                //string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
        finally
        {
        }
    }
Exemplo n.º 28
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Repeater fvDetails  = (Repeater)FormView1.Row.Cells[0].FindControl("rpEngine3");
        Repeater fvDetails1 = (Repeater)FormView1.Row.Cells[0].FindControl("Repeater1");
        Repeater fvDetails2 = (Repeater)FormView1.Row.Cells[0].FindControl("Repeater2");

        int i = -1;

        foreach (RepeaterItem ritem in fvDetails.Items)
        {
            bool valstatus = true;
            i = i + 1;;
            Label   lblid    = (Label)ritem.FindControl("lblid");
            Label   lbllogid = (Label)ritem.FindControl("lblLogId");
            TextBox tx1      = (TextBox)ritem.FindControl("txt1");
            TextBox tx2      = (TextBox)ritem.FindControl("txt2");
            TextBox tx3      = (TextBox)ritem.FindControl("txt3");
            TextBox tx4      = (TextBox)ritem.FindControl("txt4");
            TextBox tx5      = (TextBox)ritem.FindControl("txt5");
            TextBox tx6      = (TextBox)ritem.FindControl("txt6");
            TextBox tx7      = (TextBox)ritem.FindControl("txt7");
            TextBox tx8      = (TextBox)ritem.FindControl("txt8");
            TextBox tx9      = (TextBox)ritem.FindControl("txt9");
            TextBox tx10     = (TextBox)ritem.FindControl("txt10");
            TextBox tx11     = (TextBox)ritem.FindControl("txt11");
            TextBox tx12     = (TextBox)ritem.FindControl("txt12");
            TextBox tx13     = (TextBox)ritem.FindControl("txt13");
            TextBox tx14     = (TextBox)ritem.FindControl("txt14");
            TextBox tx15     = (TextBox)ritem.FindControl("txt15");
            TextBox tx16     = (TextBox)ritem.FindControl("txt16");
            TextBox tx17     = (TextBox)ritem.FindControl("txt17");
            TextBox tx18     = (TextBox)ritem.FindControl("txt18");
            TextBox tx19     = (TextBox)ritem.FindControl("txt19");
            TextBox tx01     = (TextBox)ritem.FindControl("txt01");
            TextBox tx02     = (TextBox)ritem.FindControl("txt02");
            TextBox tx03     = (TextBox)ritem.FindControl("txt03");
            TextBox tx04     = (TextBox)ritem.FindControl("txt04");
            TextBox tx05     = (TextBox)ritem.FindControl("txt05");
            TextBox tx06     = (TextBox)ritem.FindControl("txt06");
            TextBox tx07     = (TextBox)ritem.FindControl("txt07");
            TextBox tx08     = (TextBox)ritem.FindControl("txt08");
            TextBox tx09     = (TextBox)ritem.FindControl("txt09");
            TextBox tx010    = (TextBox)ritem.FindControl("txt010");
            TextBox tx011    = (TextBox)ritem.FindControl("txt011");
            TextBox tx012    = (TextBox)ritem.FindControl("txt012");
            TextBox tx013    = (TextBox)ritem.FindControl("txt013");
            TextBox tx014    = (TextBox)ritem.FindControl("txt014");
            TextBox tx015    = (TextBox)ritem.FindControl("txt015");
            TextBox tx016    = (TextBox)ritem.FindControl("txt016");
            TextBox tx017    = (TextBox)ritem.FindControl("txt017");
            TextBox tx018    = (TextBox)ritem.FindControl("txt018");
            TextBox tx019    = (TextBox)ritem.FindControl("txt019");

            RepeaterItem ritem1 = fvDetails2.Items[i];

            TextBox tx20  = (TextBox)ritem1.FindControl("txt20");
            TextBox tx21  = (TextBox)ritem1.FindControl("txt21");
            TextBox tx22  = (TextBox)ritem1.FindControl("txt22");
            TextBox tx23  = (TextBox)ritem1.FindControl("txt23");
            TextBox tx24  = (TextBox)ritem1.FindControl("txt24");
            TextBox tx25  = (TextBox)ritem1.FindControl("txt25");
            TextBox tx26  = (TextBox)ritem1.FindControl("txt26");
            TextBox tx27  = (TextBox)ritem1.FindControl("txt27");
            TextBox tx28  = (TextBox)ritem1.FindControl("txt28");
            TextBox tx29  = (TextBox)ritem1.FindControl("txt29");
            TextBox tx30  = (TextBox)ritem1.FindControl("txt30");
            TextBox tx31  = (TextBox)ritem1.FindControl("txt31");
            TextBox tx32  = (TextBox)ritem1.FindControl("txt32");
            TextBox tx020 = (TextBox)ritem1.FindControl("txt020");
            TextBox tx021 = (TextBox)ritem1.FindControl("txt021");
            TextBox tx022 = (TextBox)ritem1.FindControl("txt022");
            TextBox tx023 = (TextBox)ritem1.FindControl("txt023");
            TextBox tx024 = (TextBox)ritem1.FindControl("txt024");
            TextBox tx025 = (TextBox)ritem1.FindControl("txt025");
            TextBox tx026 = (TextBox)ritem1.FindControl("txt026");
            TextBox tx027 = (TextBox)ritem1.FindControl("txt027");
            TextBox tx028 = (TextBox)ritem1.FindControl("txt028");
            TextBox tx029 = (TextBox)ritem1.FindControl("txt029");
            TextBox tx030 = (TextBox)ritem1.FindControl("txt030");
            TextBox tx031 = (TextBox)ritem1.FindControl("txt031");
            TextBox tx032 = (TextBox)ritem1.FindControl("txt032");


            RepeaterItem ritem2 = fvDetails1.Items[i];
            TextBox      tx33   = (TextBox)ritem2.FindControl("txt33");
            TextBox      tx34   = (TextBox)ritem2.FindControl("txt34");
            TextBox      tx35   = (TextBox)ritem2.FindControl("txt35");
            TextBox      tx36   = (TextBox)ritem2.FindControl("txt36");
            TextBox      tx37   = (TextBox)ritem2.FindControl("txt37");
            TextBox      tx38   = (TextBox)ritem2.FindControl("txt38");
            TextBox      tx39   = (TextBox)ritem2.FindControl("txt39");
            TextBox      tx40   = (TextBox)ritem2.FindControl("txt40");
            TextBox      tx41   = (TextBox)ritem2.FindControl("txt41");
            TextBox      tx42   = (TextBox)ritem2.FindControl("txt42");
            TextBox      tx43   = (TextBox)ritem2.FindControl("txt43");
            TextBox      tx44   = (TextBox)ritem2.FindControl("txt44");
            TextBox      tx45   = (TextBox)ritem2.FindControl("txt45");
            TextBox      tx46   = (TextBox)ritem2.FindControl("txt46");
            TextBox      tx47   = (TextBox)ritem2.FindControl("txt47");
            TextBox      tx48   = (TextBox)ritem2.FindControl("txt48");
            TextBox      tx033  = (TextBox)ritem2.FindControl("txt33");
            TextBox      tx034  = (TextBox)ritem2.FindControl("txt34");
            TextBox      tx035  = (TextBox)ritem2.FindControl("txt35");
            TextBox      tx036  = (TextBox)ritem2.FindControl("txt36");
            TextBox      tx037  = (TextBox)ritem2.FindControl("txt37");
            TextBox      tx038  = (TextBox)ritem2.FindControl("txt38");
            TextBox      tx039  = (TextBox)ritem2.FindControl("txt39");
            TextBox      tx040  = (TextBox)ritem2.FindControl("txt40");
            TextBox      tx041  = (TextBox)ritem2.FindControl("txt41");
            TextBox      tx042  = (TextBox)ritem2.FindControl("txt42");
            TextBox      tx043  = (TextBox)ritem2.FindControl("txt43");
            TextBox      tx044  = (TextBox)ritem2.FindControl("txt44");
            TextBox      tx045  = (TextBox)ritem2.FindControl("txt45");
            TextBox      tx046  = (TextBox)ritem2.FindControl("txt46");
            TextBox      tx047  = (TextBox)ritem2.FindControl("txt47");
            TextBox      tx048  = (TextBox)ritem2.FindControl("txt48");

            if ((UDFLib.ConvertDecimalToNull(tx1.Text) != null) && (UDFLib.ConvertDecimalToNull(tx01.Text) != null) && (decimal.Parse(tx1.Text) > decimal.Parse(tx01.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx2.Text) != null) && (UDFLib.ConvertDecimalToNull(tx02.Text) != null) && (decimal.Parse(tx2.Text) > decimal.Parse(tx02.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx3.Text) != null) && (UDFLib.ConvertDecimalToNull(tx03.Text) != null) && (decimal.Parse(tx3.Text) > decimal.Parse(tx03.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx4.Text) != null) && (UDFLib.ConvertDecimalToNull(tx04.Text) != null) && (decimal.Parse(tx4.Text) > decimal.Parse(tx04.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx5.Text) != null) && (UDFLib.ConvertDecimalToNull(tx05.Text) != null) && (decimal.Parse(tx5.Text) > decimal.Parse(tx05.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx6.Text) != null) && (UDFLib.ConvertDecimalToNull(tx06.Text) != null) && (decimal.Parse(tx6.Text) > decimal.Parse(tx06.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx7.Text) != null) && (UDFLib.ConvertDecimalToNull(tx07.Text) != null) && (decimal.Parse(tx7.Text) > decimal.Parse(tx07.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx8.Text) != null) && (UDFLib.ConvertDecimalToNull(tx08.Text) != null) && (decimal.Parse(tx8.Text) > decimal.Parse(tx08.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx9.Text) != null) && (UDFLib.ConvertDecimalToNull(tx09.Text) != null) && (decimal.Parse(tx9.Text) > decimal.Parse(tx09.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx10.Text) != null) && (UDFLib.ConvertDecimalToNull(tx010.Text) != null) && (decimal.Parse(tx10.Text) > decimal.Parse(tx010.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx11.Text) != null) && (UDFLib.ConvertDecimalToNull(tx011.Text) != null) && (decimal.Parse(tx11.Text) > decimal.Parse(tx011.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx12.Text) != null) && (UDFLib.ConvertDecimalToNull(tx012.Text) != null) && (decimal.Parse(tx12.Text) > decimal.Parse(tx012.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx13.Text) != null) && (UDFLib.ConvertDecimalToNull(tx013.Text) != null) && (decimal.Parse(tx13.Text) > decimal.Parse(tx013.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx14.Text) != null) && (UDFLib.ConvertDecimalToNull(tx014.Text) != null) && (decimal.Parse(tx14.Text) > decimal.Parse(tx014.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx15.Text) != null) && (UDFLib.ConvertDecimalToNull(tx015.Text) != null) && (decimal.Parse(tx15.Text) > decimal.Parse(tx015.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx16.Text) != null) && (UDFLib.ConvertDecimalToNull(tx016.Text) != null) && (decimal.Parse(tx16.Text) > decimal.Parse(tx016.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx17.Text) != null) && (UDFLib.ConvertDecimalToNull(tx017.Text) != null) && (decimal.Parse(tx17.Text) > decimal.Parse(tx017.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx18.Text) != null) && (UDFLib.ConvertDecimalToNull(tx018.Text) != null) && (decimal.Parse(tx18.Text) > decimal.Parse(tx018.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx19.Text) != null) && (UDFLib.ConvertDecimalToNull(tx019.Text) != null) && (decimal.Parse(tx19.Text) > decimal.Parse(tx019.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx20.Text) != null) && (UDFLib.ConvertDecimalToNull(tx020.Text) != null) && (decimal.Parse(tx20.Text) > decimal.Parse(tx020.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx21.Text) != null) && (UDFLib.ConvertDecimalToNull(tx021.Text) != null) && (decimal.Parse(tx21.Text) > decimal.Parse(tx021.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx22.Text) != null) && (UDFLib.ConvertDecimalToNull(tx022.Text) != null) && (decimal.Parse(tx22.Text) > decimal.Parse(tx022.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx23.Text) != null) && (UDFLib.ConvertDecimalToNull(tx023.Text) != null) && (decimal.Parse(tx23.Text) > decimal.Parse(tx023.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx24.Text) != null) && (UDFLib.ConvertDecimalToNull(tx024.Text) != null) && (decimal.Parse(tx24.Text) > decimal.Parse(tx024.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx25.Text) != null) && (UDFLib.ConvertDecimalToNull(tx025.Text) != null) && (decimal.Parse(tx25.Text) > decimal.Parse(tx025.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx26.Text) != null) && (UDFLib.ConvertDecimalToNull(tx026.Text) != null) && (decimal.Parse(tx26.Text) > decimal.Parse(tx026.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx27.Text) != null) && (UDFLib.ConvertDecimalToNull(tx027.Text) != null) && (decimal.Parse(tx27.Text) > decimal.Parse(tx027.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx28.Text) != null) && (UDFLib.ConvertDecimalToNull(tx028.Text) != null) && (decimal.Parse(tx28.Text) > decimal.Parse(tx028.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx29.Text) != null) && (UDFLib.ConvertDecimalToNull(tx029.Text) != null) && (decimal.Parse(tx29.Text) > decimal.Parse(tx029.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx30.Text) != null) && (UDFLib.ConvertDecimalToNull(tx030.Text) != null) && (decimal.Parse(tx30.Text) > decimal.Parse(tx030.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx31.Text) != null) && (UDFLib.ConvertDecimalToNull(tx031.Text) != null) && (decimal.Parse(tx31.Text) > decimal.Parse(tx031.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx32.Text) != null) && (UDFLib.ConvertDecimalToNull(tx032.Text) != null) && (decimal.Parse(tx32.Text) > decimal.Parse(tx032.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx33.Text) != null) && (UDFLib.ConvertDecimalToNull(tx033.Text) != null) && (decimal.Parse(tx33.Text) > decimal.Parse(tx033.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx34.Text) != null) && (UDFLib.ConvertDecimalToNull(tx034.Text) != null) && (decimal.Parse(tx34.Text) > decimal.Parse(tx034.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx35.Text) != null) && (UDFLib.ConvertDecimalToNull(tx035.Text) != null) && (decimal.Parse(tx35.Text) > decimal.Parse(tx035.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx36.Text) != null) && (UDFLib.ConvertDecimalToNull(tx036.Text) != null) && (decimal.Parse(tx36.Text) > decimal.Parse(tx036.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx37.Text) != null) && (UDFLib.ConvertDecimalToNull(tx037.Text) != null) && (decimal.Parse(tx37.Text) > decimal.Parse(tx037.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx38.Text) != null) && (UDFLib.ConvertDecimalToNull(tx038.Text) != null) && (decimal.Parse(tx38.Text) > decimal.Parse(tx038.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx39.Text) != null) && (UDFLib.ConvertDecimalToNull(tx039.Text) != null) && (decimal.Parse(tx39.Text) > decimal.Parse(tx039.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx40.Text) != null) && (UDFLib.ConvertDecimalToNull(tx040.Text) != null) && (decimal.Parse(tx40.Text) > decimal.Parse(tx040.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx41.Text) != null) && (UDFLib.ConvertDecimalToNull(tx041.Text) != null) && (decimal.Parse(tx41.Text) > decimal.Parse(tx041.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx42.Text) != null) && (UDFLib.ConvertDecimalToNull(tx042.Text) != null) && (decimal.Parse(tx42.Text) > decimal.Parse(tx042.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx43.Text) != null) && (UDFLib.ConvertDecimalToNull(tx043.Text) != null) && (decimal.Parse(tx43.Text) > decimal.Parse(tx043.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx44.Text) != null) && (UDFLib.ConvertDecimalToNull(tx044.Text) != null) && (decimal.Parse(tx44.Text) > decimal.Parse(tx044.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx45.Text) != null) && (UDFLib.ConvertDecimalToNull(tx045.Text) != null) && (decimal.Parse(tx45.Text) > decimal.Parse(tx045.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx46.Text) != null) && (UDFLib.ConvertDecimalToNull(tx046.Text) != null) && (decimal.Parse(tx46.Text) > decimal.Parse(tx046.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx47.Text) != null) && (UDFLib.ConvertDecimalToNull(tx047.Text) != null) && (decimal.Parse(tx47.Text) > decimal.Parse(tx047.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx48.Text) != null) && (UDFLib.ConvertDecimalToNull(tx048.Text) != null) && (decimal.Parse(tx48.Text) > decimal.Parse(tx048.Text)))
            {
                valstatus = false;
            }

            if (valstatus)
            {
                int j = BLL_Tec_ErLog.ErLog_AC_FW_MISC_THRESHOLD_Update(UDFLib.ConvertIntegerToNull(lblid.Text), UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(tx1.Text), UDFLib.ConvertDecimalToNull(tx2.Text), UDFLib.ConvertDecimalToNull(tx3.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx4.Text), UDFLib.ConvertDecimalToNull(tx5.Text), UDFLib.ConvertDecimalToNull(tx6.Text), UDFLib.ConvertDecimalToNull(tx7.Text), UDFLib.ConvertDecimalToNull(tx8.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx9.Text), UDFLib.ConvertDecimalToNull(tx10.Text), UDFLib.ConvertDecimalToNull(tx11.Text), UDFLib.ConvertDecimalToNull(tx12.Text), UDFLib.ConvertDecimalToNull(tx13.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx14.Text), UDFLib.ConvertDecimalToNull(tx15.Text), UDFLib.ConvertDecimalToNull(tx16.Text), UDFLib.ConvertDecimalToNull(tx17.Text), UDFLib.ConvertDecimalToNull(tx18.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx19.Text), UDFLib.ConvertDecimalToNull(tx20.Text), UDFLib.ConvertDecimalToNull(tx21.Text), UDFLib.ConvertDecimalToNull(tx22.Text), UDFLib.ConvertDecimalToNull(tx23.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx24.Text), UDFLib.ConvertDecimalToNull(tx25.Text), UDFLib.ConvertDecimalToNull(tx26.Text), UDFLib.ConvertDecimalToNull(tx27.Text), UDFLib.ConvertDecimalToNull(tx28.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx29.Text), UDFLib.ConvertDecimalToNull(tx30.Text), UDFLib.ConvertDecimalToNull(tx31.Text), UDFLib.ConvertDecimalToNull(tx32.Text), UDFLib.ConvertDecimalToNull(tx33.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx34.Text), UDFLib.ConvertDecimalToNull(tx35.Text), UDFLib.ConvertDecimalToNull(tx36.Text), UDFLib.ConvertDecimalToNull(tx37.Text), UDFLib.ConvertDecimalToNull(tx38.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx39.Text), UDFLib.ConvertDecimalToNull(tx40.Text), UDFLib.ConvertDecimalToNull(tx41.Text), UDFLib.ConvertDecimalToNull(tx42.Text), UDFLib.ConvertDecimalToNull(tx43.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx44.Text), UDFLib.ConvertDecimalToNull(tx45.Text), UDFLib.ConvertDecimalToNull(tx46.Text), UDFLib.ConvertDecimalToNull(tx47.Text), UDFLib.ConvertDecimalToNull(tx48.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx01.Text), UDFLib.ConvertDecimalToNull(tx02.Text), UDFLib.ConvertDecimalToNull(tx03.Text), UDFLib.ConvertDecimalToNull(tx04.Text), UDFLib.ConvertDecimalToNull(tx05.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx06.Text), UDFLib.ConvertDecimalToNull(tx07.Text), UDFLib.ConvertDecimalToNull(tx08.Text), UDFLib.ConvertDecimalToNull(tx09.Text), UDFLib.ConvertDecimalToNull(tx010.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx011.Text), UDFLib.ConvertDecimalToNull(tx012.Text), UDFLib.ConvertDecimalToNull(tx013.Text), UDFLib.ConvertDecimalToNull(tx014.Text), UDFLib.ConvertDecimalToNull(tx015.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx016.Text), UDFLib.ConvertDecimalToNull(tx017.Text), UDFLib.ConvertDecimalToNull(tx018.Text), UDFLib.ConvertDecimalToNull(tx019.Text), UDFLib.ConvertDecimalToNull(tx020.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx021.Text), UDFLib.ConvertDecimalToNull(tx022.Text), UDFLib.ConvertDecimalToNull(tx023.Text), UDFLib.ConvertDecimalToNull(tx024.Text), UDFLib.ConvertDecimalToNull(tx025.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx026.Text), UDFLib.ConvertDecimalToNull(tx027.Text), UDFLib.ConvertDecimalToNull(tx028.Text), UDFLib.ConvertDecimalToNull(tx029.Text), UDFLib.ConvertDecimalToNull(tx030.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx031.Text), UDFLib.ConvertDecimalToNull(tx032.Text), UDFLib.ConvertDecimalToNull(tx033.Text), UDFLib.ConvertDecimalToNull(tx034.Text), UDFLib.ConvertDecimalToNull(tx05.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx036.Text), UDFLib.ConvertDecimalToNull(tx037.Text), UDFLib.ConvertDecimalToNull(tx038.Text), UDFLib.ConvertDecimalToNull(tx039.Text), UDFLib.ConvertDecimalToNull(tx040.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx041.Text), UDFLib.ConvertDecimalToNull(tx042.Text), UDFLib.ConvertDecimalToNull(tx043.Text), UDFLib.ConvertDecimalToNull(tx044.Text), UDFLib.ConvertDecimalToNull(tx045.Text),
                                                                        UDFLib.ConvertDecimalToNull(tx046.Text), UDFLib.ConvertDecimalToNull(tx047.Text), UDFLib.ConvertDecimalToNull(tx048.Text), 1);
                string js = "alert('Changes are updated');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
            else
            {
                string js = "alert('Please check your data');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
        }

        TextBox txtBLR_CW_CHLORIDES_BLR    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_BLR");
        TextBox txtBLR_CW_CHLORIDES_MEJW   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_MEJW");
        TextBox txtBLR_CW_CHLORIDES_MEPW   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_MEPW");
        TextBox txtBLR_CW_CHLORIDES_AE     = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_AE");
        TextBox txtBLR_CW_CHLORIDES_CMPR   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_CMPR");
        TextBox txtBLR_CW_ALKALINITY_BLR   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_BLR");
        TextBox txtBLR_CW_ALKALINITY_MEJW  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_MEJW");
        TextBox txtBLR_CW_ALKALINITY_MEPW  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_MEPW");
        TextBox txtBLR_CW_ALKALINITY_AE    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_AE");
        TextBox txtBLR_CW_ALKALINITY_CMPR  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_CMPR");
        TextBox txtBLR_CW_TALKALINITY_BLR  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_BLR");
        TextBox txtBLR_CW_TALKALINITY_MEJW = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_MEJW");
        TextBox txtBLR_CW_TALKALINITY_MEPW = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_MEPW");
        TextBox txtBLR_CW_TALKALINITY_AE   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_AE");
        TextBox txtBLR_CW_TALKALINITY_CMPR = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_CMPR");
        TextBox txtBLR_CW_PHOSPHATES_BLR   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_BLR");
        TextBox txtBLR_CW_PHOSPHATES_MEJW  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_MEJW");
        TextBox txtBLR_CW_PHOSPHATES_MEPW  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_MEPW");
        TextBox txtBLR_CW_PHOSPHATES_AE    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_AE");
        TextBox txtBLR_CW_PHOSPHATES_CMPR  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_CMPR");
        TextBox txtBLR_CW_BLOWDOWN_BLR     = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_BLR");
        TextBox txtBLR_CW_BLOWDOWN_MEJW    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_MEJW");
        TextBox txtBLR_CW_BLOWDOWN_MEPW    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_MEPW");
        TextBox txtBLR_CW_BLOWDOWN_AE      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_AE");
        TextBox txtBLR_CW_BLOWDOWN_CMPR    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_CMPR");
        TextBox txtBLR_CW_NITRITES_BLR     = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_BLR");
        TextBox txtBLR_CW_NITRITES_MEJW    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_MEJW");
        TextBox txtBLR_CW_NITRITES_MEPW    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_MEPW");
        TextBox txtBLR_CW_NITRITES_AE      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_AE");
        TextBox txtBLR_CW_NITRITES_CMPR    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_CMPR");
        TextBox txtBLR_CW_DOSAGE_BLR       = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_BLR");
        TextBox txtBLR_CW_DOSAGE_MEJW      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_MEJW");
        TextBox txtBLR_CW_DOSAGE_MEPW      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_MEPW");
        TextBox txtBLR_CW_DOSAGE_AE        = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_AE");
        TextBox txtBLR_CW_DOSAGE_CMPR      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_CMPR");

        TextBox txtBLR_CW_CHLORIDES_BLR_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_BLR_Max");
        TextBox txtBLR_CW_CHLORIDES_MEJW_Max   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_MEJW_Max");
        TextBox txtBLR_CW_CHLORIDES_MEPW_Max   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_MEPW_Max");
        TextBox txtBLR_CW_CHLORIDES_AE_Max     = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_AE_Max");
        TextBox txtBLR_CW_CHLORIDES_CMPR_Max   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_CHLORIDES_CMPR_Max");
        TextBox txtBLR_CW_ALKALINITY_BLR_Max   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_BLR_Max");
        TextBox txtBLR_CW_ALKALINITY_MEJW_Max  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_MEJW_Max");
        TextBox txtBLR_CW_ALKALINITY_MEPW_Max  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_MEPW_Max");
        TextBox txtBLR_CW_ALKALINITY_AE_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_AE_Max");
        TextBox txtBLR_CW_ALKALINITY_CMPR_Max  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_ALKALINITY_CMPR_Max");
        TextBox txtBLR_CW_TALKALINITY_BLR_Max  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_BLR_Max");
        TextBox txtBLR_CW_TALKALINITY_MEJW_Max = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_MEJW_Max");
        TextBox txtBLR_CW_TALKALINITY_MEPW_Max = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_MEPW_Max");
        TextBox txtBLR_CW_TALKALINITY_AE_Max   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_AE_Max");
        TextBox txtBLR_CW_TALKALINITY_CMPR_Max = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_TALKALINITY_CMPR_Max");
        TextBox txtBLR_CW_PHOSPHATES_BLR_Max   = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_BLR_Max");
        TextBox txtBLR_CW_PHOSPHATES_MEJW_Max  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_MEJW_Max");
        TextBox txtBLR_CW_PHOSPHATES_MEPW_Max  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_MEPW_Max");
        TextBox txtBLR_CW_PHOSPHATES_AE_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_AE_Max");
        TextBox txtBLR_CW_PHOSPHATES_CMPR_Max  = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_PHOSPHATES_CMPR_Max");
        TextBox txtBLR_CW_BLOWDOWN_BLR_Max     = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_BLR_Max");
        TextBox txtBLR_CW_BLOWDOWN_MEJW_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_MEJW_Max");
        TextBox txtBLR_CW_BLOWDOWN_MEPW_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_MEPW_Max");
        TextBox txtBLR_CW_BLOWDOWN_AE_Max      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_AE_Max");
        TextBox txtBLR_CW_BLOWDOWN_CMPR_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_BLOWDOWN_CMPR_Max");
        TextBox txtBLR_CW_NITRITES_BLR_Max     = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_BLR_Max");
        TextBox txtBLR_CW_NITRITES_MEJW_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_MEJW_Max");
        TextBox txtBLR_CW_NITRITES_MEPW_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_MEPW_Max");
        TextBox txtBLR_CW_NITRITES_AE_Max      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_AE_Max");
        TextBox txtBLR_CW_NITRITES_CMPR_Max    = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_NITRITES_CMPR_Max");
        TextBox txtBLR_CW_DOSAGE_BLR_Max       = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_BLR_Max");
        TextBox txtBLR_CW_DOSAGE_MEJW_Max      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_MEJW_Max");
        TextBox txtBLR_CW_DOSAGE_MEPW_Max      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_MEPW_Max");
        TextBox txtBLR_CW_DOSAGE_AE_Max        = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_AE_Max");
        TextBox txtBLR_CW_DOSAGE_CMPR_Max      = (TextBox)FormView1.Row.Cells[0].FindControl("txtBLR_CW_DOSAGE_CMPR_Max");

        int m = BLL_Tec_ErLog.ErLog_BLR_CW_THRESHOLD_Update(1, UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_BLR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_BLR_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_MEJW.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_MEJW_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_MEPW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_MEPW_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_AE.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_AE_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_CMPR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_CHLORIDES_CMPR_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_BLR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_BLR_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_MEJW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_MEJW_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_MEPW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_MEPW_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_AE.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_AE_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_CMPR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_ALKALINITY_CMPR_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_BLR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_BLR_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_MEJW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_MEJW_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_MEPW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_MEPW_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_AE.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_AE_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_CMPR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_TALKALINITY_CMPR_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_BLR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_BLR_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_MEJW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_MEJW_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_MEPW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_MEPW_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_AE.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_AE_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_CMPR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_PHOSPHATES_CMPR_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_BLR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_BLR_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_MEJW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_MEJW_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_MEPW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_MEPW_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_AE.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_AE_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_CMPR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_BLOWDOWN_CMPR_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_BLR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_BLR_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_MEJW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_MEJW_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_MEPW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_MEPW_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_AE.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_AE_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_CMPR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_NITRITES_CMPR_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_BLR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_BLR_Max.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_MEJW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_MEJW_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_MEPW.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_MEPW.Text),
                                                            UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_AE.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_AE_Max.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_CMPR.Text), UDFLib.ConvertDecimalToNull(txtBLR_CW_DOSAGE_CMPR_Max.Text), 1);
    }
Exemplo n.º 29
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        //FilterRefreash();
        lblMessage.Text = "";
        string    strLocalPath = FileUploader.PostedFile.FileName;
        string    FileName     = "";
        DataTable dt           = new DataTable();

        dt = objUploadFilesize.Get_Module_FileUpload("INF_");
        string datasize = dt.Rows[0]["Size_KB"].ToString();

        if (HiddenFlag.Value == "Add")
        {
            if (FileUploader.HasFile)
            {
                if (FileUploader.PostedFile.ContentLength < Int32.Parse(dt.Rows[0]["Size_KB"].ToString()) * 1024)
                {
                    //FileName = System.Guid.NewGuid() + Path.GetExtension(strLocalPath);
                    FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy HH.mm.ss") + "_" + Path.GetFileName(strLocalPath);

                    int Retval = objBLL.INSERT_New_Vessel(null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, UDFLib.ConvertToInteger(ddlFleet_AddVessel.SelectedValue),
                                                          UDFLib.ConvertToInteger(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                                          UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                                          UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", FileName, UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue));

                    if (Retval != 0)
                    {
                        objBLL.INSERT_New_SURVEY_VesselDetails(Retval.ToString(), txtCallSign.Text, txtIMONo.Text, txtLength.Text, txtMMSI.Text, UDFLib.ConvertDateToNull(txtYearBuilt.Text));
                    }

                    FileUploader.PostedFile.SaveAs(Server.MapPath("~/Uploads/MEPowerCurve/" + FileName));
                    BindVesselGrid();
                }
                else
                {
                    lblMessage.Text = datasize + " KB File size exceeds maximum limit";
                }
            }
            else
            {
                FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy HH.mm.ss") + "_" + Path.GetFileName(strLocalPath);
                int Retval = objBLL.INSERT_New_Vessel(null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, UDFLib.ConvertToInteger(ddlFleet_AddVessel.SelectedValue),
                                                      UDFLib.ConvertToInteger(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                                      UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                                      UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", null, UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue));


                if (Retval != 0)
                {
                    objBLL.INSERT_New_SURVEY_VesselDetails(Retval.ToString(), txtCallSign.Text, txtIMONo.Text, txtLength.Text, txtMMSI.Text, UDFLib.ConvertDateToNull(txtYearBuilt.Text));
                }
            }
            BindVesselGrid();

            string hidemodal = String.Format("hideModal('dvAddNewVessel')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        else
        if (FileUploader.HasFile)
        {
            if (FileUploader.PostedFile.ContentLength < Int32.Parse(dt.Rows[0]["Size_KB"].ToString()) * 1024)
            {
                FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy HH.mm.ss") + "_" + Path.GetFileName(strLocalPath);

                int Retval = objBLL.UPDATE_Vessel(Convert.ToInt32(txtVesselID.Text), null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, Convert.ToInt32(ddlFleet_AddVessel.SelectedValue)
                                                  , Convert.ToInt32(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                                  UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                                  UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", FileName, UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue));
                FileUploader.PostedFile.SaveAs(Server.MapPath("~/Uploads/MEPowerCurve/" + FileName));

                objBLL.UPDATE_SURVEY_VesselDetails(txtVesselID.Text, txtCallSign.Text, txtIMONo.Text, txtLength.Text, txtMMSI.Text, UDFLib.ConvertDateToNull(txtYearBuilt.Text));
            }

            else
            {
                lblMessage.Text = datasize + " KB File size exceeds maximum limit";
            }
        }
        else
        {
            FileName = txtVesselShortName.Text + "_" + DateTime.Now.ToString("dd-MM-yyyy HH.mm.ss") + "_" + Path.GetFileName(strLocalPath);

            int Retval = objBLL.UPDATE_Vessel(Convert.ToInt32(txtVesselID.Text), null, txtVessel.Text, txtVesselShortName.Text, txtEmailID.Text, UDFLib.ConvertIntegerToNull(ddlFleet_AddVessel.SelectedValue)
                                              , UDFLib.ConvertIntegerToNull(ddlVesselManager.SelectedValue), UDFLib.ConvertDateToNull(dtTakeoverDate.Text),
                                              UDFLib.ConvertDateToNull(dtHandoverDate.Text), UDFLib.ConvertIntegerToNull(ddlVesselFlage_AddVessel.SelectedValue), Convert.ToInt32(Session["UserID"].ToString()),
                                              UDFLib.ConvertDecimalToNull(txtMinimumCTM.Text), chkSyncEnable.Checked == true ? "-1" : "0", null, UDFLib.ConvertIntegerToNull(ddlvessel_AddType.SelectedValue));
            //FileUploader.PostedFile.SaveAs(Server.MapPath("~/Uploads/MEPowerCurve/" + null));

            objBLL.UPDATE_SURVEY_VesselDetails(txtVesselID.Text, txtCallSign.Text, txtIMONo.Text, txtLength.Text, txtMMSI.Text, UDFLib.ConvertDateToNull(txtYearBuilt.Text));
        }
        BindVesselGrid();

        string js = "closeDiv('dvAddNewVessel');";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "close", js, true);
    }
Exemplo n.º 30
0
    protected void btnSaveUserDetails_Click(object sender, EventArgs e)
    {
        lblMessage.Text = "";
        UserProperties User = new UserProperties();

        try
        {
            if (txtDateOfBirth.Text != "")
            {
                DateTime DOB = DateTime.Parse(txtDateOfBirth.Text);
            }
        }
        catch (Exception) { lblMessage.Text = "Please enter valid Date Of Birth.";
                            return; }
        try
        {
            if (txtDateOfJoining.Text != "")
            {
                DateTime DOJ = DateTime.Parse(txtDateOfJoining.Text);
            }
        }
        catch (Exception) { lblMessage.Text = "Please enter valid Date Of Joining.";
                            return; }
        try
        {
            if (txtDateOfProbation.Text != "")
            {
                DateTime DOP = DateTime.Parse(txtDateOfProbation.Text);
            }
        }
        catch (Exception) { lblMessage.Text = "Please enter valid Date Of Probation.";
                            return; }

        try
        {
            objUserBLL.CreateUser(Convert.ToInt32(Session["USERID"]), txtFirstName.Text, "", txtLastName.Text, txtUserName.Text, DMS.DES_Encrypt_Decrypt.Encrypt(txtPassword.Text), null, txtEMail.Text
                                  , UDFLib.ConvertIntegerToNull(ddlDepartment.SelectedValue), UDFLib.ConvertIntegerToNull(ddlManager.SelectedValue), UDFLib.ConvertDecimalToNull(txtApprovalLimit.Text)
                                  , txtDesignation.Text, txtMobileNo.Text, UDFLib.ConvertDateToNull(txtDateOfBirth.Text), UDFLib.ConvertDateToNull(txtDateOfJoining.Text), UDFLib.ConvertDateToNull(txtDateOfProbation.Text)
                                  , UDFLib.ConvertStringToNull(txtPermanentAddress.Text), UDFLib.ConvertStringToNull(txtPresentAddress.Text), UDFLib.ConvertStringToNull(ddlUserType.SelectedValue)
                                  , UDFLib.ConvertIntegerToNull(ddlCompany.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFleet.SelectedValue), null, int.Parse(ddlNationality.SelectedValue));


            //lblMessage.Text = "User created successfully";
            lblMessage.Text            = "User account has been created successfully";
            hlnk1.Text                 = "Click here to login as " + txtUserName.Text.Trim();
            lblOr.Text                 = "Or";
            hlnk2.Text                 = "Go back to User List";
            btnSaveUserDetails.Enabled = false;
        }
        catch (Exception ex)
        {
            lblMessage.Text = ex.Message;
        }
    }