Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="membershipRepository"> </param>
 /// <param name="settingsRepository"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postRepository"></param>
 /// <param name="pollVoteRepository"></param>
 /// <param name="pollAnswerRepository"></param>
 /// <param name="pollRepository"></param>
 /// <param name="topicRepository"></param>
 /// <param name="favouriteRepository"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMembershipRepository membershipRepository, ISettingsRepository settingsRepository,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostRepository postRepository, IPollVoteRepository pollVoteRepository, IPollAnswerRepository pollAnswerRepository,
     IPollRepository pollRepository, ITopicRepository topicRepository, IFavouriteRepository favouriteRepository,
     ICategoryService categoryService)
 {
     _membershipRepository = membershipRepository;
     _settingsRepository = settingsRepository;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postRepository = postRepository;
     _pollVoteRepository = pollVoteRepository;
     _pollAnswerRepository = pollAnswerRepository;
     _pollRepository = pollRepository;
     _topicRepository = topicRepository;
     _favouriteRepository = favouriteRepository;
     _categoryService = categoryService;
 }
Пример #2
0
 public FeedAuditPusher(IServiceProvider provider)
 {
     _s3Service       = provider.GetService <IS3Service>();
     _activityService = provider.GetService <IActivityService>();
     _hub             = provider.GetService <IHubContext <FeedHub, IFeedHub> >();
     _logger          = provider.GetService <ILoggingService>();
 }
Пример #3
0
        internal IFacadeUpdateResult <ActivityData> SaveActivity(ActivityDto dto)
        {
            ArgumentValidator.IsNotNull("dto", dto);

            FacadeUpdateResult <ActivityData> result = new FacadeUpdateResult <ActivityData>();
            IActivityService service  = UnitOfWork.GetService <IActivityService>();
            Activity         instance = RetrieveOrNew <ActivityData, Activity, IActivityService>(result.ValidationResult, dto.Id);

            if (result.IsSuccessful)
            {
                instance.ActivityName   = dto.ActivityName;
                instance.EmployeeId     = dto.EmployeeId;
                instance.ContactId      = dto.ContactId;
                instance.CustomerId     = dto.CustomerId;
                instance.ActivityTypeId = dto.ActivityTypeId;
                instance.Notes          = dto.Notes;
                instance.StartTime      = dto.StartTime;
                instance.EndTime        = dto.EndTime;
                instance.TimeSpent      = dto.TimeSpent;

                var saveQuery = service.Save(instance);

                result.AttachResult(instance.RetrieveData <ActivityData>());
                result.Merge(saveQuery);
            }

            return(result);
        }
Пример #4
0
    private Activity RetrieveActivity(int id)
    {
        IActivityService service = null;

        try
        {
            // Create empty new activity if id is 0.
            if (id == 0)
            {
                return(new Activity()
                {
                    Id = 0,
                    TypeId = 1,
                    Date = DateTime.Parse(txtActivityDate.Text),
                    StartDateTime = DateTime.Parse(txtActivityDate.Text),
                    EndDateTime = DateTime.Parse(txtActivityDate.Text)
                });
            }

            // Create service.
            service            = AppService.Create <IActivityService>();
            service.AppManager = this.mAppManager;
            return(service.Retrieve(id));
        }
        catch { throw; }
        finally
        {
            if (service != null)
            {
                service.Dispose();
            }
        }
    }
Пример #5
0
 public CalendarSyncProviderBase(
     IContextService <IPsaContext> arg0,
     IUserRepository arg1,
     IUserService arg2,
     ICalendarSyncService arg3,
     IActivityUserMemberService arg4,
     IActivityContactMemberService arg5,
     IContactRepository arg6,
     IActivityTypeRepository arg7,
     ITimeZoneService arg8,
     IGuidService arg9,
     IActivityService arg10
     )
 {
     field0  = arg0;
     field1  = arg1;
     field2  = arg2;
     field3  = arg3;
     field4  = arg4;
     field5  = arg5;
     field6  = arg6;
     field7  = arg7;
     field8  = arg8;
     field9  = arg9;
     field10 = arg10;
 }
