public EmailRingEmailTemplateViewModelBuilder(EmailRingModel model, IJewelRepository jewelRepository,
     IMappingEngine mapper)
 {
     this.model = model;
     this.jewelRepository = jewelRepository;
     this.mapper = mapper;
 }
 public EmailRingEmailTemplateViewModelBuilder(EmailRingModel model, IJewelRepository jewelRepository,
                                               IMappingEngine mapper)
 {
     this.model           = model;
     this.jewelRepository = jewelRepository;
     this.mapper          = mapper;
 }
Пример #3
0
        public ActionResult EmailRing(EmailRingModel model)
        {
            try
            {
                var builder = new EmailRingEmailTemplateViewModelBuilder(model, jewelRepository, mapper);
                var template = builder.Build();
                mailer.EmailRing(model.FriendEmail, template).Send();
                return Json(new OporationWithoutReturnValueJsonModel());
            }
            catch (Exception ex)
            {
                var viewModel = new OporationWithoutReturnValueJsonModel();
                viewModel.HasError = true;
                viewModel.ErrorMessage = ex.Message;

                return Json(viewModel);
            }
        }