예제 #1
0
        // GET: App
        public ActionResult Index()
        {
            TBL_DOCUMENT[] appInfo = SelectTools.SelectDocumentInfo(u => u.documentKind == 0, u => u.documentId);
            if (appInfo == null || appInfo.Count() == 0)
            {
                Response.Write("<script>alert('无App二维码!');</script>");
                return(View());
            }
            if (Request.Cookies["userId"] != null)
            {
                string user = Request.Cookies["userId"].Value;//输出全部的值
                ViewBag.user = user;
            }
            string app = appInfo[0].documentUrl.ToString();

            ViewBag.app = app;

            HttpCookie cookie = Request.Cookies["userId"];

            if (cookie.Name != null)
            {
                ViewBag.user = cookie.Value;
            }

            return(View());
        }
        public FileResult DocumentDownload(TBL_DOCUMENT document)
        {
            TBL_DOCUMENT[] list     = SelectTools.SelectDocumentInfo(u => u.documentId == document.documentId, u => u.documentId);
            string         path     = list[0].documentUrl;
            string         filePath = Server.MapPath(path);         //路径

            return(File(filePath, "text/plain", "document.excel")); //welcome.txt是客户端保存的名字
        }
 // GET: Document
 public ActionResult Index()
 {
     TBL_DOCUMENT[] documentInfo = SelectTools.SelectDocumentInfo(u => u.documentKind == 1, u => u.documentId);
     if (documentInfo == null || documentInfo.Count() == 0)
     {
         Response.Write("<script>alert('无查询信息!');</script>");
     }
     if (Request.Cookies["userId"] != null)
     {
         string user = Request.Cookies["userId"].Value;//输出全部的值
         ViewBag.user = user;
     }
     ViewBag.documentInfo = documentInfo;
     return(View());
 }
예제 #4
0
        // GET: ProtectMessage
        public ActionResult Index()
        {
            TBL_DOCUMENT[] protectInfo = SelectTools.SelectDocumentInfo(u => u.documentKind == 2, u => u.documentId);
            if (protectInfo == null || protectInfo.Count() == 0)
            {
                Response.Write("<script>alert('无查询信息!');</script>");
            }
            ViewBag.protectInfo = protectInfo;

            HttpCookie cookie = Request.Cookies["userId"];

            if (cookie.Name != null)
            {
                ViewBag.user = cookie.Value;
            }

            return(View());
        }