Пример #6
0
 public UserEditPipe(IMembershipService membershipService, ILocalizationService localizationService, IActivityService activityService, ILoggingService loggingService)
 {
     _membershipService   = membershipService;
     _localizationService = localizationService;
     _activityService     = activityService;
     _loggingService      = loggingService;
 }
    private List <CustomEntity> RetrieveActivitySummary(int userId, DateTime activityFromDate, DateTime activityToDate)
    {
        IActivityService service = null;

        try
        {
            // Create an service.
            service            = AppService.Create <IActivityService>();
            service.AppManager = this.mAppManager;

            // Call service method.
            List <CustomEntity> activitySummary = service.RetrieveActivitySummary(userId, activityFromDate, activityToDate);

            // Return.
            return(activitySummary);
        }
        catch { throw; }
        finally
        {
            if (service != null)
            {
                service.Dispose();
            }
            service = null;
        }
    }
Пример #8
0
 public EventController(IEventService eventService, IActivityService activityService, IUserService userService, IEmailService emailService)
 {
     this.eventService = eventService;
     this.activityService = activityService;
     this.userService = userService;
     this.emailService = emailService;
 }
 public CreateActivityHandler(IBusClient busClient, IActivityService activityService,
                              ILogger <CreateActivity> logger)
 {
     _busClient       = busClient;
     _activityService = activityService;
     _logger          = logger;
 }
Пример #10
0
        public async Task Post(Activity item)
        {
            //var activationContext = FabricRuntime.GetActivationContext();

            IActivityService activityService = ServiceProxy.Create <IActivityService>(ServiceFabricHelpers.ActivitiesServiceUri);
            await activityService.Add(item);
        }
Пример #11
0
        public FrmActivityEdit
            (IActivityService activityService)
        {
            this.activityService = activityService;

            InitializeComponent();
        }
Пример #12
0
 public ActivitiesController(IActivityService activityService, IMovieService movieService, ISerieService serieService, IBookService bookService)
 {
     _activityService = activityService;
     _movieService    = movieService;
     _serieService    = serieService;
     _bookService     = bookService;
 }
Пример #13
0
 public LeadController(
     ILeadService LeadService,
     IContactService contactService,
     IMembershipService membershipService,
     IRoleService roleService,
     INoteService noteService,
     IActivityService activityService,
     ISaleService saleService,
     ITaskService taskService,
     ViewDataHelper viewdataHelper,
     ICampaignService campaignService,
     ITagService tagService)
 {
     _leadService = LeadService;
     _contactService = contactService;
     _membershipService = membershipService;
     _roleService = roleService;
     _noteService = noteService;
     _activityService = activityService;
     _saleService = saleService;
     _taskService = taskService;
     _viewdataHelper = viewdataHelper;
     _campaignService = campaignService;
     _tagService = tagService;
 }
 public CreateActivityHandler(IBusClient bus, IActivityService activityServise,
                              ILogger <CreateActivityHandler> logger)
 {
     _bus = bus;
     this.activityServise = activityServise;
     _logger = logger;
 }
Пример #15
0
 public AccountService(IUnitOfWork unitOfWork, ILogger <AccountService> logger, IAuthZeroProvider authZeroProvider, IActivityService activityService)
 {
     _unitOfWork       = unitOfWork;
     _logger           = logger;
     _authZeroProvider = authZeroProvider;
     _activityService  = activityService;
 }
Пример #16
0
 public ActivityViewModel()
 {
     Title = "Activities";
     Activity = new LocalServiceLocator().ActivityService;
     MessengerInstance.Register<ActivitiesUpdatedMessage>(this, ActivitiesChanged);
     Loaded += OnLoaded;
 }
