Пример #1
0
        /// <summary>
        /// 获取Advice数据
        /// </summary>
        /// <returns></returns>
        public List <AdviceEntity> getAdviceList(Dictionary <string, string> keyValue, Pagination pagination, bool ispage = false)
        {
            if (!ispage)
            {
                if (pagination == null)
                {
                    pagination      = new Pagination();
                    pagination.page = 1;
                    pagination.rows = 2000;
                }
            }

            var data = service.getAdviceList(keyValue, pagination);

            foreach (var item in data)
            {
                item.audit = getAuditByid(item.adviceid).OrderBy(x => x.sort).ToList();
                var fileList = fileBll.GetFilesByRecIdNew(item.adviceid);
                //foreach (var items in fileList)
                //{
                //    items.FilePath = items.FilePath.Replace("~/", url);
                //}
                item.Photos = fileList.Where(x => x.Description == "照片").ToList();
                item.Files  = fileList.Where(x => x.Description == "文件").ToList();
            }

            return(data);
        }
Пример #2
0
        public JsonResult ImportEdit(string keyValue, bool ck, SevenSEntity model)
        {
            var success = true;
            var message = "修改成功";

            try
            {
                var user = OperatorProvider.Provider.Current();
                if (ck)
                {
                    FileInfoBLL fileInfoBLL = new FileInfoBLL();
                    var         fileList    = fileInfoBLL.GetFilesByRecIdNew(keyValue).OrderBy(x => x.CreateDate).ToList();
                    var         fileListold = fileInfoBLL.GetFilesByRecIdNew(model.ID);
                    for (int i = 0; i < fileList.Count; i++)
                    {
                        if (i > 0)
                        {
                            fileInfoBLL.DeleteFile(keyValue, fileList[i].FileName, fileList[i].FilePath);
                        }
                        else
                        {
                            fileList[i].RecId = model.ID;
                            fileInfoBLL.SaveFormEmergency(fileList[i].FileId, fileList[i]);
                        }
                    }
                    for (int i = 0; i < fileListold.Count; i++)
                    {
                        fileInfoBLL.DeleteFile(fileListold[i].RecId, fileListold[i].FileName, fileListold[i].FilePath);
                    }
                    model.CREATEUSERID   = user.UserId;
                    model.CREATEUSERNAME = user.UserName;
                    ebll.SaveForm(model.ID, model);
                }
                else
                {
                    var one = ebll.GetSevenSEntity(model.ID);
                    one.Name = model.Name;
                    ebll.SaveSevenSEntity(one);
                }
            }
            catch (Exception ex)
            {
                success = false;
                message = ex.Message;
            }

            return(Json(new AjaxResult {
                type = success ? ResultType.success : ResultType.error, message = HttpUtility.JavaScriptStringEncode(message)
            }));
        }
Пример #3
0
        public JsonResult DeleteItem(string id)
        {
            var success = true;
            var message = "删除成功";

            try
            {
                var         user        = OperatorProvider.Provider.Current();
                FileInfoBLL fileInfoBLL = new FileInfoBLL();
                var         fileList    = fileInfoBLL.GetFilesByRecIdNew(id);
                for (int i = 0; i < fileList.Count; i++)
                {
                    fileInfoBLL.DeleteFile(fileList[i].RecId, fileList[i].FileName, Server.MapPath(fileList[i].FilePath));
                }
                ebll.DeleteItem(id);
            }
            catch (Exception ex)
            {
                success = false;
                message = ex.Message;
            }

            return(Json(new AjaxResult {
                type = success ? ResultType.success : ResultType.error, message = HttpUtility.JavaScriptStringEncode(message)
            }));
        }
