コード例 #1
0
ファイル: AccountController.cs プロジェクト: ndrmc/cats-hub
        //
        // GET: /Account/LogOn


        /// <summary>
        /// Initializes data that might not be available when the constructor is called.
        /// </summary>
        /// <param name="requestContext">The HTTP context and route data.</param>
        protected override void Initialize(RequestContext requestContext)
        {
            base.Initialize(requestContext);
            //Url = new UrlHelperWrapper(base.Url);
            if (Url == null)
            {
                Url = new UrlHelperWrapper(requestContext);
            }
        }
コード例 #2
0
        public static string BuildUrl(int pageNumber, QueryUrl queryUrl, IUrlHelperWrapper urlHelper)
        {
            RouteValueDictionary routeValueDictionary = queryUrl.AddQueriesToUrl(
                new Dictionary <string, string>
            {
                {
                    "Page", pageNumber.ToString()
                }
            });

            return(urlHelper.RouteUrl(routeValueDictionary));
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountController"/> class.
 /// </summary>
 //public AccountController()
 //    : this(new MembershipWrapper(), new FormsAuthenticationWrapper(), null)
 //{
 //}
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountController"/> class.
 /// </summary>
 /// <param name="membershipObject">The membership object.</param>
 /// <param name="formsAuthenticationObject">The forms authentication object.</param>
 /// <param name="urlHelper">The URL helper.</param>
 public AccountController(IMembershipWrapper membershipObject,
                             IFormsAuthenticationWrapper formsAuthenticationObject,
                             IUrlHelperWrapper urlHelper,
                             IUserProfileService userProfileService,
                             IForgetPasswordRequestService forgetPasswordRequestService,
                              ISettingService settingService)
 {
     this.membership = membershipObject;
     this.Url = urlHelper;
     this.authentication = formsAuthenticationObject;
     this._forgetPasswordRequestService = forgetPasswordRequestService;
     this._settingService = settingService;
     this._userProfileService = userProfileService;
 }
コード例 #4
0
ファイル: AccountController.cs プロジェクト: ndrmc/cats-hub
        /// <summary>
        /// Initializes a new instance of the <see cref="AccountController"/> class.
        /// </summary>
        //public AccountController()
        //    : this(new MembershipWrapper(), new FormsAuthenticationWrapper(), null)
        //{

        //}

        /// <summary>
        /// Initializes a new instance of the <see cref="AccountController"/> class.
        /// </summary>
        /// <param name="membershipObject">The membership object.</param>
        /// <param name="formsAuthenticationObject">The forms authentication object.</param>
        /// <param name="urlHelper">The URL helper.</param>
        public AccountController(IMembershipWrapper membershipObject,
                                 IFormsAuthenticationWrapper formsAuthenticationObject,
                                 IUrlHelperWrapper urlHelper,
                                 IUserProfileService userProfileService,
                                 IForgetPasswordRequestService forgetPasswordRequestService,
                                 ISettingService settingService)
        {
            this.membership     = membershipObject;
            this.Url            = urlHelper;
            this.authentication = formsAuthenticationObject;
            this._forgetPasswordRequestService = forgetPasswordRequestService;
            this._settingService     = settingService;
            this._userProfileService = userProfileService;
        }
コード例 #5
0
 //
 // GET: /Account/LogOn
 /// <summary>
 /// Initializes data that might not be available when the constructor is called.
 /// </summary>
 /// <param name="requestContext">The HTTP context and route data.</param>
 protected override void Initialize(RequestContext requestContext)
 {
     base.Initialize(requestContext);
     //Url = new UrlHelperWrapper(base.Url);
     if (Url == null)
         Url = new UrlHelperWrapper(requestContext);
 }
コード例 #6
0
        public static string BuildPageSizeUrl(int defaultPageSize, int maxItemsPerPage, int totalItems, QueryUrl queryUrl, IUrlHelperWrapper urlHelper)
        {
            var pageSize = GetOtherPageSizeByCurrentPageSize(maxItemsPerPage, totalItems, defaultPageSize);
            RouteValueDictionary routeValueDictionary = queryUrl.AddQueriesToUrl(
                new Dictionary <string, string>
            {
                {
                    "pageSize", pageSize.ToString()
                },
                {
                    "page", 1.ToString()
                }
            });

            return(urlHelper.RouteUrl(routeValueDictionary));
        }