Пример #17
0
 public WeChatController(
     ILogger <WeChatController> logger,
     IWeChatContainer container,
     IAppService appService,
     IMenuService menuService,
     IMediaService mediaService,
     INewsService newsService,
     IActivityService activityService,
     IVoteService voteService,
     IUserService userService,
     IScaleService scaleService,
     IUAService uAService,
     IRoleService roleService,
     IPAService pAService,
     IObjectService objectService)
     : base(logger, userService, scaleService, uAService, roleService, pAService, objectService)
 {
     this.logger          = logger;
     this.app             = container.GetApp();
     this.appService      = appService;
     this.menuService     = menuService;
     this.mediaService    = mediaService;
     this.newsService     = newsService;
     this.activityService = activityService;
     this.voteService     = voteService;
 }
        public SplitDetailViewModel(IActivityService activityService, ITwilioService twilioService, IDialogService dialogService, IMvxPhoneCallTask phoneCallTask, IMvxMessenger messenger, IProspectService prospectService, IMvxNavigationService navigationService)
        {
            Messenger          = messenger;
            _prospectService   = prospectService;
            _navigationService = navigationService;
            _phoneCallTask     = phoneCallTask;
            _dialogService     = dialogService;
            _twilioService     = twilioService;
            _activityService   = activityService;
            Phones             = new ObservableCollection <KeyValuePair <string, string> >();

            Messenger.Subscribe <RefreshMessage>(message => _clearDetailsInteraction.Raise(), MvxReference.Strong);
            Messenger.Subscribe <ProspectChangedMessage>(message => Prepare(new KeyValuePair <Prospect, User>(message.UpdatedProspect, User)), MvxReference.Strong);
            Messenger.Subscribe <UserLogoutMessage>(message => UserLogout(), MvxReference.Strong);
            Messenger.Subscribe <ActivityAddedMessage>(message => ActivityAdded(message.AddedActivity), MvxReference.Strong);
            Messenger.Subscribe <ProspectChangedMessage>(message =>
            {
                RaisePropertyChanged(() => EmailEntered);
                RaisePropertyChanged(() => StreetAddressEntered);
                RaisePropertyChanged(() => MobilePhoneEntered);
                RaisePropertyChanged(() => HomePhoneEntered);
                RaisePropertyChanged(() => WorkPhoneEntered);
                RaisePropertyChanged(() => AllowCalling);
                RaisePropertyChanged(() => AllowEmailing);
                RaisePropertyChanged(() => AllowTexting);
            },
                                                         MvxReference.Strong);
        }
 public ActivitiesController(IActivityService activityService, ICheckpointService checkpointService,
                             IIdentityService identityService)
 {
     this.activityService   = activityService;
     this.checkpointService = checkpointService;
     this.identityService   = identityService;
 }
Пример #20
0
 public ActivityController(IActivityService iActivityService,
                           IUnitOfWork unitOfWork, IUserInfo iUserInfo)
 {
     _iActivityService = iActivityService;
     _unitOfWork       = unitOfWork;
     _IUserInfo        = iUserInfo;
 }
Пример #21
0
 public ActivityController(IActivityService iActivityService,
     IUnitOfWork unitOfWork, IUserInfo iUserInfo)
 {
     _iActivityService = iActivityService;
     _unitOfWork = unitOfWork;
     _IUserInfo = iUserInfo;
 }
Пример #22
0
 public AttendanceController(IAttendanceService attendanceService, IActivityService activityService, IMemberService memberService, IClubService clubService)
 {
     AttendanceService = attendanceService;
     ActivityService   = activityService;
     MemberService     = memberService;
     ClubService       = clubService;
 }
Пример #23
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="cacheService"></param>
 /// <param name="voteService"></param>
 /// <param name="badgeService"></param>
 /// <param name="privateMessageService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="membershipUserPointsService"></param>
 /// <param name="topicService"></param>
 /// <param name="categoryService"></param>
 /// <param name="postService"></param>
 /// <param name="notificationService"></param>
 /// <param name="pollService"></param>
 public MembershipService(IMvcForumContext context, ISettingsService settingsService,
                          ILocalizationService localizationService,
                          IActivityService activityService, ICacheService cacheService, IVoteService voteService,
                          IBadgeService badgeService,
                          IPrivateMessageService privateMessageService,
                          IFavouriteService favouriteService, IMembershipUserPointsService membershipUserPointsService,
                          ITopicService topicService, ICategoryService categoryService, IPostService postService,
                          INotificationService notificationService, IPollService pollService)
 {
     _settingsService             = settingsService;
     _localizationService         = localizationService;
     _activityService             = activityService;
     _cacheService                = cacheService;
     _voteService                 = voteService;
     _badgeService                = badgeService;
     _privateMessageService       = privateMessageService;
     _favouriteService            = favouriteService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicService                = topicService;
     _categoryService             = categoryService;
     _postService                 = postService;
     _notificationService         = notificationService;
     _pollService                 = pollService;
     _context = context;
 }
Пример #24
0
 public ArchivePage(IHoldersService holdersService, IActivityService activityService)
 {
     _holdersService  = holdersService;
     _activityService = activityService;
     InitializeComponent();
     DataContext = this;
 }
Пример #25
0
 /// <summary>
 /// ActivitiesController constructor.
 /// </summary>
 /// <param name="logger">ILogger instance</param>
 /// <param name="actvityService">IActvityService instance</param>
 public ActivitiesController(
     ILogger <ActivitiesController> logger,
     IActivityService actvityService)
 {
     _logger          = logger;
     _activityService = actvityService;
 }
