public virtual async Task <ActionResult> Edit(string productName, int?id) { var viewModel = await this.GetThreadViewModel(productName, id); viewModel.Product.Categories = await this.ProductService.GetCategoriesFromProduct(viewModel.Product.Id.Value, this.ThreadType); this.ViewBag.Title = TitleHelper.GetProductTabTitle(id == null ? "New Idea" : "Editing Idea", viewModel.Product.DisplayName); return(this.View("EditThread", viewModel)); }
public async Task <ActionResult> Index(string productName) { var viewModel = await this.GetProductViewModel(productName); Debug.Assert(viewModel.Id != null, "viewModel.Id != null"); viewModel.Threads = await this.ThreadService.GetThreads(viewModel.Id.Value, this.ThreadType); this.ViewBag.Title = TitleHelper.GetProductTabTitle(viewModel.ActiveTab.ToString(), viewModel.DisplayName); return(this.View(viewModel)); }
public async Task <ActionResult> Index(string productName) { if (productName == null) { throw new ArgumentNullException(nameof(productName)); } var viewModel = await this._productService.GetProductViewModel(productName, ProductActiveTab.Home); this.ViewBag.Title = TitleHelper.GetProductTabTitle("Home", viewModel.DisplayName); return(this.View(viewModel)); }
private async Task <SettingsViewModel> GetSettingsViewModel(string productName) { var product = await this.productService.GetProductViewModel(productName, ProductActiveTab.Settings); product.Members = await this.productService.GetMembersInProduct(product.Id.Value); this.ViewBag.Title = TitleHelper.GetProductTabTitle("Settings", product.DisplayName); var viewModel = new SettingsViewModel() { Product = product }; return(viewModel); }