public async Task <ActionResult> More(int id) { Project model = await DbAdaptor.GetProjectAsync(id); if (model == null) { return(HttpNotFound()); } return(PartialView("_More", model)); }
public async Task <ActionResult> More(int id) { ViewBag.Portfolio = true; Project model = await DbAdaptor.GetProjectAsync(id); if (model == null) { return(HttpNotFound()); } return(PartialView("~/Views/Home/_More.cshtml", model)); // return RedirectToAction("More", "Home", new { id = id }); }
public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Project project = await DbAdaptor.GetProjectAsync(id); if (project == null) { return(HttpNotFound()); } return(View(project)); }
public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Project project = await DbAdaptor.GetProjectAsync(id); if (project == null) { return(HttpNotFound()); } ViewBag.Lang = new SelectList(new List <SelectListItem> { new SelectListItem { Text = "en", Value = "en" }, new SelectListItem { Text = "ru", Value = "ru" }, new SelectListItem { Text = "am", Value = "am" }, }, "Value", "Text"); var all = await DbAdaptor.GetTechnologiesAsync(); var selected = project.Technologies?.ToList(); if (selected != null) { var notSelected = all.Where(x => !selected.Contains(x)).ToList(); ViewBag.TechnologyID = notSelected.Count > 0 ? new MultiSelectList(notSelected, "TechnologyID", "Name") : null; } return(View(project)); }