예제 #1
0
        public ActionResult Create([Bind(Include = "user_id,user_name,pwd")] UserClass user)
        {
            ViewBag.isExist = "NO";
            if (modelClass.isExist(user))
            {
                //when isExist user_name
                ViewBag.isExist = "Same user name is exist already.";
            }

            else
            {
                if (ModelState.IsValid)
                {
                    modelClass.Add(user);
                    return(RedirectToAction("Index"));
                }
            }
            return(View(user));
        }