示例#1
0
        private void SpecialForder(DirectoryInfo item)
        {
            // 20160515 添加特殊文件夹判断,如果是特殊文件夹全部上传
            bool isSpecialItemForder = ForderSpecialControl.IsSpecialForder(item);

            if (isSpecialItemForder)
            {
                // 如果特殊文件夹需要更新
                if (ForderSpecialControl.ZipSpecialForder(item))
                {
                    string zipFile = Path.Combine(item.Parent.FullName, item.Name + ".ztlj");

                    var file = new Model.FileModel()
                    {
                        ActionNum        = 2,
                        ClientPath       = item.FullName,
                        File_Ext         = item.Extension,
                        File_Size        = (int)new FileInfo(zipFile).Length,
                        File_Name        = item.Name,
                        File_Modify_Time = item.LastAccessTime.Ticks
                    };

                    if (file != null)
                    {
                        AddFileToCache(file.ClientPath, file);
                    }
                }
            }
        }
示例#2
0
        private void SpecialForder(DirectoryInfo item, string userName, int curParentId, int curProjectId)
        {
            // 20160515 添加特殊文件夹判断,如果是特殊文件夹全部上传
            bool isSpecialItemForder = ForderSpecialControl.IsSpecialForder(item);

            if (isSpecialItemForder)
            {
                if (CheckSpecialForderUpload(item, curParentId, userName, curProjectId))
                {
                    // 如果特殊文件夹需要更新
                    if (ForderSpecialControl.ZipSpecialForder(item))
                    {
                        string zipFile = Path.Combine(item.Parent.FullName, item.Name + ".ztlj");
                        var    file    = CheckFileUploadToDb(new FileInfo(zipFile), curParentId, userName, curProjectId);
                        if (file != null)
                        {
                            AddFileToCache(file.ClientPath, file);
                        }
                    }
                }
            }
        }