コード例 #1
0
		public ActionResult UpdateStatus(AppraiserUpdateStatusViewModel model, string btnName)
		{
			if (btnName == Constants.Buttons.Save)
			{
				var accessResult = _appraiserAccessManager.AllowEditStatus(model.UserId);

				if (accessResult.AllowEditStatus)
				{
					_appraisersPipelineService.UpdateAppraiserStatusFromModel(model);
				}
				CommitProviderInstance.Commit();

				var response = Json(new { userId = model.UserId, status = model.Status.ToString() });
				return response;
			}
			return Constants.Json.Default;
		}
コード例 #2
0
		public void UpdateAppraiserStatusFromModel(AppraiserUpdateStatusViewModel model)
		{
			var appraiser = _appraiserManagement.GetById(model.UserId);
			appraiser.Status = model.Status;
			_appraiserManagement.Update(appraiser);
		}
コード例 #3
0
		public PartialViewResult ShowPopup(int? id)
		{
			Response.CacheControl = "no-cache";
			var user = _appraisersPipelineService.GetAppraiserById(id.Value);
			var viewModel = new AppraiserUpdateStatusViewModel { UserId = id.Value, Status = user.Status };
			var accessResult = _appraiserAccessManager.AllowEditStatus(id.HasValue ? id.Value : default(int));

			viewModel.AllowEditStatus = accessResult.AllowEditStatus;
			viewModel.Message = accessResult.Message;
			return PartialView("Controls/UpdateStatus", viewModel);
		}