Esempio n. 1
0
        public IActionResult VerifaceEmail([Bind("Email")] Person personParam)
        {
            _ValidationWrapper.SetModelState(this.ModelState);

            if (!_PersonService.IsValidEmail(personParam.Email))
            {
                _ValidationWrapper.MapTo(_PersonService.GetErrors());
                return(View());
            }

            var person = _PersonService.GetPersonByEmail(personParam.Email);

            if (null == person)
            {
                return(RedirectToAction("Create", "Person", new { email = personParam.Email }));
            }

            return(RedirectToAction("Index", "Negotiation", new { personId = person.Id }));
        }
        public IActionResult Create([Bind("ProductId,PersonId,Value")] Negotiation negotiation)
        {
            _ValidationWrapper.SetModelState(this.ModelState);

            if (_NegotiationService.CreateNegotiation(negotiation))
            {
                return(RedirectToAction("ShowAll", "Negotiation"));
            }

            _ValidationWrapper.MapTo(_NegotiationService.GetErrors());
            return(View());
        }
Esempio n. 3
0
        public IActionResult Create([Bind("Name,Value")] Product product)
        {
            _ValidationWrapper.SetModelState(this.ModelState);

            if (_Service.CreateProduct(product))
            {
                return(RedirectToAction("ShowAll", "Negotiation"));
            }

            _ValidationWrapper.MapTo(_Service.GetErrors());
            return(View());
        }