Exemplo n.º 1
0
 /// <summary>
 /// Override ParsePathInfo to determine action and optional parameters.
 /// </summary>
 protected override void ParsePathInfo()
 {
     base.ParsePathInfo();
     if (base.ModuleParams.Length > 0)
     {
         // First pathinfo parameter is the module action.
         try
         {
             this._currentAction = (ProfileModuleAction)Enum.Parse(typeof(ProfileModuleAction)
                                                                   , base.ModuleParams[0], true);
             if (this._currentAction == ProfileModuleAction.ViewProfile)
             {
                 // The second paramter is the UserId
                 this._currentUserId = Int32.Parse(base.ModuleParams[1]);
             }
         }
         catch (ArgumentException ex)
         {
             throw new Exception("Error when parsing module action: " + base.ModuleParams[0], ex);
         }
         catch (Exception ex)
         {
             throw new Exception("Error when parsing module parameters: " + base.ModulePathInfo, ex);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="emailService"></param>
        /// <param name="userService"></param>
        public ProfileModule(IUserService userService, IEmailService emailService)
        {
            this._userService              = userService;
            this._emailService             = emailService;
            this._emailService.TemplateDir = HttpContext.Current.Request.MapPath(virtualEmailTemplateDir);

            // Set default action.
            this._currentAction = ProfileModuleAction.EditProfile;
            InitInboundActions();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="emailService"></param>
        /// <param name="userService"></param>
        public ProfileModule(IUserService userService, IEmailService emailService)
        {
            this._userService = userService;
            this._emailService = emailService;
            this._emailService.TemplateDir = HttpContext.Current.Request.MapPath(VirtualEmailTemplateDir);

            // Set default action.
            this._currentAction = ProfileModuleAction.EditProfile;
            InitInboundActions();
        }
 /// <summary>
 /// Override ParsePathInfo to determine action and optional parameters.
 /// </summary>
 protected override void ParsePathInfo()
 {
     base.ParsePathInfo();
     if (base.ModuleParams.Length > 0)
     {
         // First pathinfo parameter is the module action.
         try
         {
             this._currentAction = (ProfileModuleAction)Enum.Parse(typeof(ProfileModuleAction)
                 , base.ModuleParams[0], true);
             if (this._currentAction == ProfileModuleAction.ViewProfile)
             {
                 // The second paramter is the UserId
                 this._currentUserId = Int32.Parse(base.ModuleParams[1]);
             }
         }
         catch (ArgumentException ex)
         {
             throw new Exception("Error when parsing module action: " + base.ModuleParams[0], ex);
         }
         catch (Exception ex)
         {
             throw new Exception("Error when parsing module parameters: " + base.ModulePathInfo, ex);
         }
     }
 }