Пример #4
0
        public ActionResult UploadFileNew(string uptype, string id)
        {
            FileInfoBLL            fileBll = new FileInfoBLL();
            IList <FileInfoEntity> fl      = fileBll.GetFilesByRecIdNew(id).Where(x => x.Description == uptype).ToList();

            foreach (FileInfoEntity fe in fl)
            {
                string filepath = fileBll.Delete(fe.FileId);
                if (!string.IsNullOrEmpty(filepath) && System.IO.File.Exists(Server.MapPath("~" + filepath)))
                {
                    System.IO.File.Delete(Server.MapPath("~" + filepath));
                }
            }
            HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;

            //没有文件上传,直接返回
            if (files[0].ContentLength == 0 || string.IsNullOrEmpty(files[0].FileName))
            {
                return(HttpNotFound());
            }
            string FileEextension = Path.GetExtension(files[0].FileName);
            string type           = files[0].ContentType;

            if (uptype == "0" && !type.Contains("image"))  //图片
            {
                return(Success("1"));
            }

            if (uptype == "1" && !type.Contains("mp4"))
            {
                return(Success("1"));
            }
            string Id = OperatorProvider.Provider.Current().UserId;

            Id = Guid.NewGuid().ToString();
            string virtualPath  = string.Format("~/Content/AndroidMenufile/{0}{1}", Id, FileEextension);
            string fullFileName = Server.MapPath(virtualPath);
            //创建文件夹,保存文件
            string path = Path.GetDirectoryName(fullFileName);

            Directory.CreateDirectory(path);
            files[0].SaveAs(fullFileName);
            FileInfoEntity fi = new FileInfoEntity
            {
                FileId         = Id,
                FolderId       = id,
                RecId          = id,
                FileName       = System.IO.Path.GetFileName(files[0].FileName),
                FilePath       = virtualPath,
                FileType       = FileEextension.Substring(1, FileEextension.Length - 1),
                FileExtensions = FileEextension,
                FileSize       = files[0].ContentLength.ToString(),
                DeleteMark     = 0,
                Description    = uptype
            };

            fileBll.SaveForm(fi);
            return(Success("上传成功。", new { path = Url.Content(virtualPath), name = fi.FileName }));
        }
Пример #5
0
        public ActionResult GetFileListJson(string keyValue)
        {
            var         data = safetydaybll.GetEntity(keyValue);
            FileInfoBLL fi   = new FileInfoBLL();
            var         list = fi.GetFilesByRecIdNew(keyValue);

            return(ToJsonResult(new { formData = data, files = list }));
        }
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="keyvalue"></param>
        /// <returns></returns>
        public ActionResult getCPEntity(string keyvalue)
        {
            var cpBll   = new CustomParameterBLL();
            var fileBll = new FileInfoBLL();
            var data    = cpBll.getEntity(keyvalue);

            data.Files = fileBll.GetFilesByRecIdNew(keyvalue).ToList();
            return(Content(data.ToJson()));
        }
        public ActionResult GetFilesByRecId(string recId)
        {
            var data = fileInfoBLL.GetFilesByRecIdNew(recId).ToList();

            data.ForEach(p => {
                p.FilePath = Url.Content(p.FilePath);
            });
            return(ToJsonResult(data));
        }
Пример #8
0
        public ActionResult NewDetail(string keyValue)
        {
            var         model = noticeBLL.GetEntity(keyValue);
            FileInfoBLL fi    = new FileInfoBLL();
            var         list  = fi.GetFilesByRecIdNew(keyValue);

            ViewData["files"] = list;
            return(View(model));
        }
Пример #9
0
        public ActionResult UploadFileNew(string keyValue, int packType)
        {
            FileInfoBLL        fileBll = new FileInfoBLL();
            HttpFileCollection files   = System.Web.HttpContext.Current.Request.Files;

            //没有文件上传,直接返回
            if (files[0].ContentLength == 0 || string.IsNullOrEmpty(files[0].FileName))
            {
                return(HttpNotFound());
            }
            string FileEextension = Path.GetExtension(files[0].FileName);

            if (!FileEextension.Contains("apk"))
            {
                return(Success("1"));
            }
            string Id           = Guid.NewGuid().ToString();
            string virtualPath  = string.Format("~/Resource/Package/{0}/{1}{2}", packType, Id, FileEextension);
            string fullFileName = Server.MapPath(virtualPath);
            //创建文件夹,保存文件
            string path = Path.GetDirectoryName(fullFileName);

            Directory.CreateDirectory(path);
            files[0].SaveAs(fullFileName);
            //保存一个固定的路径
            string staticFileName = string.Empty;

            staticFileName = packType == 0 ? "bzapp.apk" : "bzzdapp.apk";
            string staticFilePath = Server.MapPath(string.Format("~/Resource/Package/{0}/{1}", packType, staticFileName));

            files[0].SaveAs(staticFilePath);

            FileInfoEntity fi = new FileInfoEntity
            {
                FileId         = Id,
                FolderId       = keyValue,
                RecId          = keyValue,
                FileName       = System.IO.Path.GetFileName(files[0].FileName),
                FilePath       = virtualPath,
                FileType       = FileEextension.Substring(1, FileEextension.Length - 1),
                FileExtensions = FileEextension,
                FileSize       = files[0].ContentLength.ToString(),
                DeleteMark     = 0,
                Description    = packType == 0 ? "安卓APP" : "安卓终端"
            };

            fileBll.SaveForm(fi);

            var filelist = fileBll.GetFilesByRecIdNew(keyValue);

            foreach (FileInfoEntity f in filelist)
            {
                f.FilePath = Url.Content(f.FilePath);
            }
            return(Success("上传成功。", new { path = virtualPath.TrimStart('~'), name = fi.FileName, files = filelist, newpath = Url.Content(virtualPath) }));
        }
