예제 #1
0
        public ActionResult DeleteGuide(Guid guideid, int p)
        {
            Guide guide = guideService.GetByID(guideid);

            guideService.Delete(guide);
            guideService.SaveChanges();
            return(RedirectToAction("Guide", new { p = p }));
        }
예제 #2
0
 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());
 }