Example #1
0
        public ActionResult SubmitContract(string id)
        {
            string strErrText;

            //读取合同数据
            ContractSystem contract = new ContractSystem();
            Contract data = contract.LoadContract(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            //创建Model
            ContractViewModel model = new ContractViewModel();
            model.Id = data.Id;
            model.DispatchBillId = data.DispatchBillId;
            model.ContractNo = data.ContractNo;
            model.CarNo = data.CarNo;
            model.TrailerNo = data.TrailerNo;
            model.DriverName = data.DriverName;
            model.DriverLicenseNo = data.DriverLicenseNo;
            model.DriverMobileTel = data.DriverMobileTel;
            model.DriverHomeTel = data.DriverHomeTel;
            model.CarrierId = data.CarrierId;
            model.CarrierName = data.CarrierName;
            model.GoodsName = data.GoodsName;
            model.Packing = data.Packing;
            model.StartPlace = data.StartPlace;
            model.DestPlace = data.DestPlace;
            model.ShipmentTime = data.ShipmentTime.ToString("yyyy-MM-dd");
            model.ArrivalTime = data.ArrivalTime.ToString("yyyy-MM-dd");
            model.TotalPackages = data.TotalPackages;
            model.TotalTunnages = data.TotalTunnages;
            model.TotalPiles = data.TotalPiles;
            model.TotalTenThousands = data.TotalTenThousands;
            model.TotalTransportCharges = data.TotalTransportCharges;
            model.PrepayTransportCharges = data.PrepayTransportCharges;
            model.ResidualTransportCharges = data.ResidualTransportCharges;
            model.OriginalContractNo = data.OriginalContractNo;

            return View(model);
        }
Example #2
0
        public ActionResult PrintContract(string id)
        {
            string strErrText;

            //读取公司名称
            OrganizationSystem organ = new OrganizationSystem();
            List<Organization> listOrgan = organ.LoadOrganizations(LoginAccountId, LoginStaffName, out strErrText);
            if (listOrgan == null)
            {
                throw new Exception(strErrText);
            }
            Organization root = listOrgan.Find(delegate(Organization o) { return o.ParentId == 0; });
            ViewData["CompanyName"] = root.Name;

            //读取合同数据
            ContractSystem contract = new ContractSystem();
            Contract data = contract.LoadContract(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            //创建Model
            ContractViewModel model = new ContractViewModel();
            model.Id = data.Id;
            model.DispatchBillId = data.DispatchBillId;
            model.ContractNo = data.ContractNo;
            model.CarNo = data.CarNo;
            model.TrailerNo = data.TrailerNo;
            model.DriverName = data.DriverName;
            model.DriverLicenseNo = data.DriverLicenseNo;
            model.DriverMobileTel = data.DriverMobileTel;
            model.DriverHomeTel = data.DriverHomeTel;
            model.CarrierId = data.CarrierId;
            model.CarrierName = data.CarrierName;
            model.GoodsName = data.GoodsName;
            model.Packing = data.Packing;
            model.StartPlace = data.StartPlace;
            model.DestPlace = data.DestPlace;
            model.ShipmentTime = data.ShipmentTime.ToString("yyyy-MM-dd");
            model.ArrivalTime = data.ArrivalTime.ToString("yyyy-MM-dd");
            model.TotalPackages = data.TotalPackages;
            model.TotalTunnages = data.TotalTunnages;
            model.TotalPiles = data.TotalPiles;
            model.TotalTenThousands = data.TotalTenThousands;
            model.TotalTransportCharges = data.TotalTransportCharges;
            model.PrepayTransportCharges = data.PrepayTransportCharges;
            model.ResidualTransportCharges = data.ResidualTransportCharges;
            model.OriginalContractNo = data.OriginalContractNo;

            return View(model);
        }