Пример #10
0
        /// <summary>
        /// 获取qc数据
        /// </summary>
        /// <returns></returns>
        public List <QcActivityEntity> getQcList(Dictionary <string, string> keyValue, Pagination pagination, bool ispage = false)
        {
            if (!ispage)
            {
                if (pagination == null)
                {
                    pagination      = new Pagination();
                    pagination.page = 1;
                    pagination.rows = 2000;
                }
            }
            var data = service.getQcList(keyValue, pagination);

            foreach (var item in data)
            {
                var fileList = fileBll.GetFilesByRecIdNew(item.qcid);
                item.Files  = fileList.Where(x => x.Description == "文件").ToList();
                item.Photos = fileList.Where(x => x.Description == "照片").ToList();
            }
            return(data);
        }
Пример #11
0
        public ActionResult RemoveForm(string keyValue)
        {
            packagebll.RemoveForm(keyValue);
            FileInfoBLL fileBll  = new FileInfoBLL();
            var         filelist = fileBll.GetFilesByRecIdNew(keyValue);

            foreach (var item in filelist)
            {
                string delPath = fileBll.Delete(item.FileId);
                System.IO.File.Delete(Server.MapPath(delPath));
            }
            return(Success("删除成功。"));
        }
Пример #12
0
        /// <summary>
        ///获取记录数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <SevenSPictureEntity> getList(DateTime?planeStart, DateTime?planeEnd, string state, string evaluationState, string space, Pagination pagination, bool ispage, string deptId, bool isFile)
        {
            var pic = service.getList(planeStart, planeEnd, state, evaluationState, space, pagination, ispage, deptId, isFile);

            if (isFile)
            {
                foreach (var item in pic)
                {
                    var file = fileBll.GetFilesByRecIdNew(item.Id);
                    if (!string.IsNullOrEmpty(space) && space != "全部")
                    {
                        item.Files = file.Where(t => t.FileExtensions == space).ToList();
                    }
                    else
                    {
                        item.Files = file.ToList();
                    }
                }
            }
            return(pic);
            //if (isFile)
            //{
            //    foreach (var item in query)
            //    {
            //        var ex = LinqExtensions.True<FileInfoEntity>();
            //        ex = ex.And(t => t.RecId == item.Id);
            //        if (!string.IsNullOrEmpty(space) && space != "全部")
            //        {
            //            ex = ex.And(t => t.FileExtensions == space);
            //            item.Files = db.IQueryable(ex).ToList();
            //        }
            //        else
            //        {
            //            item.Files = db.IQueryable(ex).ToList();
            //        }

            //    }
            //}
        }
Пример #13
0
        public JsonResult SaveToolInventory(string id, ToolInventoryEntity model)
        {
            FileInfoBLL fibll = new FileInfoBLL();

            tibll.SaveForm(model.ID, model);
            var files = fibll.GetFilesByRecIdNew(model.ID).Where(x => x.Description.Contains("二维码"));

            if (files.Count() == 0)
            {
                fibll.SaveForm(this.BuildImage(model.ID));
            }
            return(Json(new { success = true, message = "操作成功" }));
        }
