Exemple #1
0
        public Task <bool> MoveFiles(IEnumerable <Row> p_files, long p_folderID)
        {
            var ls = new List <Myfile>();

            foreach (var row in p_files)
            {
                var pf = new Myfile(ID: row.ID);
                pf.IsAdded     = false;
                pf["ParentID"] = p_folderID;
                ls.Add(pf);
            }
            return(AtCm.BatchSave(ls, false));
        }
Exemple #2
0
        public Task <bool> SaveFile(Row p_row)
        {
            var file = new Myfile(
                ID: p_row.ID,
                ParentID: FolderID == -1 ? (long?)null : FolderID,
                Name: p_row.Str("name"),
                IsFolder: false,
                ExtName: p_row.Str("extname"),
                Info: p_row.Str("info"),
                Ctime: p_row.Date("ctime"),
                UserID: Kit.UserID);

            return(AtCm.Save(file, false));
        }
Exemple #3
0
        public async Task <bool> SaveFolder(long p_id, string p_name)
        {
            Myfile file;

            if (p_id == -1)
            {
                file = new Myfile(
                    ID: await AtCm.NewID(),
                    ParentID: FolderID == -1 ? (long?)null : FolderID,
                    Name: p_name,
                    IsFolder: true,
                    Ctime: Kit.Now,
                    UserID: Kit.UserID);
            }
            else
            {
                file         = new Myfile(ID: p_id);
                file.IsAdded = false;
                file["name"] = p_name;
            }
            return(await AtCm.Save(file));
        }