protected override EditViewModel InterceptViewModel(EditViewModel viewModel, Models.SearchQuery dto) { viewModel.As <Models.SearchQuery>().Attributes(x => x.CategorySelection).Add(new ReadonlyAttribute()); if (dto.NotificationMode != DAL.Entities.NotificationMode.OnlyBelowDesired) { viewModel.As <Models.SearchQuery>().Attributes(m => m.DesiredPrice).Add(new HiddenAttribute()); } return(base.InterceptViewModel(viewModel, dto)); }
protected override EditViewModel InterceptViewModel(EditViewModel viewModel, Models.Feedback dto) { if (!Context.CurrentUserInfo.BusinessRoles.Contains(BusinessRoles.AdminRole)) { viewModel.As <Models.Feedback>().Attributes(x => x.Status).Add(new ReadonlyAttribute()); } if (dto.Status != DAL.Entities.FeedbackStatus.New || !dto.BelongsToCurrentUser) { viewModel.As <Models.Feedback>().Attributes(x => x.Name).Add(new ReadonlyAttribute()); viewModel.As <Models.Feedback>().Attributes(x => x.Description).Add(new ReadonlyAttribute()); } return(base.InterceptViewModel(viewModel, dto)); }
protected override EditViewModel InterceptViewModel(EditViewModel viewModel, Models.SearchResult dto) { if (!dto.Sold) { viewModel.As <Models.SearchResult>().Hide(p => p.FinalPrice); } if (dto.Sold) { viewModel.As <Models.SearchResult>().Hide(p => p.PurchasePrice); viewModel.As <Models.SearchResult>().Hide(p => p.BidPrice); viewModel.As <Models.SearchResult>().Hide(p => p.Ends); } return(base.InterceptViewModel(viewModel, dto)); }
protected override EditViewModel InterceptViewModel(EditViewModel viewModel, Models.Settings dto) { if (!dto.EnableEmailNotification) { viewModel.As <Models.Settings>().Hide(x => x.Email); viewModel.As <Models.Settings>().Hide(x => x.AlternativeEmail); } if (!dto.EnableIftttNotification) { viewModel.As <Models.Settings>().Hide(x => x.IftttMakerKey); viewModel.As <Models.Settings>().Hide(x => x.IftttMakerEventName); } return(base.InterceptViewModel(viewModel, dto)); }
protected override EditViewModel InterceptViewModel(EditViewModel viewModel) { viewModel.As <Models.Category>().Attributes(m => m.Number).Add(new ReadonlyAttribute()); return(base.InterceptViewModel(viewModel)); }
protected override EditViewModel InterceptViewModel(EditViewModel viewModel) { viewModel.As <Models.Feedback>().Hide(x => x.Status); return(base.InterceptViewModel(viewModel)); }