public ActionResult UserRegister(User user, string Isactive) { try { bool active; if (Isactive != null) { active = true; } else { active = false; } user.IsActive = active; user.Created = DateTime.Now; _loginRepo.Register(user); return(RedirectToAction("Index")); } catch (Exception) { throw; } }