// GET: /User/Create public ActionResult Create() { try { if (Session[SessionVariables.Session_UserInfo] != null) { _objUserEntity.CODE = _objBALUser.GetMaxCode(); BranchList(); return(View(_objUserEntity)); } else { return(RedirectToAction("Login", "Home")); } } catch (Exception ex) { error.Breadcrum = "Home > Users > List > Create"; if (ex is BALException) { error.ErrorMsg = ex.Message.ToString() + "from " + ex.TargetSite.DeclaringType.Name + " method in " + ex.TargetSite.Name + " layer"; } else { ExceptionLogger.WriteExceptionInDB(ex, ExceptionLevel.UI, ExceptionType.Error); error.ErrorMsg = ex.Message.ToString() + "from " + ex.TargetSite.DeclaringType.Name + " method in " + ex.TargetSite.Name + " layer"; } return(RedirectToAction("ShowErrorPage", "Master", error)); } }