public ActionResult DeleteGuide(Guid guideid, int p) { Guide guide = guideService.GetByID(guideid); guideService.Delete(guide); guideService.SaveChanges(); return(RedirectToAction("Guide", new { p = p })); }
public ActionResult Guide(Guid?Guideid) { ViewBag.Guide = guideService.Get().OrderBy(o => o.Orders); if (Guideid != null) { Guide GuideContents = guideService.GetByID(Guideid); //ViewBag.GuideContents = GuideContents.Guidelang.FirstOrDefault(a => a.Langid == 1); ViewBag.Title = GuideContents.Guidelang.FirstOrDefault(a => a.Langid == 1).Title; ViewBag.Contents = GuideContents.Guidelang.FirstOrDefault(a => a.Langid == 1).Contents; } else { IEnumerable <Guide> GuideContents = guideService.Get().OrderBy(o => o.Orders); ViewBag.Title = GuideContents.FirstOrDefault().Guidelang.FirstOrDefault(a => a.Langid == 1).Title; ViewBag.Contents = GuideContents.FirstOrDefault().Guidelang.FirstOrDefault(a => a.Langid == 1).Contents; } return(View()); }