Пример #26
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postService"></param>
 /// <param name="pollVoteService"></param>
 /// <param name="pollAnswerService"></param>
 /// <param name="pollService"></param>
 /// <param name="topicService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMVCForumContext context, ISettingsService settingsService,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostService postService, IPollVoteService pollVoteService, IPollAnswerService pollAnswerService,
     IPollService pollService, ITopicService topicService, IFavouriteService favouriteService, 
     ICategoryService categoryService, IPostEditService postEditService)
 {
     _settingsService = settingsService;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postService = postService;
     _pollVoteService = pollVoteService;
     _pollAnswerService = pollAnswerService;
     _pollService = pollService;
     _topicService = topicService;
     _favouriteService = favouriteService;
     _categoryService = categoryService;
     _postEditService = postEditService;
     _context = context as MVCForumContext;
 }
Пример #27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postService"></param>
 /// <param name="pollVoteService"></param>
 /// <param name="pollAnswerService"></param>
 /// <param name="pollService"></param>
 /// <param name="topicService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMVCForumContext context, ISettingsService settingsService,
                          IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
                          IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
                          ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
                          ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
                          IPostService postService, IPollVoteService pollVoteService, IPollAnswerService pollAnswerService,
                          IPollService pollService, ITopicService topicService, IFavouriteService favouriteService,
                          ICategoryService categoryService, IPostEditService postEditService)
 {
     _settingsService             = settingsService;
     _emailService                = emailService;
     _localizationService         = localizationService;
     _activityService             = activityService;
     _privateMessageService       = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService    = topicNotificationService;
     _voteService  = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService      = loggingService;
     _uploadedFileService = uploadedFileService;
     _postService         = postService;
     _pollVoteService     = pollVoteService;
     _pollAnswerService   = pollAnswerService;
     _pollService         = pollService;
     _topicService        = topicService;
     _favouriteService    = favouriteService;
     _categoryService     = categoryService;
     _postEditService     = postEditService;
     _context             = context as MVCForumContext;
 }
 public ActivityDetailViewModel(IMvxMessenger messenger, IMvxNavigationService navigationService, IUserService userService, IActivityService activitiesService)
 {
     Messenger          = messenger;
     _activitiesService = activitiesService;
     _navigationService = navigationService;
     //_userService = userService;
 }
 public CreateActivityHandler(IBusClient busClient, IActivityService activityService,
                              ILogger <CreateActivityHandler> logger)
 {
     this._busClient      = busClient;
     this.activityService = activityService;
     this.logger          = logger;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="activityService"></param>
 /// <param name="logger"></param>
 /// <param name="activityFactory"></param>
 /// <param name="activityUploadService"></param>
 public ActivityController(IActivityService activityService, ILogger logger, IActivityFactory activityFactory, IActivityUploadService activityUploadService)
 {
     _activityService       = activityService;
     _activityUploadService = activityUploadService;
     _ILogger         = logger;
     _activityFactory = activityFactory;
 }
Пример #31
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="membershipRepository"> </param>
 /// <param name="settingsRepository"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postRepository"></param>
 /// <param name="pollVoteRepository"></param>
 /// <param name="pollAnswerRepository"></param>
 /// <param name="pollRepository"></param>
 /// <param name="topicRepository"></param>
 /// <param name="favouriteRepository"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMembershipRepository membershipRepository, ISettingsRepository settingsRepository,
                          IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
                          IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
                          ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
                          ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
                          IPostRepository postRepository, IPollVoteRepository pollVoteRepository, IPollAnswerRepository pollAnswerRepository,
                          IPollRepository pollRepository, ITopicRepository topicRepository, IFavouriteRepository favouriteRepository,
                          ICategoryService categoryService)
 {
     _membershipRepository        = membershipRepository;
     _settingsRepository          = settingsRepository;
     _emailService                = emailService;
     _localizationService         = localizationService;
     _activityService             = activityService;
     _privateMessageService       = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService    = topicNotificationService;
     _voteService  = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService       = loggingService;
     _uploadedFileService  = uploadedFileService;
     _postRepository       = postRepository;
     _pollVoteRepository   = pollVoteRepository;
     _pollAnswerRepository = pollAnswerRepository;
     _pollRepository       = pollRepository;
     _topicRepository      = topicRepository;
     _favouriteRepository  = favouriteRepository;
     _categoryService      = categoryService;
 }
