コード例 #1
0
 public ActionResult Index(Account collection)
 {
     try
     {
         if (ModelState.IsValid)
         {
             collection.RoleID       = 1;
             collection.AccountRate  = 0;
             collection.AccountPoint = 0;
             int id = ad.InsertAccount(collection);
             if (id > 0)
             {
                 return(RedirectToAction("RegisterSuccess", "Register"));
             }
             else
             {
                 ModelState.AddModelError("", "Register failed!");
             }
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }