jquery input加载后台换行数据

 public ActionResult Book()
        {

            int lPreBillID = CommHelper.GetInt(RouteData.Values["id"]);
            SvcPreBill oPre = new SvcPreBill();
            if (lPreBillID > 0)
            {
                oPre.LoadFormDB(lPreBillID);
                ViewData["IsValid"] = 1;
            }
            else
            {
                ViewData["IsValid"] = 0;
            }

            oPre.Mark = oPre.Mark.Replace("\n", "<br />");
            oPre.ShipperAddress = oPre.ShipperAddress.Replace("\n", "<br />");
            oPre.ConsigneeAddress = oPre.ConsigneeAddress.Replace("\n", "<br />");
            oPre.NotifityAddress = oPre.NotifityAddress.Replace("\n", "<br />");
            oPre.PickupAddress = oPre.PickupAddress.Replace("\n", "<br />");
            oPre.DeliveryAddress = oPre.DeliveryAddress.Replace("\n", "<br />");
            oPre.PreBillNote = oPre.PreBillNote.Replace("\n", "<br />");
            oPre.CargoName = oPre.CargoName.Replace("\n", "<br />");
            oPre.Consignee = oPre.Consignee.Replace("\n", "<br />");//精华所在
            oPre.Shipper = oPre.Shipper.Replace("\n", "<br />");
            oPre.Notifier = oPre.Notifier.Replace("\n", "<br />");
            ViewBag.Pre = oPre;



            int lOfferUsedID = oPre.OfferUsedID;

            if (lOfferUsedID <= 0)
                lOfferUsedID = CommHelper.GetInt(DeEnHelper.Base64Decode(CommHelper.GetString(Request["QuotID"])));

            if (lOfferUsedID > 0)
            {
                ViewData["OfferUsedID"] = lOfferUsedID;

                OfferUsed oUsed = new OfferUsed();
                oUsed.LoadFormDB(lOfferUsedID);
                ViewData["OfferCode"] = oUsed.UsedCode;
                ViewData["WT"] = oUsed.Weight.ToString("#,##0.##");
                ViewData["VOL"] = oUsed.Volumn.ToString("#,##0.##");
                ViewData["PALLET"] = oUsed.Pallet;
                ViewData["Agent"] = oUsed.AgentNo;
            }
            else
            {
                ViewData["WT"] = 0;
                ViewData["VOL"] = 0;
                ViewData["PALLET"] = 0;
                ViewData["OfferUsedID"] = -1;
                ViewData["OfferCode"] = "";
                ViewData["Agent"] = "";
            }

            CargoWeb.Models.MTEmployee user = new MTEmployee();
            if (Session["user"] != null)
                user = (CargoWeb.Models.MTEmployee)Session["user"];

            ViewBag.User = user;

            return View();
        }

 

 

 

 var txtarea = "";

        $("#prebillid").val("@ViewBag.Pre.PreBillID");
        $("#shipperName").val("@ViewBag.Pre.ShipperName");
        $("#shipperContact").val("@ViewBag.Pre.ShipperContact");
        $("#shipperUSSC").val("@ViewBag.Pre.ShipperUSSC");
        $("#shipperTel").val("@ViewBag.Pre.ShipperTel");
        $("#shipperFax").val("@ViewBag.Pre.ShipperFax");
        $("#shipperEmail").val("@ViewBag.Pre.ShipperEmail");

        txtarea = "@Html.Raw(ViewBag.Pre.ShipperAddress)"
        $("#shipperAddress").val(txtarea.replace(/<br \/>/g, "\r\n"));

        $("#consigneeName").val("@ViewBag.Pre.ConsigneeName");
    $("#consigneeContact").val("@ViewBag.Pre.ConsigneeContact");
        $("#consigneeUSSC").val("@ViewBag.Pre.ConsigneeUSSC");
        $("#consigneeTel").val("@ViewBag.Pre.ConsigneeTel");
        $("#consigneeFax").val("@ViewBag.Pre.ConsigneeFax");
        $("#consigneeEmail").val("@ViewBag.Pre.ConsigneeEmail");

        txtarea = "@Html.Raw(ViewBag.Pre.ConsigneeAddress)"
        $("#consigneeAddress").val(txtarea.replace(/<br \/>/g, "\r\n"));


        $("#notifityName").val("@ViewBag.Pre.NotifityName");
    $("#notifityContact").val("@ViewBag.Pre.NotifityContact");
        $("#notifityUSSC").val("@ViewBag.Pre.NotifityUSSC");
        $("#notifityTel").val("@ViewBag.Pre.NotifityTel");
        $("#notifityFax").val("@ViewBag.Pre.NotifityFax");
        $("#notifityEmail").val("@ViewBag.Pre.NotifityEmail");

        txtarea = "@Html.Raw(ViewBag.Pre.NotifityAddress)"
        $("#notifityAddress").val(txtarea.replace(/<br \/>/g, "\r\n"));

        txtarea = "@Html.Raw(ViewBag.Pre.PickupAddress)"
    $("#PickupAddress").val(txtarea.replace(/<br \/>/g, "\r\n"));

    txtarea = "@Html.Raw(ViewBag.Pre.DeliveryAddress)"
        $("#DeliveryAddress").val(txtarea.replace(/<br \/>/g, "\r\n"));



        $("#bookingCode").val("@ViewBag.Pre.PreBillCode");
        $("#customerCode").val("@ViewBag.Pre.CustomerCode");
        $("#blCode").val("@ViewBag.Pre.BLCode");
        $("#blType").combobox("setValue", "@ViewBag.Pre.HBLType");
        $("#drCode").val("@ViewBag.Pre.DRCode");
        $("#TOS1").combobox("setValue", "@ViewBag.Pre.TOS1Flag");
        $("#TOS2").combobox("setValue", "@ViewBag.Pre.TOS2Flag");

        if ("@ViewBag.Pre.TOS2Flag" == 2 || "@ViewBag.Pre.TOS1Flag" == 2)
            $("#TOS").show();

        $("#TOS3").combobox("setValue", "@ViewBag.Pre.TOS3Flag");



        $("#paymentType").combobox("setValue", "@ViewBag.Pre.PayModeType");
        $("#voyage").val("@ViewBag.Pre.Voyage");
        $("#shippingDate").datebox("setValue", "@ViewBag.Pre.ShippingDate.ToString("yyyy-MM-dd")");

        txtarea = "@Html.Raw(ViewBag.Pre.PreBillNote)"
        $("#remark").val(txtarea.replace(/<br \/>/g, "\r\n"));

        $("#groupCombobox").combobox("setValue", "@ViewBag.Pre.WholePartType");
        Showorhide();
    $("#containerType").combobox("setValue", "@ViewBag.Pre.ContainerType");
        $("#containerNum").val("@ViewBag.Pre.ContainerNum");
        $("#hsCode").val("@ViewBag.Pre.HSCode");
        txtarea = "@Html.Raw(ViewBag.Pre.CargoName)"
        $("#productName").val(txtarea.replace(/<br \/>/g, "\r\n"));

        txtarea = "@Html.Raw(ViewBag.Pre.Mark)"
    $("#mark").val(txtarea.replace(/<br \/>/g, "\r\n"));

    $("#quantity").val("@ViewBag.Pre.QuantityCount");
        $("#weight").val("@ViewBag.Pre.WeightCount");
        $("#volumn").val("@ViewBag.Pre.VolumnCount");
        $("#pallet").val("@ViewBag.Pre.PalletCount");

        $("#offerCode").val("@ViewData["OfferCode"]");
        intobool("@ViewBag.Pre.NofitityAsConsigneeFlag", "NotifityAsConsignee");
        intobool('@ViewBag.Pre.PickupFlag', "PickupFlag");
        intobool('@ViewBag.Pre.DeliveryFlag', "DeliveryFlag");
        intobool('@ViewBag.Pre.AgentCustomFlag', "AgentCustomFlag");
        intobool('@ViewBag.Pre.StockFlag', "StockFlag");

        intobool('@ViewBag.Pre.ShipperFlag', "shipper");
        intobool('@ViewBag.Pre.ConsigneeFlag', "consignee");
        intobool('@ViewBag.Pre.NotifityFlag', "notifity");
        txtarea = "@Html.Raw(ViewBag.Pre.Shipper)"
        $("#shipperw").text(txtarea.replace(/<br \/>/g, "\r\n"));
        txtarea = "@Html.Raw(ViewBag.Pre.Consignee)"//精华之处
        $("#consigneew").text(txtarea.replace(/<br \/>/g, "\r\n"));//上面的这俩一句
        txtarea = "@Html.Raw(ViewBag.Pre.Notifier)"
        $("#notifityw").text(txtarea.replace(/<br \/>/g, "\r\n"));
    }


    function intobool(intter, str) {
        if (intter == 1) {
            $("#" + str).attr("checked", true);
            $("#" + str).closest("div").addClass("checkbox_bg_check");
            str == "PickupFlag" ? $("#PickupAddress").attr("readonly", false) : null;
            str == "DeliveryFlag" ? $("#DeliveryAddress").attr("readonly", false) : null;


        } else {
            $("#" + str).attr("checked", false);
            $("#" + str).closest("div").removeClass("checkbox_bg_check");
        }


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值