Пример #32
0
        public void TestInit()
        {
            activities = new List <Activity>
            {
                new Activity {
                    Id = 1, Name = "Walking", Duration = 800, UserId = "2a7f80bb-5e84-4468-88ad-804f848d8f20", StartTime = new DateTime(2014, 2, 15), Type = ActivityType.Walking, Distance = 1200, Steps = 430
                },
                new Activity {
                    Id = 2, Name = "Walking", Duration = 500, UserId = "2a7f80bb-5e84-4468-88ad-804f848d8f20", StartTime = new DateTime(2015, 3, 15), Type = ActivityType.Walking, Distance = 900, Steps = 370
                },
                new Activity {
                    Id = 3, Name = "Jogging", Duration = 1000, UserId = "2a7f80bb-5b36-4468-88ad-804f848d8f20", StartTime = new DateTime(2015, 3, 18), Type = ActivityType.Jogging, Distance = 1500, Steps = 480
                },
                new Activity {
                    Id = 4, Name = "Biking", Duration = 1500, UserId = "2a7f80bb-5b36-4468-88ad-804f848d8f20", StartTime = new DateTime(2015, 4, 2), Type = ActivityType.Biking, Distance = 2000, Steps = 600
                },
                new Activity {
                    Id = 5, Name = "Running", Duration = 400, UserId = "2a7f80bb-3r56-4468-88ad-804f848d8f20", StartTime = new DateTime(2015, 4, 8), Type = ActivityType.Running, Distance = 600, Steps = 300
                },
            };

            var mockContext  = new Mock <ApplicationDbContext>();
            var activityRepo = new Mock <IActivityRepository>();

            activityRepo.Setup(a => a.ReadAll()).Returns(activities);
            activityRepo.Setup(a => a.GetById(It.IsAny <long>()))
            .Returns <long>(i => Task.FromResult(activities.Where(x => x.Id == i).Single()));
            activityRepo.Setup(a => a.GetByUser(It.IsAny <string>()))
            .Returns <string>(i => activities.Where(x => x.UserId == i).ToList());
            activityRepo.Setup(a => a.GetActivitiesByDateRange(It.IsAny <DateTime>(), It.IsAny <DateTime>()))
            .Returns <DateTime, DateTime>((i, j) => activities.Where(x => DateTime.Compare(x.StartTime, i) >= 0 && DateTime.Compare(x.StartTime, j) <= 0).ToList());
            activityRepo.Setup(a => a.GetUserActivitiesByDateRange(It.IsAny <string>(), It.IsAny <DateTime>(), It.IsAny <DateTime>()))
            .Returns <string, DateTime, DateTime>((s, i, j) => activities.Where(x => DateTime.Compare(x.StartTime, i) >= 0 && DateTime.Compare(x.StartTime, j) <= 0 && x.UserId == s).ToList());
            activityRepo.Setup(a => a.GetActivitiesByDay(It.IsAny <DateTime>()))
            .Returns <DateTime>(i => activities.Where(x => DateTime.Compare(x.StartTime, i) == 0).ToList());
            activityRepo.Setup(a => a.GetUserActivitiesByDay(It.IsAny <String>(), It.IsAny <DateTime>()))
            .Returns <string, DateTime>((s, i) => activities.Where(x => DateTime.Compare(x.StartTime, i) == 0 && x.UserId == s).ToList());
            activityRepo.Setup(a => a.GetActivitiesByMonth(It.IsAny <DateTime>()))
            .Returns <DateTime>(i => activities.Where(x => x.StartTime.Month == i.Month).ToList());
            activityRepo.Setup(a => a.GetActivitiesByYear(It.IsAny <int>()))
            .Returns <int>(i => activities.Where(x => x.StartTime.Year == i).ToList());

            var unitOfWork       = new Mock <IUnitOfWork>();
            var goalRepo         = new Mock <IGoalRepository>();
            var feedEventRepo    = new Mock <IFeedEventRepository>();
            var membershipRepo   = new Mock <IMembershipRepository>();
            var moodRepo         = new Mock <IMoodRepository>();
            var groupRepo        = new Mock <IGroupRepository>();
            var badgeRepo        = new Mock <IBadgeRepository>();
            var userRepo         = new Mock <IUserRepository>();
            var userBadgeService = new Mock <IUserBadgeService>();

            IFeedEventService  feedService       = new FeedEventService(feedEventRepo.Object, membershipRepo.Object, moodRepo.Object, groupRepo.Object, badgeRepo.Object, unitOfWork.Object);
            IGoalService       goalService       = new GoalService(goalRepo.Object, activityRepo.Object, feedService, unitOfWork.Object);
            IFeedEventService  feedEventService  = new FeedEventService(feedEventRepo.Object, membershipRepo.Object, moodRepo.Object, groupRepo.Object, badgeRepo.Object, unitOfWork.Object);
            IMembershipService membershipService = new MembershipService(membershipRepo.Object, feedEventService, userBadgeService.Object, unitOfWork.Object);
            IUserService       userService       = new UserService(userRepo.Object, membershipService, unitOfWork.Object);

            activityService = new ActivityService(activityRepo.Object, goalService, feedEventService, userService, userBadgeService.Object, unitOfWork.Object);
        }
