Ejemplo n.º 1
0
 public JsonResult LoadDistance(string strReceiverName, string startCountry, string startProvince, string startCity)
 {
     string strErrText;
     DDSystem dd = new DDSystem();
     ReceiverDistance data = dd.LoadReceiverDistance(strReceiverName, startCountry, startProvince, startCity, LoginAccountId, LoginStaffName, out strErrText);
     if (data == null)
     {
         return Json(null, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(data.KM, JsonRequestBehavior.AllowGet);
     }
 }
Ejemplo n.º 2
0
        public ActionResult DispatchNoodlePlan(string id)
        {
            string strErrText;

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

            //读取发货计划起讫点的距离
            int nKM = 0;
            DDSystem dd = new DDSystem();
            ReceiverDistance distance = dd.LoadReceiverDistance(deliverPlan.ReceiverName, deliverPlan.StartCountry, deliverPlan.StartProvince, deliverPlan.StartCity, LoginAccountId, LoginStaffName, out strErrText);
            if (distance != null)
            {
                nKM = distance.KM;
            }

            //创建Model
            DispatchBillViewModel model = new DispatchBillViewModel();
            model.CreateTime = DateTime.Now.ToString("yyyy-MM-dd");

            model.DeliverPlans = new List<DispatchBillDeliverPlanViewModel>();
            DispatchBillDeliverPlanViewModel modelDeliverPlan = new DispatchBillDeliverPlanViewModel();
            modelDeliverPlan.PlanId = long.Parse(id);
            modelDeliverPlan.KM = nKM;
            model.DeliverPlans.Add(modelDeliverPlan);

            return View(model);
        }