Beispiel #1
0
 public EditDocumentTitleModel(FileManagerContext context,
                               ILogger <EditDocumentTitleModel> logger,
                               IGetAccountDataService getAccountDataService)
 {
     db      = context;
     _logger = logger;
     _getAccountDataService = getAccountDataService;
 }
Beispiel #2
0
 public CreateDepartmentModel(FileManagerContext context,
                              IGetAccountDataService getAccountDataService,
                              ILogger <CreateDepartmentModel> logger)
 {
     db = context;
     _getAccountDataService = getAccountDataService;
     _logger = logger;
 }
Beispiel #3
0
 public IndexModel(FileManagerContext context,
                   ILogger <IndexModel> logger,
                   IGetAccountDataService getAccountDataService)
 {
     db      = context;
     _logger = logger;
     _getAccountDataService = getAccountDataService;
 }
Beispiel #4
0
 public DepartmentsListModel(FileManagerContext context,
                             ILogger <DepartmentsListModel> logger,
                             IGetAccountDataService getAccountDataService)
 {
     db      = context;
     _logger = logger;
     _getAccountDataService = getAccountDataService;
 }
Beispiel #5
0
 public IEnumerable <Folder> GetAllFolders()
 {
     using (var context = new FileManagerContext())
     {
         var allFolders = (from f in context.Folders
                           select f).ToArray();
         return(allFolders);
     }
 }