Пример #33
0
 public SearchController(
     ILeadService LeadService,
     IContactService contactService,
     IMembershipService membershipService,
     IRoleService roleService,
     INoteService noteService,
     IActivityService activityService,
     ISaleService saleService,
     ITaskService taskService,
     ViewDataHelper viewdataHelper,
     ICampaignService campaignService,
     ITagService tagService)
 {
     _leadService       = LeadService;
     _contactService    = contactService;
     _membershipService = membershipService;
     _roleService       = roleService;
     _noteService       = noteService;
     _activityService   = activityService;
     _saleService       = saleService;
     _taskService       = taskService;
     _viewdataHelper    = viewdataHelper;
     _campaignService   = campaignService;
     _tagService        = tagService;
 }
Пример #34
0
 /// <summary>
 /// activity controller ctor
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="service"></param>
 public ActivityController(
     ILogger <ActivityController> logger,
     IActivityService service
     )
 {
     _service = service;
     _logger  = logger;
 }
Пример #35
0
 public static IActivityService BuildActivityService()
 {
     if (activity_Service == null)
     {
         activity_Service = new ActivityService();
     }
     return activity_Service;
 }
 public SnapshotController(IConfiguration config, IActivityService activityService, IAquariumService aquariumService, IDeviceClient deviceService, ILogger <SnapshotController> logger, IPhotoManager photoManager)
 {
     _config          = config;
     _aquariumService = aquariumService;
     _activityService = activityService;
     _logger          = logger;
     _photoManager    = photoManager;
 }
 public EmailTaskViewModel(IDialogService dialogService, IMvxMessenger messenger, IMvxNavigationService navigationService, IActivityService activityService, IUserService userService)
 {
     _dialogService     = dialogService;
     Messenger          = messenger;
     _navigationService = navigationService;
     _activityService   = activityService;
     _userService       = userService;
 }
Пример #38
0
 public HomeController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IActivityService activityService, IMembershipService membershipService,
     ITopicService topicService, ILocalizationService localizationService, IRoleService roleService,
     ISettingsService settingsService, ICategoryService categoryService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicService = topicService;
     _categoryService = categoryService;
     _activityService = activityService;
 }
Пример #39
0
 public PackageViewModel()
 {
     Loaded += OnLoad;
     var loc = new LocalServiceLocator();
     CoApp = loc.CoAppService;
     VmLoc = new ViewModelLocator();
     Nav = loc.NavigationService;
     Activity = loc.ActivityService;
 }
Пример #40
0
        public ProductViewModel()
        {
            var loc = new LocalServiceLocator();
            CoApp = loc.CoAppService;
            Nav = loc.NavigationService;
            Activity = loc.ActivityService;
            VmLoc = new ViewModelLocator();

            Loaded += OnLoad;
        }
Пример #41
0
        public HomeController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IActivityService activityService, IMembershipService membershipService,
            ITopicService topicService, ILocalizationService localizationService, IRoleService roleService,
            ISettingsService settingsService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _topicService = topicService;
            _activityService = activityService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole = LoggedOnUser == null ? RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
Пример #42
0
 public FileService(IFileRepository _fileRepo
     , ICommentRepository _commentRepo
     , IActivityService _activityServ
     , ISkydriveService _skydriveService
     , IDropBoxService _dropboxService)
 {
     this.repoFile = _fileRepo;
     this.repoComment = _commentRepo;
     this.serviceActivity = _activityServ;
     this.serviceSkydrive = _skydriveService;
     this.serviceDropBox = _dropboxService;
 }
 public void Init()
 {
     _api = Substitute.For<IMVCForumAPI>();
     _activityService = Substitute.For<IActivityService>();
     _privateMessageService = Substitute.For<IPrivateMessageService>();
     _membershipUserPointsService = Substitute.For<IMembershipUserPointsService>();
     _topicNotificationService = Substitute.For<ITopicNotificationService>();
     _voteService = Substitute.For<IVoteService>();
     _badgeService = Substitute.For<IBadgeService>();
     _categoryNotificationService = Substitute.For<ICategoryNotificationService>();
     _loggingService = Substitute.For<ILoggingService>();
 }
Пример #44
0
        // Constructors
        public ActivitiesController()
        {
            IUnitOfWork unitOfWork = RepositoryFactory.GetUnitOfWork("DefaultConnection");

            IRepository<Activity> activityRepository = RepositoryFactory.GetRepository<Activity>(unitOfWork);
            IManager<Activity> activityManager = ManagerFactory.GetManager(activityRepository);
            this.activityService = ServiceFactory.GetActivityService(activityManager);

            IRepository<Package> packageRepository = RepositoryFactory.GetRepository<Package>(unitOfWork);
            IManager<Package> packageManager = ManagerFactory.GetManager(packageRepository);
            this.packageService = ServiceFactory.GetPackageService(packageManager);
        }
Пример #45
0
 public ProjectService(IProjectRepository _repo
     , IActivityService _activityService
     , IFileRepository _fileRepo
     , IUserRepository _userRepo
     )
 {
     serviceActivity = _activityService;
     serviceActivity.ServiceProject = this;
     projectRepo = _repo;
     fileRepo = _fileRepo;
     userRepo = _userRepo;
 }
Пример #46
0
 public ScheduledTaskService(Cache _cache
     , ITempFileService tempService
     , ILogService logService
     , IActivityService activityService
     , IUserService userService
     , IProjectService projectService
     )
 {
     this.serviceTempFile = tempService;
     this.serviceLog = logService;
     this.serviceActivity = activityService;
     this.serviceProject = projectService;
     this.serviceUser = userService;
     this.serviceActivity.ServiceProject = projectService;
     cache = _cache;
 }
Пример #47
0
 public ContactsController(
     INoteService noteService, 
     IContactService contactService, 
     ILeadService leadService, 
     IQuoteService quoteService,
     IMembershipService membershipService,
     IActivityService activityService,
     ViewDataHelper initHelper)
 {
     _noteService = noteService;
     _contactService = contactService;
     _leadService = leadService;
     _quoteService = quoteService;
     _membershipService = membershipService;
     _activityService = activityService;
     _initHelper = initHelper;
 }
Пример #48
0
 public HomeController(
     ILeadService leadService,
     ITaskService taskService, 
     IContactService contactService,
     IMembershipService membershipService,
     IRoleService roleService,
     IActivityService activityService,
     ISaleService saleService,
     ViewDataHelper initHelper)
 {
     _leadService = leadService;
     _taskService = taskService;
     _contactService = contactService;
     _membershipService = membershipService;
     _roleService = roleService;
     _activityService = activityService;
     _saleService = saleService;
     _initHelper = initHelper;
 }
Пример #49
0
 public AccountController(IUserService userService
     , IDropBoxService dropboxService
     , ISkydriveService skydriveService
     , IRegistrationCodeService registrationService
     , UserManager<ApplicationUser> userManager
     , ILogService logService
     , ISecurityService securityService
     , IActivityService activityService
     )
     : base(userService, logService)
 {
     this.serviceDropbox = dropboxService;
     this.serviceSkydrive = skydriveService;
     UserManager = userManager;
     userService.UserManager = userManager;
     this.serviceRegistrationCode = registrationService;
     this.serviceSecurity = securityService;
     this.serviceActivity = activityService;
 }
Пример #50
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"></param>
 /// <param name="localizationService"> </param>
 /// <param name="roleService"> </param>
 /// <param name="settingsService"> </param>
 /// <param name="loggingService"> </param>
 /// <param name="postService"> </param>
 /// <param name="topicService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="pollService"> </param>
 /// <param name="pollVoteService"> </param>
 /// <param name="pollAnswerService"> </param>
 /// <param name="uploadedFileService"></param>
 public AccountController(ILoggingService loggingService,
     IUnitOfWorkManager unitOfWorkManager,
     IMembershipService membershipService,
     ILocalizationService localizationService,
     IRoleService roleService,
     ISettingsService settingsService, IPostService postService, ITopicService topicService, IMembershipUserPointsService membershipUserPointsService, 
     IActivityService activityService, IPollService pollService, IPollVoteService pollVoteService, IPollAnswerService pollAnswerService, IUploadedFileService uploadedFileService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService)
 {
     _activityService = activityService;
     _roleService = roleService;
     _postService = postService;
     _topicService = topicService;
     _membershipUserPointsService = membershipUserPointsService;
     _pollService = pollService;
     _pollVoteService = pollVoteService;
     _pollAnswerService = pollAnswerService;
     _uploadedFileService = uploadedFileService;
 }
