Пример #1
0
        public ActionResult Update(int id, DatabaseUpdateModel model)
        {
            if (string.IsNullOrEmpty(model.UpdateRemark))
            {
                ViewBag.Message = "必须填写必要的备注信息!";
                return View(model);
            }

            var databaseinfo = _databaseRepository.GetDatabaseById(id);

            string introduction = string.Format("Name:【Old:{0},New:{1}】,ChineseName:【Old:{2},New:{3}】。",
                databaseinfo.Name,
                model.Name,
                databaseinfo.ChineseName,
                model.ChineseName
            );

            _databaseRepository.UpdateDatabase(id, model.Name, model.UpdateRemark, model.ChineseName);

            return Redirect("/Database/List");
        }
Пример #2
0
        public ActionResult Update(int id)
        {
            var databaseinfo = _databaseRepository.GetDatabaseById(id);

            DatabaseUpdateModel viewmodel = new DatabaseUpdateModel();
            viewmodel.ChineseName = databaseinfo.ChineseName;
            viewmodel.Name = databaseinfo.Name;

            return View(viewmodel);
        }