Пример #1
0
        public CCFolder SaveFolder(CCFolder folderObj)
        {
            var xx = folderObj.Name;

            if (folderObj.FolderID == 0)
            {
                if (folderObj.Type == 3)
                    folderObj.Type = 2;

                context.CCFolders.Add(folderObj);
                context.SaveChanges();
            }
            else
            {

                CCFolder dbEntry = context.CCFolders.Find(folderObj.FolderID);
                if (dbEntry != null)
                {
                    dbEntry.Name = folderObj.Name;
                    context.SaveChanges();
                }
            }

            return folderObj;
        }
Пример #2
0
 public bool UpdatePauseSync(CCFolder folderObj)
 {
     CCFolder dbEntry = context.CCFolders.Find(folderObj.FolderID);
     if (dbEntry != null)
     {
         if (folderObj.IsPaused != null)
         {
             dbEntry.IsPaused = folderObj.IsPaused;
         }
         context.SaveChanges();
     }
     return true;
 }