Example #1
0
		public async Task<ActionResult> Ban(UsersBanViewModel input)
		{
			input.Reason = input.Reason ?? "No reason";

			await mUserService.BanUser(input.Id, input.BanDuration, input.Reason);

			var confirmationMessage = String.Format(Lang.Ban.ConfirmationMessage, input.UserName,
			                                        TimeSpanFormatter.Format(input.BanDuration));

			return RedirectToListWithMessage(input.ListQueryString, confirmationMessage);
		}
Example #2
0
		public async Task<ActionResult> Ban(string id, string listQueryString)
		{
			var user      = await mUserService.GetUserById(id);
			var viewModel = new UsersBanViewModel
			{
				Id              = user.Id,
				ListQueryString = listQueryString,
				UserName        = user.UserName,
				RealName        = user.FullName
			};

			return View(viewModel);
		}