Example #1
0
        public ActionResult BlockUser(long id, string status)
        {
            try
            {
                switch (status)
                {
                case "blocked":
                    dataHelper.ChangeUserStatus(id, 1);
                    break;

                case "unblocked":
                    dataHelper.ChangeUserStatus(id, 0);
                    break;

                default:
                    break;
                }
                return(RedirectToAction("Users"));
            }
            catch (Exception ex)
            {
                logger.ErrorMessage("305", ex);
                return(View("Error", new Error()
                {
                    ExDescription = ex.Message
                }));
            }
        }