示例#1
0
        private void UpdateFile(string singleProjectID, string fileListID, string newFileName, string oldFileName)
        {
            T_EFile_MDL model = new T_EFile_MDL();

            model.PageCounts = 0;// PDFcount;
            model.FileListID = Common.ConvertEx.ToInt(fileListID);

            model.FileType   = 1;
            model.OrderIndex = GetEfileMaxOrderIndex(fileListID);

            model.Title    = oldFileName.Substring(0, oldFileName.LastIndexOf('.'));
            model.RootPath = Common.Common.EFileStartPath;//记信根目录即可
            model.FilePath = newFileName;

            model.FileType     = 0;
            model.Status_Text  = "上传成功,当晚批量计算页数!";
            model.CREATE_DT    = System.DateTime.Now.ToShortDateString();
            model.CONVERT_FLAG = false;

            T_EFile_BLL bll = new T_EFile_BLL();
            int         archiveListCellRptID = bll.Add(model);

            //更新文件级转换标志,等批量转换晚上转
            T_FileList_MDL fileListMDL = fileListBLL.GetModel(model.FileListID);

            fileListMDL.CONVERT_FLAG = false;
            fileListMDL.RootPath     = Common.Common.EFileStartPath;
            fileListMDL.Version      = PublicModel.getFileVersion(fileListMDL.SingleProjectID.ToString());
            fileListBLL.Update(fileListMDL);

            BLL.T_Other_BLL otherBLL = new DigiPower.Onlinecol.Standard.BLL.T_Other_BLL();
            otherBLL.UpdateArchiveStatus(model.FileListID.ToString(), 10, "0");

            PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_EFile;key=", archiveListCellRptID,
                                                                                        ";SingleProjectID=", singleProjectID, ";FileListID=", model.FileListID, ";Title=", model.Title));
        }
示例#2
0
 public void ResetStatus(string FileListID)
 {
     BLL.T_Other_BLL otherBLL = new DigiPower.Onlinecol.Standard.BLL.T_Other_BLL();
     otherBLL.UpdateArchiveStatus(FileListID, -1, "0");//-1表示退回上一次状态
 }
示例#3
0
        private void InSertFile(string pid, string bh, string singleProjectId, string fileName, string filePath) {
            int OrderIndex = 1;
            string MaxBH = filelistBLL.GetMaxBH("SingleProjectID=" + singleProjectId + " and bh like '" + bh + "%'");
            if (MaxBH != null && MaxBH.IndexOf("-") > -1) {
                OrderIndex = ConvertEx.ToInt(MaxBH.Substring(MaxBH.LastIndexOf("-") + 1)) + 10;
            }
            MaxBH = string.Concat(bh, "-", OrderIndex.ToString("D3"));

            T_FileList_MDL filelistMDL = new T_FileList_MDL();
            filelistMDL.SingleProjectID = ConvertEx.ToInt(singleProjectId);       //工程ID
            filelistMDL.BH = MaxBH;                                               //编号
            filelistMDL.PID = ConvertEx.ToInt(pid);                               //父ID
            filelistMDL.Title = "照片" + OrderIndex.ToString();                    //提名
            filelistMDL.RootPath = filePath;                                      //保存路径
            filelistMDL.lrr = Common.Session.GetSession("UserID");                //上传人
            filelistMDL.lrsj = DateTime.Now;                                      //上传时间
            filelistMDL.wjbt = fileName;                                          //文件名称
            filelistMDL.IsFolder = false;
            filelistMDL.OrderIndex = OrderIndex;


            if (System.IO.File.Exists(filePath + fileName)) {
                EXIFMetaData em = new EXIFMetaData();
                EXIFMetaData.Metadata m = em.GetEXIFMetaData(filePath + fileName);

                filelistMDL.xjpp = m.EquipmentMake.DisplayValue;            //相机品牌
                filelistMDL.fbl = m.ImageWidth.DisplayValue + "*" + m.ImageHeight.DisplayValue;       //分辨率
                filelistMDL.xjxh = m.CameraModel.DisplayValue;              //相机型号  
                filelistMDL.XAXIS_RESOLUTION = m.XResolution.DisplayValue;  //X轴分辨率
                filelistMDL.YAXIS_RESOLUTION = m.YResolution.DisplayValue;  //Y轴分辨率
                filelistMDL.IMAGE_WIDTH = m.ImageWidth.DisplayValue;        //宽度
                filelistMDL.IMAGE_HEIGHT = m.ImageHeight.DisplayValue;      //高度
                filelistMDL.DATA_FICAL_LENGTH = m.FocalLength.DisplayValue; //焦距
                filelistMDL.DATA_APERTURE = "";                             //光圈
                filelistMDL.DATA_APERTURE_XS = "";                          //光圈系数
                filelistMDL.FLASH = m.Flash.DisplayValue;                   //闪光灯
                filelistMDL.WHITE_BALANCE = "自动";                         //白平衡

                if (m.ISOSpeed.DisplayValue != null && m.ISOSpeed.DisplayValue.Length > 0)
                    filelistMDL.ISO_SPEED_RATINGS = "ISO-" + m.ISOSpeed.DisplayValue;    //感光度
                filelistMDL.EXPOSURE_PROGRAM = m.ExposureProg.DisplayValue; //曝光程序
                filelistMDL.EXPOSURE_MODE = "";                             //曝光模式
                filelistMDL.DATA_EXPOSURE_TIME = m.ExposureTime.DisplayValue;    //曝光时间
                filelistMDL.QUALITY = "正常";     //清晰度
                filelistMDL.CONTRAST = "正常";    //对比度
                filelistMDL.SATURATION = "正常";  //饱和度
                filelistMDL.MAX_APERTURE = m.MaxAperture.DisplayValue; //最大光圈数
                //if (m.DatePictureTaken.DisplayValue != null && m.DatePictureTaken.DisplayValue.Length > 0)
                //{
                //    string[] spDt = m.DatePictureTaken.DisplayValue.Replace("\0", "").Split(new char[] { ' ' });
                //    if (spDt.Length == 2)
                //    {
                //        filelistMDL.pssj = Convert.ToDateTime(string.Concat(spDt[0].Replace(":", "-"), " ",
                //            spDt[1]));
                //    }
                //}
            }

            int FileListID = filelistBLL.Add(filelistMDL);

            BLL.T_Other_BLL otherBLL = new DigiPower.Onlinecol.Standard.BLL.T_Other_BLL();
            otherBLL.UpdateArchiveStatus(FileListID.ToString(), 10, "0");

            PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_FileList;key=", FileListID,
                ";SingleProjectID=", singleProjectId, ";FileListID=", FileListID, ";Title=", "照片" + OrderIndex.ToString(), ";工程外观图上传"));
        }