public static void MyClassInitialize(TestContext testContext)
 {
     Console.WriteLine(Assembly.GetExecutingAssembly().ToString());
     container = TestManager.ConfigureUnityContainer("unity");
     userProfileDao = container.Resolve<IUserProfileDao>();
     userService = container.Resolve<IUserService>();
     userGroupDao = container.Resolve<IUserGroupDao>();
     userGroupService = container.Resolve<IUserGroupService>();
     recomendationDao = container.Resolve<IRecomendationDao>();
     recomendationService = container.Resolve<IRecomendationService>();
     eventDao = container.Resolve<IEventDao>();
     eventService = container.Resolve<IEventService>();
     categoryDao = container.Resolve<ICategoryDao>();
 }
 public CreateMeetingCommandHandler(
     IMeetingRepository meetingRepository,
     IUserRepository userRepository,
     IGroupRepository groupRepository,
     IMapper mapper,
     IRecomendationService recomendationService,
     IAuthorizationService authorizationService,
     IHttpContextAccessor httpContextAccessor)
 {
     _meetingRepository    = meetingRepository;
     _groupRepository      = groupRepository;
     _userRepository       = userRepository;
     _mapper               = mapper;
     _authorizationService = authorizationService;
     _httpContextAccessor  = httpContextAccessor;
     _recomendationService = recomendationService;
 }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /* Get the User ID */
            if (!SessionManager.IsUserAuthenticated(Context))
            {
                /* Do action. */
                String url =
                    Settings.Default.PracticaMaD_applicationURL +
                                    "Pages/User/Authentication.aspx";

                Response.Redirect(Response.ApplyAppPathModifier(url));
            }
            else
            {
                userId = SessionManager.GetUserSession(Context).UserProfileId;
            }

            /* Get Start Index */
            try
            {
                startIndex = Int32.Parse(Request.Params.Get("startIndex"));
            }
            catch (ArgumentNullException)
            {
                startIndex = 0;
            }

            /* Get Count */
            try
            {
                count = Int32.Parse(Request.Params.Get("count"));
            }
            catch (ArgumentNullException)
            {
                count = Settings.Default.PracticaMaD_defaultCount;
            }

            /* Get the Service */
            IUnityContainer container =
                (IUnityContainer)HttpContext.Current.
                    Application["unityContainer"];
            recomendationService =
                container.Resolve<IRecomendationService>();

            /* Get Comments Info */
            RecomendationBlock recBlock =
                recomendationService.GetRecomendationsByUser(userId, startIndex, count);

            gvRecomendations.DataSource = recBlock.Recomendations;
            gvRecomendations.DataBind();

            /* "Previous" link */
            if ((startIndex - count) >= 0)
            {
                String url =
                    Settings.Default.PracticaMaD_applicationURL +
                    "Pages/Recomendation/ShowRecomendations.aspx" +// "?userId=" + eventId +
                    "?startIndex=" + (startIndex - count) + "&count=" +
                    count;

                this.lnkPrevious.NavigateUrl =
                    Response.ApplyAppPathModifier(url);
                this.lnkPrevious.Visible = true;
            }

            /* "Next" link */
            if (recBlock.ExistMoreRecomendations)
            {
                String url =
                    Settings.Default.PracticaMaD_applicationURL +
                    "Pages/Recomendation/ShowRecomendations.aspx" + // "?eventId=" + eventId +
                    "?startIndex=" + (startIndex + count) + "&count=" +
                    count;

                this.lnkNext.NavigateUrl =
                    Response.ApplyAppPathModifier(url);
                this.lnkNext.Visible = true;
            }
        }