Пример #14
0
 /// <summary>
 /// 获取文件
 /// </summary>
 /// <param name="userid"></param>
 /// <returns></returns>
 public List <WorkInnovationEntity> getWorkInnovationFile(List <WorkInnovationEntity> data)
 {
     try
     {
         foreach (var item in data)
         {
             item.audit = getAuditByid(item.innovationid).OrderBy(x => x.sort).ToList();
             var fileList = fileBll.GetFilesByRecIdNew(item.innovationid);
             //foreach (var items in fileList)
             //{
             //    items.FilePath = items.FilePath.Replace("~/", url);
             //}
             item.proposedPhoto  = fileList.Where(x => x.Description == "ty").ToList();
             item.statusquoPhoto = fileList.Where(x => x.Description == "xz").ToList();
             item.proposedFile   = fileList.Where(x => x.Description == "fj").ToList();
         }
         return(data);
     }
     catch (Exception)
     {
         throw;
     }
 }
        /// <summary>
        /// 提交演练准备数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ActionResult drillReadyGo(string entity)
        {
            try
            {
                var emergencyReport = BSFramework.Util.Json.ToObject <EmergencyReportEntity>(entity);
                var user            = OperatorProvider.Provider.Current();
                //test

                var valueStr = string.Format("\"userid\":\"{0}\"", user.UserId);
                var DataStr  = string.Format("\"name\":\"{0}\",\"drillmode\":\"{1}\",\"drillmodename\":\"{2}\","
                                             + "\"drilltime\":\"{3}\",\"compere\":\"{4}\",\"comperename\":\"{5}\","
                                             + "\"drillplace\":\"{6}\",\"drillpeople\":\"{7}\",\"drillpeoplename\":\"{8}\","
                                             + "\"drillpeoplenum\":\"{9}\",\"drillplanid\":\"{10}\",\"drillplanname\":\"{11}\","
                                             + " \"warntime\":\"{12}\",\"status\":\"0\",\"keyvalue\":\"{13}\"",
                                             emergencyReport.emergencyreportname, emergencyReport.rehearsetypeid, emergencyReport.rehearsetype
                                             , emergencyReport.planstarttime, emergencyReport.chairpersonid, emergencyReport.chairperson
                                             , emergencyReport.emergencyplace, emergencyReport.PersonId, emergencyReport.Persons
                                             , emergencyReport.Persons.Split(',').Length, emergencyReport.EmergencyId, emergencyReport.emergencyname,
                                             emergencyReport.alerttype, emergencyReport.EmergencyReportId);
                DataStr  = "{" + DataStr + "}";
                valueStr = "{" + valueStr + ",\"data\":" + DataStr + "}";
                //dynamic dyresultS = webClientEmergency<BaseResultEmergency>("EmergencyPlatform/SaveDrillRecord",
                //             valueStr);
                NameValueCollection val = new NameValueCollection();
                val.Add("json", valueStr);
                var         ApiIp       = Config.GetValue("ErchtmsApiUrl");
                var         strRsult    = string.Empty;
                FileInfoBLL fileInfoBLL = new FileInfoBLL();
                var         fileListold = fileInfoBLL.GetFilesByRecIdNew(emergencyReport.EmergencyReportId);
                if (fileListold.Count > 0)
                {
                    strRsult = Util.HttpRequestHelper.HttpUploadFile(ApiIp + "EmergencyPlatform/SaveDrillRecord", Server.MapPath(fileListold[0].FilePath), val);
                    dynamic dyresultS = JsonConvert.DeserializeObject <ExpandoObject>(strRsult);
                    if (dyresultS.Code != 0)
                    {
                        return(Success(dyresultS.Info));
                    }
                }
                else
                {
                    return(Success("需要上传文件"));
                }
                return(Success("成功"));
            }
            catch (Exception e)
            {
                return(Success("失败", new { info = e.Message }));
            }
        }
Пример #16
0
        /// <summary>
        /// 详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Detail(string id)
        {
            ViewData["Path"] = new List <string>();
            SevenSEntity model       = ebll.GetSevenSEntity(id);
            FileInfoBLL  fileInfoBLL = new FileInfoBLL();

            var fileList = fileInfoBLL.GetFilesByRecIdNew(id);
            var path     = Url.Content("~").Substring(0, @Url.Content("~").Length - 1);
            var filePath = path + fileList[0].FilePath.Substring(1, fileList[0].FilePath.Length - 1);

            ViewBag.path = filePath;
            model.seenum = model.seenum > 0 ? model.seenum + 1 : 1;
            ebll.SaveSevenSEntity(model);
            return(View(model));
        }
Пример #17
0
        /// <summary>
        /// 展示图片详情
        /// </summary>
        /// <returns></returns>
        public ActionResult DetailPicture(string keyValue)
        {
            var Files  = file.GetFilesByRecIdNew(keyValue).OrderBy(x => x.SortCode).ToList();
            var entity = ebll.getEntity(keyValue);

            ViewBag.evaluation = entity.evaluation;
            ViewBag.DeptName   = entity.deptname;
            ViewBag.keyValue   = keyValue;
            ViewBag.user       = entity.evaluationUser;
            if (string.IsNullOrEmpty(entity.evaluationDate))
            {
                ViewBag.evaluationtime = "";
            }
            else
            {
                ViewBag.evaluationtime = DateTime.Parse(entity.evaluationDate).ToString("yyyy-MM-dd");
            }

            return(View(Files));
        }
