示例#1
0
 public ActionResult Create(MemberViewModel obj)
 {
     //if (obj.ID == null)
     //{
     //    obj = new MemberViewModel();
     //    return View(obj);
     //}
     //else
     {
         MemberSvc.Add(obj);
         return(RedirectToAction("Member"));
     }
 }
示例#2
0
 protected void Application_Start()
 {
     MyMVC.Models.MemberViewModel member = new MemberViewModel()
     {
         ID         = "1",
         Name       = "KK",
         PhoneNo    = "03-123456",
         Department = "S1"
     };
     MemberSvc.Add(member);
     MemberSvc.Add(member);
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }