Esempio n. 1
0
 public HomeController(ITraitService traitService, IMarkManager markManager, Random random, INoteManager noteManager)
 {
     _traitService = traitService;
     _markManager  = markManager;
     _random       = random;
     _noteManager  = noteManager;
 }
 public FolderController(IStringLocalizer <FolderController> localizer, IFolderManager folderManager, IGroupManager groupManager,
                         INoteManager noteManager, IEventManager eventManager)
 {
     _localizer     = localizer;
     _folderManager = folderManager;
     _groupManager  = groupManager;
     _noteManager   = noteManager;
     _eventManager  = eventManager;
 }
 public NoteController(INoteManager noteManager, IGroupManager groupManager, IFolderManager folderManager,
                       IUserNoteManager userNoteManager, IEventManager eventManager, IFileManager fileManager)
 {
     _noteManager     = noteManager;
     _userNoteManager = userNoteManager;
     _groupManager    = groupManager;
     _folderManager   = folderManager;
     _eventManager    = eventManager;
     _fileManager     = fileManager;
 }
        public TaskTest()
        {
            IoC.Configure();

            _user = new User();
            IUserManager um = ObjectFactory.GetInstance<IUserManager>();
            um.CreateUser(_user);

            _taskListManager = ObjectFactory.GetInstance<ITaskListManager>();
            _noteManager = ObjectFactory.GetInstance<INoteManager>();
            _taskManager = ObjectFactory.GetInstance<ITaskManager>();
        }
        public BreedRootMutation(
            GraphQLUserContextAccessor accessor,
            IBreedManager breeds,
            INoteManager notes,
            IUnitOfWork unitOfWork
            )
        {
            this._context    = accessor.Context;
            this._breeds     = breeds;
            this._notes      = notes;
            this._unitOfWork = unitOfWork;

            this.AddNoteMutations();
        }
        public NoteTest()
        {
            IoC.Configure();

            _user = new User();
            IUserManager um = ObjectFactory.GetInstance<IUserManager>();
            um.CreateUser(_user);

            _taskList = new TaskList() { Name = "new list", Creator = _user, Users = new List<User>() { _user } };
            _taskListManager = ObjectFactory.GetInstance<ITaskListManager>();
            _taskListManager.CreateTaskList(_user, _taskList);

            _noteManager = ObjectFactory.GetInstance<INoteManager>();
        }
Esempio n. 7
0
        public ContactRootMutation(
            GraphQLUserContextAccessor accessor,
            IContactManager contacts,
            INoteManager notes,
            IUnitOfWork unitOfWork
            )
        {
            this._context    = accessor.Context;
            this._contacts   = contacts;
            this._notes      = notes;
            this._unitOfWork = unitOfWork;

            this.AddNoteMutations();
        }
        public SpeciesRootMutation(
            GraphQLUserContextAccessor accessor,
            ISpeciesManager species,
            INoteManager notes,
            IUnitOfWork unitOfWork
            )
        {
            this._context    = accessor.Context;
            this._species    = species;
            this._notes      = notes;
            this._unitOfWork = unitOfWork;

            this.AddNoteMutations();
        }
        public LocationRootMutation(
            GraphQLUserContextAccessor accessor,
            ILocationManager locations,
            INoteManager notes,
            IUnitOfWork unitOfWork
            )
        {
            this._context    = accessor.Context;
            this._locations  = locations;
            this._notes      = notes;
            this._unitOfWork = unitOfWork;

            this.AddNoteMutations();
        }
Esempio n. 10
0
 public EquipmentController(IMapper mapper, IEquipmentManager equipmentManager,
                            INoteManager noteManager, IEmailScheduleManager emailScheduleManager,
                            IBlobManager blobManager, IEquipmentBlobManager equipmentBlobManager,
                            IBlobService blobService, ILoanManager loanManager, ILoanEquipmentManager loanEquipmentManager)
 {
     __Mapper               = mapper ?? throw new ArgumentNullException(nameof(mapper));
     __EquipmentManager     = equipmentManager ?? throw new ArgumentNullException(nameof(equipmentManager));
     __NoteManager          = noteManager ?? throw new ArgumentNullException(nameof(noteManager));
     __EmailScheduleManager = emailScheduleManager ?? throw new ArgumentNullException(nameof(emailScheduleManager));
     __BlobManager          = blobManager ?? throw new ArgumentNullException(nameof(blobManager));
     __EquipmentBlobManager = equipmentBlobManager ?? throw new ArgumentNullException(nameof(equipmentBlobManager));
     __BlobService          = blobService ?? throw new ArgumentNullException(nameof(blobService));
     __LoanManager          = loanManager ?? throw new ArgumentNullException(nameof(loanManager));
     __LoanEquipmentManager = loanEquipmentManager ?? throw new ArgumentNullException(nameof(loanEquipmentManager));
 }
Esempio n. 11
0
 /// <summary>
 /// Adding Dependency
 /// </summary>
 /// <param name="noteManager"></param>
 public NoteController(INoteManager noteManager)
 {
     manager = noteManager;
 }
Esempio n. 12
0
 public NoteService(INoteManager noteManager)
 {
     this._NoteManager = noteManager;
 }
Esempio n. 13
0
 public NoteController(IMapper mapper, INoteManager manager)
 {
     _mapper  = mapper;
     _manager = manager;
 }
Esempio n. 14
0
        public ManagerResult <List <Note> > SearchNotesByTitleAndAuthorId(int pageSize, int pageIndex, string searchStr, int authorId, out int totalRows)
        {
            INoteManager business = NoteBusinessFactory.Instance.Create(this.Version);

            return(business.SearchNotesByTitleAndAuthorId(pageSize, pageIndex, searchStr, authorId, out totalRows));
        }