Пример #18
0
        public ActionResult delEntity(string keyValue)
        {
            FileInfoBLL fileBll = new FileInfoBLL();

            try
            {
                string getDel = string.Empty;
                #region  除数据
                if (!string.IsNullOrEmpty(keyValue))
                {
                    var fileList = fileBll.GetFilesByRecIdNew(keyValue).ToList();
                    getDel = string.Join(",", fileList.Select(x => x.FileId));
                }
                #endregion
                #region 修改删除图片
                var    DelKeys = getDel.Split(',');
                string keys    = string.Empty;
                for (int i = 0; i < DelKeys.Length; i++)
                {
                    if (string.IsNullOrEmpty(DelKeys[i]))
                    {
                        continue;
                    }
                    FileInfoEntity fileList = fileBll.GetEntity(DelKeys[i]);
                    string         url      = Server.MapPath(fileList.FilePath);
                    if (!string.IsNullOrEmpty(fileList.FilePath) && System.IO.File.Exists(url))
                    {
                        System.IO.File.Delete(url);
                    }
                    fileBll.Delete(DelKeys[i]);
                }
                #endregion
                qcbll.delEntity(keyValue);

                return(Success("操作成功。"));
            }
            catch (Exception ex)
            {
                return(Error(ex.Message));
            }
        }
Пример #19
0
        public ActionResult Detail(string id)
        {
            ViewBag.path = "";
            ViewBag.url  = "";
            FileInfoBLL fileBll = new FileInfoBLL();
            var         model   = workmeetingbll.GetJobTemplate(id);

            model.Dangers = workmeetingbll.getdangertemplate(model.JobId);
            foreach (DangerTemplateEntity d in model.Dangers)
            {
                model.d += d.Dangerous + "\r\n";
                model.m += d.Measure + "\r\n";
            }
            FileInfoEntity fe = fileBll.GetFilesByRecIdNew(model.JobId).FirstOrDefault();

            if (fe != null)
            {
                ViewBag.path = fe.FileId;
                ViewBag.url  = Url.Content(fe.FilePath);
            }
            return(View(model));
        }
Пример #20
0
        public JsonResult ImportContext(string keyValue, SevenSEntity model)
        {
            var success = true;
            var message = "新增成功";

            try
            {
                var         user        = OperatorProvider.Provider.Current();
                FileInfoBLL fileInfoBLL = new FileInfoBLL();
                var         fileList    = fileInfoBLL.GetFilesByRecIdNew(keyValue);
                for (int i = 0; i < fileList.Count; i++)
                {
                    SevenSEntity one = new SevenSEntity();
                    one.ID             = Guid.NewGuid().ToString();
                    one.BZId           = user.DeptId;
                    one.BZName         = user.DeptName;
                    one.CREATEUSERID   = user.UserId;
                    one.CREATEUSERNAME = user.UserName;
                    one.seenum         = 0;
                    one.CreateDate     = model.CreateDate;
                    one.TypeId         = model.TypeId;
                    one.Name           = fileList[i].FileName.Split('.')[0];
                    one.Path           = fileList[i].FileName;
                    fileList[i].RecId  = one.ID;
                    ebll.SaveForm("", one);
                    fileInfoBLL.SaveFormEmergency(fileList[i].FileId, fileList[i]);
                }
            }
            catch (Exception ex)
            {
                success = false;
                message = ex.Message;
            }

            return(Json(new AjaxResult {
                type = success ? ResultType.success : ResultType.error, message = HttpUtility.JavaScriptStringEncode(message)
            }));
        }
