Ejemplo n.º 1
0
        public ActionResult RegisterAgentofDeduction(UserAgentOfDeductionView userAgentOfDeductionView)
        {
            if (userAgentOfDeductionView == null)
            {
                throw new ArgumentNullException("userAgentOfDeductionView");
            }

            // check if entries are valid based on definations in RegistrationView model
            if (!this.ModelState.IsValid)
            {
                var returnView = this.accountService.GetUpdatedRegistrationView(userAgentOfDeductionView, "");
                return(this.View("RegisterAgentofDeduction", returnView));
            }

            // call service in domain to process Registration information
            var returnModel = this.accountService.ProcessAgentofDeductionRegistrationInfo(userAgentOfDeductionView);

            // check if there is error message then redisplay view using model
            if (!string.IsNullOrEmpty(returnModel.ProcessingMessage))
            {
                return(this.View("RegisterAgentofDeduction", returnModel));
            }

            return(this.RedirectToAction("Login", "Account",
                                         new { infoMessage = "We have sent an email, Please Login to continue" }));
        }
        /// <summary>
        /// Creates the registration view.
        /// </summary>
        /// <param name="aboutUsSourceCollection">The about us source collection.</param>
        /// <returns>Registration view model</returns>
        /// <exception cref="ArgumentNullException">aboutUsSourceCollection</exception>
        public IUserAgentofDeductionView CreateRegistrationView(IList <IIndustry> industries)
        {
            var industriesDDL = GetIndustryDropDownList.GetIndustry(industries, -1);
            var view          = new UserAgentOfDeductionView
            {
                IndustryList = industriesDDL,
            };

            return(view);
        }