public ActionResult AddGroups(int id, FormCollection collection) { //try //{ // TODO: Add insert logic here UserGroup userGroup = new UserGroup(); userGroup.UserID = Convert.ToInt32(collection["UserID"]); userGroup.GroupID = Convert.ToInt32(collection["GroupID"]); int rs = UserGroupDAO.Add(userGroup); if (rs > 0) { return(RedirectToAction("Index")); } else { return(View()); } //} //catch //{ // return View(); //} }