Esempio n. 15
0
        public ManagerResult <List <Note> > GetNotesByAuthorId(int id)
        {
            INoteManager business = NoteBusinessFactory.Instance.Create(this.Version);

            return(business.GetNotesByAuthorId(id));
        }
Esempio n. 16
0
        public ManagerResult <Note> AddNote(Note note)
        {
            INoteManager business = NoteBusinessFactory.Instance.Create(this.Version);

            return(business.AddNote(note));
        }
Esempio n. 17
0
 public NoteManagerController(INoteManager noteManager, TagService tagService)
 {
     this._noteManager = noteManager;
     this._tagService  = tagService;
 }
Esempio n. 18
0
 public NoteController(INoteManager noteManager, IConfiguration configuration)
 {
     this.configuration = configuration;
     this.noteManager   = noteManager;
 }
Esempio n. 19
0
        public ManagerResult <bool> AddNoteAndContents(Note note, List <NoteContent> noteContents)
        {
            INoteManager business = NoteBusinessFactory.Instance.Create(this.Version);

            return(business.AddNoteAndContents(note, noteContents));
        }
Esempio n. 20
0
 public ArchiveController(INoteManager noteManager, IMarkManager markManager, IHttpContextHendler httpContextHendler, UserManager <DailerUser> userManager)
 {
     _noteManager        = noteManager;
     _markManager        = markManager;
     _httpContextHendler = httpContextHendler;
 }
Esempio n. 21
0
        public ManagerResult <NoteBrowsedRecord> NoteGetBrowsed(int noteId, int userId)
        {
            INoteManager business = NoteBusinessFactory.Instance.Create(this.Version);

            return(business.NoteGetBrowsed(noteId, userId));
        }
 public NotesController()
 {
     _manager = ObjectFactory.GetInstance<INoteManager>();
 }
Esempio n. 23
0
        public ManagerResult <List <Note> > SearchNotesByTimeSpan(int pageSize, int pageIndex, DateTime startTime, DateTime endTime, out int totalRows)
        {
            INoteManager business = NoteBusinessFactory.Instance.Create(this.Version);

            return(business.SearchNotesByTimeSpan(pageSize, pageIndex, startTime, endTime, out totalRows));
        }
Esempio n. 24
0
 public NoteController(INoteManager noteManager)
 {
     this.noteManager = noteManager;
 }
Esempio n. 25
0
 /// <summary>
 /// constructor for note controller
 /// </summary>
 /// <param name="manager"></manager>
 public NoteController(INoteManager manager)
 {
     this.manager = manager;
 }
 public NotesController(IUserManager userManager, INoteManager manager)
     :base(userManager)
 {
     _notesManager = manager;
 }
 public TaskManager(ITaskListManager listMgr, INoteManager noteMgr)
 {
     _taskListManager = listMgr;
     _noteManager = noteMgr;
 }
 public NoteController(IMapper mapper, INoteManager noteManager, IEquipmentManager equipmentManager)
 {
     __Mapper           = mapper ?? throw new ArgumentNullException(nameof(mapper));
     __NoteManager      = noteManager ?? throw new ArgumentNullException(nameof(noteManager));
     __EquipmentManager = equipmentManager ?? throw new ArgumentNullException(nameof(noteManager));
 }
Esempio n. 29
0
 public NoteList(INoteManager noteManager)
 {
     this._noteManager = noteManager;
 }
Esempio n. 30
0
        public static void AddNoteMutationsAsync <TSourceType>(
            this ObjectGraphType <TSourceType> mutator,
            DataAccessUserContext context,
            IUnitOfWork unitOfWork,
            INoteManager notes,
            string writeNotesPerm,
            GetNoteOwnerFunc <TSourceType> getNoteOwner
            )
            where TSourceType : class
        {
            mutator.FieldAsync <BooleanGraphType>(
                "addNote",
                "Adds a note.",
                new QueryArguments(
                    // category: String!
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name = "category"
            },
                    // content: String!
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name = "content"
            }
                    ),
                async ctx =>
            {
                await context.EnforceHasPolicyAsync(writeNotesPerm);

                using (var scope = unitOfWork.Begin("Add note"))
                {
                    var owner = getNoteOwner(ctx);
                    var note  = new NoteEntry
                    {
                        NoteOwner = owner,
                        Category  = ctx.GetArgument <string>("category"),
                        Content   = ctx.GetArgument <string>("content")
                    };
                    await notes.CreateAsync(note);
                    scope.Commit();
                }

                return(true);
            }
                );

            mutator.FieldAsync <BooleanGraphType>(
                "deleteNotes",
                "Deletes a set of notes.",
                new QueryArguments(
                    // ids: [ID!]!
                    new QueryArgument <NonNullGraphType <ListGraphType <NonNullGraphType <IdGraphType> > > >
            {
                Name = "ids"
            }
                    ),
                async ctx =>
            {
                await context.EnforceHasPolicyAsync(writeNotesPerm);

                using (var scope = unitOfWork.Begin("Delete notes"))
                {
                    var owner = getNoteOwner(ctx);
                    foreach (var id in ctx.GetArgument <List <int> >("ids"))
                    {
                        var note = await notes.GetByIdAsync(id);
                        if (!note.Succeeded)
                        {
                            scope.Rollback("Note was not found");
                            return(false);
                        }

                        if (!owner.NoteEntries.Any(e => e.NoteEntryId == note.Value.NoteEntryId))
                        {
                            scope.Rollback("Note does not belong to contact");
                            return(false);
                        }

                        notes.Delete(note.Value);
                    }

                    scope.Commit();
                }

                return(true);
            }
                );
        }