public ActionResult DeleteConfirmed(long id) { try { if (Session[SessionVariables.Session_UserInfo] != null) { objNotify = _objBALUser.Delete(id); if (objNotify.RowEffected > 0) { ShowAlert(AlertType.Success, objNotify.NotifyMessage); } else { ShowAlert(AlertType.Error, objNotify.NotifyMessage); } return(RedirectToAction("Index")); } else { return(RedirectToAction("Login", "Home")); } } catch (Exception ex) { error.Breadcrum = "Home > Users > List > Delete"; 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)); } }