Beispiel #6
0
 public void DeleteFolder(Folder folder)
 {
     using (var context = new FileManagerContext())
     {
         context.Folders.Attach(folder);
         context.Entry(folder).State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Beispiel #7
0
 public IEnumerable <FileNameChange> GetNamesHistory(int fileid)
 {
     using (var context = new FileManagerContext())
     {
         var history = (from h in context.FileNameChanges
                        where h.FileId == fileid
                        select h).ToArray();
         return(history);
     }
 }
Beispiel #8
0
 public File GetFileWhithContent(int fileId)
 {
     using (var context = new FileManagerContext())
     {
         var file = (from c in context.Files
                     where c.FileId == fileId
                     select c).FirstOrDefault();
         return(file);
     }
 }
Beispiel #9
0
 public DepartmentModel(FileManagerContext context,
                        ILogger <DepartmentModel> logger,
                        ISmartBreadcrumbService breadcrumbService,
                        IGetAccountDataService getAccountDataService)
 {
     db                     = context;
     _logger                = logger;
     _breadcrumbService     = breadcrumbService;
     _getAccountDataService = getAccountDataService;
 }
Beispiel #10
0
 public Folder GetFolderById(int folderId)
 {
     using (var context = new FileManagerContext())
     {
         var folder = (from f in context.Folders
                       where f.FolderId == folderId
                       select f).FirstOrDefault();
         return(folder);
     }
 }
Beispiel #11
0
 public GetAccountDataService(UserManager <User> userManager,
                              SignInManager <User> signInManager,
                              FileManagerContext context,
                              ILogger <GetAccountDataService> logger)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     db             = context;
     _logger        = logger;
 }
Beispiel #12
0
 public EditUserDepartmentRolesModel(UserManager <User> userManager,
                                     FileManagerContext context,
                                     IGetAccountDataService getAccountDataService,
                                     ILogger <EditUserDepartmentRolesModel> logger)
 {
     _userManager           = userManager;
     db                     = context;
     _getAccountDataService = getAccountDataService;
     _logger                = logger;
 }
Beispiel #13
0
 public DbInitializeService(UserManager <User> userManager,
                            RoleManager <SystemRole> roleManager,
                            IOptions <DbInitializeMainUser> mainUserData,
                            FileManagerContext context)
 {
     _roleManager  = roleManager;
     _userManager  = userManager;
     _mainUserData = mainUserData.Value;
     db            = context;
 }
Beispiel #14
0
 public ReportingYearModel(FileManagerContext context,
                           ILogger <ReportingYearModel> logger,
                           ISmartBreadcrumbService breadcrumbService,
                           IGetAccountDataService getAccountDataService)
 {
     db                     = context;
     _logger                = logger;
     _breadcrumbService     = breadcrumbService;
     _getAccountDataService = getAccountDataService;
 }
Beispiel #15
0
 public IEnumerable <FileComment> GetFileComments(int fileId)
 {
     using (var context = new FileManagerContext())
     {
         var comments = (from c in context.FileComments
                         where c.FileId == fileId
                         select c).ToArray();
         return(comments);
     }
 }
Beispiel #16
0
 public void AddFile(File file)
 {
     using (var context = new FileManagerContext())
     {
         file.CreationDate = DateTime.Now;
         context.Files.Attach(file);
         context.Entry(file).State = EntityState.Added;
         context.SaveChanges();
     }
 }
Beispiel #17
0
 public File GetFileById(int fileId)
 {
     using (var context = new FileManagerContext())
     {
         var file = (from f in context.Files
                     where f.FileId == fileId
                     select f).FirstOrDefault();
         return(file);
     }
 }
Beispiel #18
0
 public IEnumerable <File> GetAllFilesFromFolder(int folderId)
 {
     using (var context = new FileManagerContext())
     {
         var files = (from f in context.Files
                      where f.Folder.FolderId == folderId
                      select f).ToArray();
         return(files);
     }
 }
Beispiel #19
0
 public UserInfoModel(UserManager <User> userManager,
                      FileManagerContext context,
                      ILogger <UserInfoModel> logger,
                      IGetAccountDataService getAccountDataService)
 {
     _userManager           = userManager;
     db                     = context;
     _logger                = logger;
     _getAccountDataService = getAccountDataService;
 }
Beispiel #20
0
 public void DeleteFile(int fileId)
 {
     using (var context = new FileManagerContext())
     {
         var file = (from f in context.Files
                     where f.FileId == fileId
                     select f).FirstOrDefault();
         context.Files.Attach(file);
         context.Entry(file).State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Beispiel #21
0
        public FileManagerService(
            FileManagerContext context,
            ILogger <FileManagerService> logger,
            IHostingEnvironment appEnvironment,
            IDocumentManagerService documentManagerService)
        {
            db                      = context;
            _logger                 = logger;
            _appEnvironment         = appEnvironment;
            _documentManagerService = documentManagerService;

            InitializeFilesDirectory();
        }
Beispiel #22
0
 public DocumentModel(FileManagerContext context,
                      ILogger <DocumentModel> logger,
                      ISmartBreadcrumbService breadcrumbService,
                      IGetAccountDataService getAccountDataService,
                      IFileManagerService fileManagerService,
                      IDocumentManagerService documentManagerService)
 {
     db                      = context;
     _logger                 = logger;
     _breadcrumbService      = breadcrumbService;
     _getAccountDataService  = getAccountDataService;
     _fileManagerService     = fileManagerService;
     _documentManagerService = documentManagerService;
 }
Beispiel #23
0
        public void UpdateFileComments(int fileId, string comment)
        {
            File file;

            using (var context = new FileManagerContext())
            {
                file = (from f in context.Files
                        where f.FileId == fileId
                        select f).FirstOrDefault();

                var newComment = new FileComment();
                newComment.CommentText = comment;
                newComment.FileId      = file.FileId;
                context.FileComments.Add(newComment);
                context.SaveChanges();
                context.Files.Attach(file);
                context.Entry(file).State = EntityState.Modified;
                context.SaveChanges();
            }
        }
Beispiel #24
0
        public void RenameFile(File file)
        {
            File oldFile;

            using (var context = new FileManagerContext())
            {
                oldFile = (from f in context.Files
                           where f.FileId == file.FileId
                           select f).FirstOrDefault();
            }
            var nameChange = new FileNameChange();

            if (oldFile.FileName != file.FileName)
            {
                nameChange.FileChangeDate = DateTime.Now;
                nameChange.FileId         = file.FileId;
                nameChange.OldName        = oldFile.FileName;
                nameChange.NewName        = file.FileName;

                if (file.FileNameChanges == null)
                {
                    file.FileNameChanges = new List <FileNameChange>();
                }

                file.FileNameChanges.Add(nameChange);
            }
            file.FileContent = oldFile.FileContent;

            using (var context = new FileManagerContext())
            {
                context.FileNameChanges.Add(nameChange);
                context.SaveChanges();
                context.Files.Attach(file);
                context.Entry(file).State = EntityState.Modified;
                context.SaveChanges();
            }
        }
 public ValidationService(ILogger <ValidationService> logger, FileManagerContext context)
 {
     _context = context;
     _logger  = logger;
 }
Beispiel #26
0
 public DocumentManagerService(FileManagerContext context, ILogger <DocumentManagerService> logger)
 {
     db      = context;
     _logger = logger;
 }
 public FileService(FileManagerContext context, ILogger <FileService> logger)
 {
     _context = context;
     _logger  = logger;
 }
Beispiel #28
0
 public SmartBreadcrumbService(FileManagerContext context)
 {
     db = context;
 }
Beispiel #29
0
 public UsersRepository(FileManagerContext context)
 {
     _context = context;
 }
Beispiel #30
0
 public IndexModel(FileManagerContext context)
 {
     db = context;
 }