Ejemplo n.º 1
0
        public ActionResult FineContracts(List<ContractFineViewModel> models)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                List<Contract> listContract = new List<Contract>();
                if (models != null)
                {
                    foreach (ContractFineViewModel model in models)
                    {
                        Contract c = new Contract();
                        c.Id = model.ContractId;
                        c.FineAmount = model.FineAmount;
                        listContract.Add(c);
                    }
                }

                //保存数据
                string strErrText;
                ContractSystem contract = new ContractSystem();
                if (contract.FineContracts(listContract, LoginAccountId, LoginStaffName, out strErrText))
                {
                    return Json(string.Empty);
                }
                else
                {
                    return Json(strErrText);
                }
            }
            return View(models);
        }