public IActionResult OnGetCreate() { var command = new CreateCeremonyGuest { Ceremonies = _ceremonyApplication.GetCeremonies(), //Guests = _guestApplication.GetGuests() }; return(Partial("./Create", command)); }
public JsonResult OnPostCreate(CreateCeremonyGuest command) { var result = _ceremonyGuestApplication.Create(command); var ceremony = _ceremonyApplication.GetDetail(command.CeremonyId); var guests = _ceremonyGuestApplication.GetCeremonyGuests(command.CeremonyId); var guestInfo = _guestApplication.GetGuestsInfo(guests); foreach (var item in guestInfo) { _emailService.SendEmail(ceremony.Title, " جناب آقای دعوتنامه شرکت در در مراسم", item.Email); } return(new JsonResult(result)); }
public OperationResult Create(CreateCeremonyGuest command) { var operation = new OperationResult(); if (_ceremonyGuestRepository.Exist(x => x.GuestId == command.GuestId && x.CeremonyId == command.CeremonyId)) { return(operation.Failed(ApplicationMessages.DuplicatedRecord)); } var ceremonyGuest = new CeremonyGuest(command.GuestId, command.CeremonyId, command.Satisfication); _ceremonyGuestRepository.Create(ceremonyGuest); _ceremonyGuestRepository.SaveChanges(); return(operation.Succedded()); }