예제 #1
0
        public ActionResult Create(CompanyEditModel model)
        {
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "请正确输入信息!");
                return View(model);
            }

            CompanySvc.Insert(model.ToCompany());
            return RedirectToAction("Index");
        }
예제 #2
0
        public ActionResult Edit(int id)
        {
            var company = CompanySvc.LoadById(id);

            if (company == null)
            {
                return RedirectToAction("Index");
            }
            CompanyEditModel model = new CompanyEditModel(company);
            return View(model);
        }
예제 #3
0
 public ActionResult Create()
 {
     var model = new CompanyEditModel();
     return View(model);
 }