Exemplo n.º 1
0
        public ActionResult ModifyDeliverBill(string id)
        {
            string strErrText;

            //读取送货单数据
            DeliverSystem deliver = new DeliverSystem();
            DeliverBill deliverBill = deliver.LoadDeliverBill(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (deliverBill == null)
            {
                throw new Exception(strErrText);
            }

            //读取发货计划数据
            PlanSystem plan = new PlanSystem();
            DeliverPlan deliverPlan = plan.LoadDeliverPlan(deliverBill.PlanId, LoginAccountId, LoginStaffName, out strErrText);
            if (deliverPlan == null)
            {
                throw new Exception(strErrText);
            }

            //读取调度数据
            DispatchSystem dispatch = new DispatchSystem();
            DispatchBill dispatchBill = dispatch.LoadDispatchBill(deliverBill.DispatchBillId, LoginAccountId, LoginStaffName, out strErrText);
            if (dispatchBill == null)
            {
                throw new Exception(strErrText);
            }

            DispatchBillDeliverPlan dispatchBillDeliverPlan = dispatch.LoadDispatchBillDeliverPlan(deliverBill.DispatchBillId, deliverBill.PlanId, LoginAccountId, LoginStaffName, out strErrText);
            if (dispatchBillDeliverPlan == null)
            {
                throw new Exception(strErrText);
            }

            //读取协议价格
            DDSystem dd = new DDSystem();
            CarrierTransportPrice price = dd.LoadCarrierTransportPrice(dispatchBill.CarrierId, deliverPlan.StartCountry, deliverPlan.StartProvince, deliverPlan.StartCity, deliverPlan.ReceiverCountry, deliverPlan.ReceiverProvince, deliverPlan.ReceiverCity, deliverPlan.PlanType, deliverPlan.CreateTime, LoginAccountId, LoginStaffName, out strErrText);
            if (price == null)
            {
                throw new Exception(string.Format(InnoSoft.LS.Resources.Strings.LoadCarrierTransportPriceFaild, dispatchBill.CarrierName, deliverPlan.StartProvince + deliverPlan.StartCity, deliverPlan.ReceiverProvince + deliverPlan.ReceiverCity, deliverPlan.PlanType));
            }

            //生成Model
            DeliverBillViewModel model = new DeliverBillViewModel();
            model.TransportChargeExpression = dispatchBillDeliverPlan.TransportChargeExpression;
            model.TransportPriceExpression = dispatchBillDeliverPlan.TransportPriceExpression;
            model.AgreementTransportPrice = price.TransportPrice;
            model.ActualTransportPrice = dispatchBillDeliverPlan.TransportPrice;
            model.TransportCharges = dispatchBillDeliverPlan.TransportCharges;

            //缓存送货单编码和发货计划编码
            ViewData["DeliverBillId"] = id;
            ViewData["CustomerId"] = deliverBill.CustomerId;
            ViewData["PlanId"] = deliverBill.PlanId;
            ViewData["ConsignedDeliveryNo"] = deliverPlan.ConsignedDeliveryNo;

            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult ModifyShipmentBill(string id)
        {
            string strErrText;

            //读取出仓单数据
            DeliverSystem deliver = new DeliverSystem();
            ShipmentBill shipmentBill = deliver.LoadShipmentBill(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (shipmentBill == null)
            {
                throw new Exception(strErrText);
            }

            //读取发货计划数据
            PlanSystem plan = new PlanSystem();
            DeliverPlan deliverPlan = plan.LoadDeliverPlan(shipmentBill.PlanId, LoginAccountId, LoginStaffName, out strErrText);
            if (deliverPlan == null)
            {
                throw new Exception(strErrText);
            }

            //生成Model
            ShipmentBillViewModel model = new ShipmentBillViewModel();
            if (shipmentBill.OutType == InnoSoft.LS.Resources.Options.DeliverGoods)
            {
                //读取调度数据
                DispatchSystem dispatch = new DispatchSystem();
                DispatchBill dispatchBill = dispatch.LoadDispatchBill(shipmentBill.DispatchBillId, LoginAccountId, LoginStaffName, out strErrText);
                if (dispatchBill == null)
                {
                    throw new Exception(strErrText);
                }

                DispatchBillDeliverPlan dispatchBillDeliverPlan = dispatch.LoadDispatchBillDeliverPlan(shipmentBill.DispatchBillId, shipmentBill.PlanId, LoginAccountId, LoginStaffName, out strErrText);
                if (dispatchBillDeliverPlan == null)
                {
                    throw new Exception(strErrText);
                }

                //读取协议价格
                decimal decAgreementTransportPrice = 0;
                DDSystem dd = new DDSystem();
                CarrierTransportPrice price = dd.LoadCarrierTransportPrice(dispatchBill.CarrierId, deliverPlan.StartCountry, deliverPlan.StartProvince, deliverPlan.StartCity, deliverPlan.ReceiverCountry, deliverPlan.ReceiverProvince, deliverPlan.ReceiverCity, deliverPlan.PlanType, deliverPlan.CreateTime, LoginAccountId, LoginStaffName, out strErrText);
                if (price != null)
                {
                    decAgreementTransportPrice = price.TransportPrice;
                }

                model.TransportChargeExpression = dispatchBillDeliverPlan.TransportChargeExpression;
                model.TransportPriceExpression = dispatchBillDeliverPlan.TransportPriceExpression;
                model.AgreementTransportPrice = decAgreementTransportPrice;
                model.ActualTransportPrice = dispatchBillDeliverPlan.TransportPrice;
                model.TransportCharges = dispatchBillDeliverPlan.TransportCharges;
            }

            //缓存出仓单编码和发货计划编码
            ViewData["ShipmentBillId"] = id;
            ViewData["CustomerId"] = shipmentBill.CustomerId;
            ViewData["PlanId"] = shipmentBill.PlanId;
            ViewData["ConsignedDeliveryNo"] = deliverPlan.ConsignedDeliveryNo;

            return View(model);
        }
Exemplo n.º 3
0
        public JsonResult LoadDispatchBillDeliverPlan(string dispatchBillId, string planId)
        {
            string strErrText;
            DispatchSystem dispatch = new DispatchSystem();
            DispatchBillDeliverPlan data = dispatch.LoadDispatchBillDeliverPlan(long.Parse(dispatchBillId), long.Parse(planId), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            else
            {
                var ret = new
                {
                    TransportChargeExpression = data.TransportChargeExpression,
                    TransportPriceExpression = data.TransportPriceExpression,
                    KM = data.KM,
                    TransportPrice = data.TransportPrice,
                    TransportCharges = data.TransportCharges,
                    Remark = data.Remark
                };

                return Json(ret, JsonRequestBehavior.AllowGet);
            }
        }