public ActionResult ApproveContract(ContractViewModel model) { //创建数据 List<ContractDeliverPlan> listPlan = new List<ContractDeliverPlan>(); if (model.DeliverPlans != null) { foreach (ContractDeliverPlanViewModel m in model.DeliverPlans) { ContractDeliverPlan p = new ContractDeliverPlan(); p.Id = m.Id; p.ContractId = m.ContractId; p.PlanId = m.PlanId; p.Packages = m.Packages; p.Tunnages = m.Tunnages; p.Piles = m.Piles; p.TenThousands = m.TenThousands; p.TransportChargeExpression = m.TransportChargeExpression; p.TransportPriceExpression = m.TransportPriceExpression; p.KM = m.KM; p.TransportPrice = m.TransportPrice; p.TransportCharges = m.TransportCharges; p.ApprovedTransportPrice = m.ApprovedTransportPrice; p.ApprovedTransportCharges = m.ApprovedTransportCharges; listPlan.Add(p); } } //保存数据 string strMessage; ContractSystem contract = new ContractSystem(); bool bSuccess = contract.ApproveContract(model.Id, listPlan, LoginAccountId, LoginStaffName, out strMessage); var ret = new { Success = bSuccess, Message = strMessage }; return Json(ret); }