Beispiel #1
0
        public ActionResult ImportWebBookmarkToDB(string importLogID)
        {
            BizResultInfo result = new BizResultInfo();

            if (string.IsNullOrEmpty(importLogID))
            {
                result.IsSuccess    = false;
                result.ErrorMessage = "先上传文件呀。";
                return(Json(result));
            }
            long uid = UILoginHelper.GetUIDFromHttpContext(HttpContext);

            var importLog = BizUserWebBookmarkImportLog.LoadImportLogID(importLogID.ConvertToPlainLong());

            if (importLog == null)
            {
                return(Json(new BizResultInfo()
                {
                    IsSuccess = false, SuccessMessage = "文件丢失,保存失败。"
                }));
            }

            var path = Server.MapPath(importLog.Path);

            result = ImportBookmarkHelper.ImportBookmarkDataToDB(path, uid);

            return(Json(new BizResultInfo()
            {
                IsSuccess = true, SuccessMessage = "保存成功耶,你可以到别的地方玩了。"
            }));
        }
Beispiel #2
0
        public ActionResult PreView(string importLogID)
        {
            var importLog = BizUserWebBookmarkImportLog.LoadImportLogID(importLogID.ConvertToPlainLong());

            if (importLog == null)
            {
                return(View());
            }
            var path    = Server.MapPath(importLog.Path);
            var allText = System.IO.File.ReadAllText(path);

            return(View(new BizResultInfo()
            {
                Target = allText
            }));
        }