Пример #21
0
        private void BuildQRCode(string keyValue)
        {
            PackageEntity packageEntity = packagebll.GetEntity(keyValue);
            FileInfoBLL   fileBll       = new FileInfoBLL();
            var           filelist      = fileBll.GetFilesByRecIdNew(keyValue);

            if (packageEntity == null)
            {
                throw new ArgumentException("无APP应用程序信息");
            }
            if (filelist == null || filelist.Count == 0)
            {
                throw new ArgumentException("无APP应用程序文件");
            }

            string staticFileName = string.Empty;

            staticFileName = packageEntity.PackType == 0 ? "bzapp.apk" : "bzzdapp.apk";

            string url = string.Format("http://{0}{1}/{2}", HttpContext.Request.Url.Host, HttpContext.Request.ApplicationPath, string.Format("/Resource/Package/{0}/{1}", packageEntity.PackType, staticFileName));
            //判断当前二维码路径存不存在
            string filePath = Server.MapPath(string.Format("~/Resource/Package/{0}", packageEntity.PackType));

            if (!Directory.Exists(filePath))
            {
                Directory.CreateDirectory(filePath);
            }

            QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();

            qrCodeEncoder.QRCodeVersion         = 10;
            qrCodeEncoder.QRCodeScale           = 2;
            qrCodeEncoder.QRCodeForegroundColor = Color.Black;
            Bitmap bmp = qrCodeEncoder.Encode(url, Encoding.UTF8);//指定utf-8编码, 支持中文

            bmp.Save(Path.Combine(filePath, "Download.jpg"));
            bmp.Dispose();
        }
Пример #22
0
        public JsonResult GetData(int page, int rows, DateTime?start, DateTime?end, string key, string category)
        {
            var user    = OperatorProvider.Provider.Current();
            var bll     = new ReportBLL();
            var filebll = new FileInfoBLL();
            var total   = 0;
            var data    = bll.GetReports("全部", category, null, start, end, key, rows, page, out total, user.UserId, null);

            //var data = bll.GetReports(null, category, null, start, end, key, rows, page, out total, null, null);
            foreach (var item in data)
            {
                if (item.EndTime.HasValue)
                {
                    item.EndTime = item.EndTime.Value.AddDays(-1);
                }
                var fileinfo = filebll.GetFilesByRecIdNew(item.ReportId.ToString());
                if (fileinfo != null && fileinfo.Count > 0)
                {
                    item.FilePath = Url.Content(fileinfo[0].FilePath);
                }
            }

            return(Json(new { rows = data, total = Math.Ceiling((double)total / rows), records = total }));
        }
        public JsonResult ImportEditPush(string keyvalue)
        {
            var success = true;
            var message = string.Empty;

            try
            {
                FileInfoBLL fileInfoBLL = new FileInfoBLL();
                string      newFilePath = "";
                if (this.Request.Files.Count == 0)
                {
                    throw new Exception("请上传文件");
                }
                var    file     = this.Request.Files[0];
                string fileName = System.IO.Path.GetFileName(file.FileName);
                //if (!fileName.Contains(".pdf"))
                //{
                //    throw new Exception("请检查文件格式!");
                //}
                var fileListold = fileInfoBLL.GetFilesByRecIdNew(keyvalue);
                for (int i = 0; i < fileListold.Count; i++)
                {
                    fileInfoBLL.DeleteFile(fileListold[i].RecId, fileListold[i].FileName, fileListold[i].FilePath);
                }
                string fileGuid       = Guid.NewGuid().ToString();
                long   filesize       = file.ContentLength;
                string FileEextension = Path.GetExtension(fileName);
                string uploadDate     = DateTime.Now.ToString("yyyyMMdd");
                string dir            = string.Format("~/Resource/{0}/{1}", "Emergency", uploadDate);
                string newFileName    = fileGuid + FileEextension;
                newFilePath = dir + "/" + newFileName;
                if (!Directory.Exists(Server.MapPath(dir)))
                {
                    Directory.CreateDirectory(Server.MapPath(dir));
                }

                FileInfoEntity fileInfoEntity = new FileInfoEntity();
                if (!System.IO.File.Exists(Server.MapPath(newFilePath)))
                {
                    //保存文件
                    file.SaveAs(Server.MapPath(newFilePath));
                    //文件信息写入数据库
                    fileInfoEntity.Create();
                    fileInfoEntity.FolderId       = "Emergency";
                    fileInfoEntity.FileId         = fileGuid;
                    fileInfoEntity.RecId          = keyvalue;
                    fileInfoEntity.FileName       = fileName;
                    fileInfoEntity.FilePath       = dir + "/" + newFileName;
                    fileInfoEntity.FileSize       = (Math.Round(decimal.Parse(filesize.ToString()) / decimal.Parse("1024"), 2)).ToString();//文件大小(kb)
                    fileInfoEntity.FileExtensions = FileEextension;
                    fileInfoEntity.FileType       = FileEextension.TrimStart('.');
                    fileInfoBLL.SaveForm("", fileInfoEntity);
                }
                message = fileInfoEntity.FileName;
            }
            catch (Exception ex)
            {
                success = false;
                message = HttpUtility.JavaScriptStringEncode(ex.Message);
            }
            return(Json(new { success, message }));
        }