コード例 #1
0
        public static void ConvertToFileObjectSQL(List <FileObjectSQL> list, FileObject fo, string parentId)
        {
            if (list == null)
            {
                System.Diagnostics.Debugger.Break();
            }
            FileObjectSQL fos = new FileObjectSQL();

            fos.Id          = fo.Id;
            fos.Name        = fo.Name;
            fos.Size        = fo.Size;
            fos.Type        = fo.Type;
            fos.Extension   = fo.Extension;
            fos.UpdateAt    = fo.UpdateAt;
            fos.Thumbnail   = fo.Thumbnail;
            fos.DownloadUrl = fo.DownloadUrl;
            fos.MimeType    = fo.MimeType;
            fos.ParentId    = parentId;
            if (fo.Owner != null)
            {
                fos.ProfileId          = fo.Owner.Id;
                fos.ProfileEmail       = fo.Owner.Email;
                fos.ProfilePhoneNumber = fo.Owner.PhoneNumber;
                fos.ProfileName        = fo.Owner.Name;
            }
            fos.SpotId = fo.SpotId;
            list.Add(fos);
            if (fo.FileList != null)
            {
                for (var i = 0; i < fo.FileList.Count; i++)
                {
                    ConvertToFileObjectSQL(list, fo.FileList[i], fo.Id);
                }
            }
        }
コード例 #2
0
        //public static int count = 0;
        public static FileObject ConvertToFileObject(object db, FileObjectSQL fos)
        {
            //count++;
            //if (count == 100) System.Diagnostics.Debugger.Break();

            FileObject fo = new FileObject(fos.Id, fos.Name, fos.Size, fos.Type, fos.Extension, fos.UpdateAt, fos.Thumbnail, fos.DownloadUrl, fos.MimeType);

            fo.SpotId = fos.SpotId;
            if (fos.ProfileName != null && fos.ProfileId != null && fos.ProfileEmail != null && fos.ProfilePhoneNumber != null)
            {
                fo.Owner             = new ProfileObject();
                fo.Owner.Id          = fos.ProfileId;
                fo.Owner.Email       = fos.ProfileEmail;
                fo.Owner.Name        = fos.ProfileName;
                fo.Owner.PhoneNumber = fos.ProfilePhoneNumber;
            }

            fo.FileList = GetChildList(db, fos.Id);
            return(fo);
        }
コード例 #3
0
        //public static int count = 0;
        public static FileObject ConvertToFileObject(object db, FileObjectSQL fos)
        {
            //count++;
            //if (count == 100) System.Diagnostics.Debugger.Break();

            FileObject fo = new FileObject(fos.Id, fos.Name, fos.Size, fos.Type, fos.Extension, fos.UpdateAt, fos.Thumbnail, fos.DownloadUrl, fos.MimeType);
            fo.SpotId = fos.SpotId;
            if (fos.ProfileName != null && fos.ProfileId != null && fos.ProfileEmail != null && fos.ProfilePhoneNumber != null)
            {
                fo.Owner = new ProfileObject();
                fo.Owner.Id = fos.ProfileId;
                fo.Owner.Email = fos.ProfileEmail;
                fo.Owner.Name = fos.ProfileName;
                fo.Owner.PhoneNumber = fos.ProfilePhoneNumber;
            }

            fo.FileList = GetChildList(db, fos.Id);
            return fo;
        }
コード例 #4
0
 public static void ConvertToFileObjectSQL(List<FileObjectSQL> list, FileObject fo, string parentId)
 {
     if (list == null) System.Diagnostics.Debugger.Break();
     FileObjectSQL fos = new FileObjectSQL();
     fos.Id = fo.Id;
     fos.Name = fo.Name;
     fos.Size = fo.Size;
     fos.Type = fo.Type;
     fos.Extension = fo.Extension;
     fos.UpdateAt = fo.UpdateAt;
     fos.Thumbnail = fo.Thumbnail;
     fos.DownloadUrl = fo.DownloadUrl;
     fos.MimeType = fo.MimeType;
     fos.ParentId = parentId;
     if (fo.Owner != null)
     {
         fos.ProfileId = fo.Owner.Id;
         fos.ProfileEmail = fo.Owner.Email;
         fos.ProfilePhoneNumber = fo.Owner.PhoneNumber;
         fos.ProfileName = fo.Owner.Name;
     }
     fos.SpotId = fo.SpotId;
     list.Add(fos);
     if (fo.FileList != null)
     {
         for (var i = 0; i < fo.FileList.Count; i++)
         {
             ConvertToFileObjectSQL(list, fo.FileList[i], fo.Id);
         }
     }
 }