Esempio n. 1
0
        private static Tuple<File, SmallShareRecord> ToFile(object[] r)
        {
            var file = new File
                {
                    ID = r[0],
                    Version = Convert.ToInt32(r[1]),
                    VersionGroup = Convert.ToInt32(r[2]),
                    FolderID = Convert.ToInt32(r[3]),
                    Title = Convert.ToString(r[4]),
                    ContentLength = Convert.ToInt64(r[5]),
                    FileStatus = (FileStatus)Convert.ToInt32(r[6]),
                    CreateBy = new Guid(Convert.ToString(r[7])),
                    CreateOn = Convert.ToDateTime(r[8]),
                    ModifiedBy = new Guid(Convert.ToString(r[9])),
                    ModifiedOn = Convert.ToDateTime(r[10]),
                    ConvertedType = Convert.ToString(r[11]),
                    Comment = Convert.ToString(r[12]),
                    RootFolderType = DocumentsDbHelper.ParseRootFolderType(r[13]),
                    RootFolderCreator = DocumentsDbHelper.ParseRootFolderCreator(r[13]),
                    RootFolderId = DocumentsDbHelper.ParseRootFolderId(r[13])
                };

            SmallShareRecord shareRecord = null;
            if (r[14] != null && r[15] != null && r[16] != null)
            {
                shareRecord = new SmallShareRecord
                    {
                        ShareOn = Convert.ToDateTime(r[14]),
                        ShareBy = new Guid(Convert.ToString(r[15])),
                        ShareTo = new Guid(Convert.ToString(r[16]))
                    };
            }

            return new Tuple<File, SmallShareRecord>(file, shareRecord);
        }
Esempio n. 2
0
        private static Tuple<Folder, SmallShareRecord> ToFolder(object[] r)
        {
            var folder = new Folder
                {
                    ID = Convert.ToInt32(r[0]),
                    ParentFolderID = Convert.ToInt32(r[1]),
                    Title = Convert.ToString(r[2]),
                    CreateBy = new Guid(Convert.ToString(r[3])),
                    CreateOn = Convert.ToDateTime(r[4]),
                    ModifiedBy = new Guid(Convert.ToString(r[5])),
                    ModifiedOn = Convert.ToDateTime(r[6]),
                    TotalSubFolders = Convert.ToInt32(r[7]),
                    TotalFiles = Convert.ToInt32(r[8]),
                    RootFolderType = DocumentsDbHelper.ParseRootFolderType(r[9]),
                    RootFolderCreator = DocumentsDbHelper.ParseRootFolderCreator(r[9]),
                    RootFolderId = DocumentsDbHelper.ParseRootFolderId(r[9])
                };

            SmallShareRecord shareRecord = null;
            if (r[10] != null)
            {
                shareRecord = new SmallShareRecord
                    {
                        ShareOn = Convert.ToDateTime(r[10]),
                        ShareBy = new Guid(Convert.ToString(r[11])),
                        ShareTo = new Guid(Convert.ToString(r[12]))
                    };
            }

            return new Tuple<Folder, SmallShareRecord>(folder, shareRecord);
        }