public ActionResult Index() { var model = new EmailViewModel { USER_ID = "5", NAME_SURNAME = "bilal islam" }; _emailService.Send(model); return View(); }
public EmailResponse Send(EmailViewModel model) { Mapper.CreateMap<EmailViewModel, AH_USER>(); AH_USER emailModel = (AH_USER)Mapper.Map(model, typeof(EmailViewModel), typeof(AH_USER)); emailRepository.Add(emailModel); EmailResponse result = null; return result; }
public void CanSendMail() { //Arrange _emailService = _container.Resolve<IEmailService>(); var model = new EmailViewModel { USER_ID = "5", NAME_SURNAME = "bilal islam" }; //Act EmailResponse response = _emailService.Send(model); //Assert Assert.AreEqual(ResponseCode.SUCCESS, response.ResponseCode); }
private void DispatcherTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { DispatcherTimer.Stop(); try { _emailService = _container.Resolve<IEmailService>(); var list = new List<EmailViewModel>(); var model = new EmailViewModel { UserId = "5", UserName = "******", ServerName = "195.87.213.235", DataBaseName = "Otokar-DMS", Password = "******", ConnectionString = "Server=195.87.213.235;Database=Otokar-DMS;User Id=DMSUser;Password = Xyz123; ",//dynamic from db SqlQuery = "SELECT TOP 10 * from DMS_USER",//dynamic from db ProviderName = "SqlServerImplementor" }; list.Add(model); foreach (var item in list) { _emailService.ConnectionOpen(item); _emailService.ExecuteQuery(item); } } catch (System.Exception ex) { } DispatcherTimer.Start(); }