Esempio n. 1
0
 public ActionResult Show(int id) {
     ViewDocument viewDoc = new ViewDocument();
     using (club = new ClubEntities()) {
         viewDoc = club.ViewDocuments.Where(d => d.Id == id).FirstOrDefault();
     }
     return View("~/areas/bwum/views/down/show.cshtml", viewDoc);
 }
 public ActionResult Item(int id) {
     ViewDocument viewDoc = new ViewDocument();
     using (club = new ClubEntities()) {
         viewDoc = club.ViewDocuments.Where(v => v.Id == id).FirstOrDefault();
        var doc=club.Documents.Where(v => v.Id == id).FirstOrDefault();
         if(doc!=null){
             doc.Views += 1;
             club.SaveChanges();
             ViewBag.DownsTop = GetViewDocumentsOrderByDown(club);
         }
     }
     if (viewDoc == null)
         return RedirectToAction("notfound","error");
     return View("~/views/download/show.cshtml",viewDoc);
 }
Esempio n. 3
0
 public ActionResult SetCheck(int id) {
     ViewDocument viewDocument = new ViewDocument();
     Document document = new Document();
     using (club = new ClubEntities()) {
         document = club.Documents.Where(v => v.Id == id).FirstOrDefault();
         viewDocument = club.ViewDocuments.Where(v => v.Id == id).FirstOrDefault();
         if (document != null) {
             document.Status = (byte)(((int)viewDocument.Status == 0) ? 1 : 0);
             document.TagsId = App_Start.CommonMethod.SetTags(club, document.Tags);
             if (club.SaveChanges() >= 0) {
                 status = Status.success;
                 hitStr = "修改成功!";
                 viewDocument.Status = document.Status;
             }
         }
     }
     ViewBag.StatusStr = HtmlCommon.GetHitStr(hitStr,status);
     return View("~/areas/bwum/views/down/show.cshtml", viewDocument);
 }