Пример #51
0
 public QuoteController(
     ILeadService LeadService, 
     IContactService contactService,
     IMembershipService membershipService,
     IRoleService roleService,
     INoteService noteService,
     IActivityService activityService,
     IQuoteService quoteService,
     IInvoiceService invoiceService)
 {
     _leadService = LeadService;
     _contactService = contactService;
     _membershipService = membershipService;
     _roleService = roleService;
     _noteService = noteService;
     _activityService = activityService;
     _quoteService = quoteService;
     _invoiceService = invoiceService;
 }
Пример #52
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="membershipRepository"> </param>
 /// <param name="settingsRepository"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="api"> </param>
 /// <param name="loggingService"></param>
 public MembershipService(IMembershipRepository membershipRepository, ISettingsRepository settingsRepository,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService, 
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService, 
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, IMVCForumAPI api, ILoggingService loggingService)
 {
     _membershipRepository = membershipRepository;
     _settingsRepository = settingsRepository;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _api = api;
     _loggingService = loggingService;
 }
Пример #53
0
 public InvoiceController(
     ILeadService LeadService,
     IContactService contactService,
     IMembershipService membershipService,
     IRoleService roleService,
     INoteService noteService,
     IActivityService activityService,
     IInvoiceService invoiceService,
     ISaleService saleService,
     ViewDataHelper initHelper)
 {
     _leadService = LeadService;
     _contactService = contactService;
     _membershipService = membershipService;
     _roleService = roleService;
     _noteService = noteService;
     _activityService = activityService;
     _saleService = saleService;
     _invoiceService = invoiceService;
     _initHelper = initHelper;
 }
Пример #54
0
 public SaleController(
     ILeadService LeadService,
     IContactService contactService,
     IMembershipService membershipService,
     IRoleService roleService,
     INoteService noteService,
     IActivityService activityService,
     ISaleService saleService,
     ViewDataHelper initHelper,
     ITagService tagService)
 {
     _leadService = LeadService;
     _contactService = contactService;
     _membershipService = membershipService;
     _roleService = roleService;
     _noteService = noteService;
     _activityService = activityService;
     _saleService = saleService;
     _initHelper = initHelper;
     _tagService = tagService;
 }
Пример #55
0
        public AccountController(IUserService userService,
            IDropBoxService dropboxService,
            ISkydriveService skydriveService,
            IRegistrationCodeService registrationService
            , ILogService logService
            , ISecurityService securityService
            , IActivityService activityService

            )
            : this(userService
            , dropboxService
            , skydriveService
            , registrationService
            , new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()))
            , logService
            , securityService
            , activityService
            )
        {

        }
Пример #56
0
 public SocialController(ISocialService socialService
     , IInvitService invitService
     , IProjectService projectService
     , IActivityService activityService
     , IUserStatisticsService statService
     , IUserService userService
      , ILogService logService
     , ICacheService cacheService
      , ISecurityService security
     , IMailService mail
     )
     : base(userService, logService)
 {
     this.serviceSecurity = security;
     this.serviceSocial = socialService;
     this.serviceInvit = invitService;
     this.serviceProject = projectService;
     this.serviceActivity = activityService;
     this.serviceActivity.ServiceProject = projectService;
     this.serviceStatistics = statService;
     this.serviceCache = cacheService;
     this.serviceMail = mail;
 }
Пример #57
0
        public void Init()
        {
            _api = Substitute.For<IMVCForumAPI>();
            _loggingService = Substitute.For<ILoggingService>();
            _localizationService = Substitute.For<ILocalizationService>();
            _activityService = Substitute.For<IActivityService>();

            AppendBadgeClassPath();

            // Ensure a database sync
            _badgeRepository = Substitute.For<IBadgeRepository>();
            _badgeService = new BadgeService(_badgeRepository,  _api, _loggingService, _localizationService, _activityService);
            _badgeService.SyncBadges();
        }
Пример #58
0
 public CommentService(ICommentRepository repo, IActivityService activityService)
 {
     repoComment = repo;
     this.servActivity = activityService;
 }
 public AjaxActivityController(IXboxUserService xboxUserService, IActivityService activityService, IUserService userService)
 {
     this.xboxUserService = xboxUserService;
     this.activityService = activityService;
     this.userService = userService;
 }
Пример #60
0
 public ScheduleControllerOld(IActivityService activityService,
                           ILinkService linkService)
 {
     _activityService = activityService;
     _linkService = linkService;
 }