예제 #1
0
        public ActionResult AddParticipant(PromoData promo)
        {
            var promoData = _seminarService.GetPromoData();

            promo.Positions = promoData.Positions;
            promo.Seminars  = promoData.Seminars;

            if (promo.Participant?.Position == null)
            {
                ModelState.AddModelError("Position", "Укажите должность");
            }

            if (promo.Participant != null && ModelState.IsValid)
            {
                bool isTransactionCommitted = _seminarService.AddParticipant(promo.Participant);
                promo.IsTransactionCommitted = isTransactionCommitted;
            }

            return(View("MainPage", promo));
        }