コード例 #1
0
 //public ActionResult Details(int id)
 //{
 //    return View();
 //}
 //
 // GET: /Fund/Create
 public ActionResult Create()
 {
     SystemEntities repository = new SystemEntities();
     Fund model = new Fund();
     PopulateViewBag();
     return View(model);
 }
コード例 #2
0
 public ActionResult Create(Fund fund)
 {
     if(ModelState.IsValid)
     {
         SystemEntities repository = new SystemEntities();
         repository.Funds.Add(fund);
         repository.SaveChanges();
         return RedirectToAction("Index", "Home");
     }
     PopulateViewBag();
     return View(fund);
 }