Пример #1
0
        public void Init()
        {
            _messageTemplateServiceMock = new Mock <IMessageTemplateService>();
            _messageTemplateServiceMock.Setup(x => x.GetMessageTemplateByName(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(Task.FromResult(new MessageTemplate {
                IsActive = true
            }));

            _queuedEmailServiceMock = new Mock <IQueuedEmailService>();

            _languageServiceMock = new Mock <ILanguageService>();
            _languageServiceMock.Setup(x => x.GetLanguageById(It.IsAny <string>())).Returns(Task.FromResult(new Language()));
            _languageServiceMock.Setup(x => x.GetAllLanguages(It.IsAny <bool>(), It.IsAny <string>())).Returns(Task.FromResult(
                                                                                                                   new List <Language> {
                new Language {
                    Name = "English"
                }, new Language {
                    Name = "Polish"
                }
            } as IList <Language>));

            _emailAccountServiceMock = new Mock <IEmailAccountService>();
            _emailAccountServiceMock.Setup(x => x.GetAllEmailAccounts())
            .Returns(Task.FromResult(new List <EmailAccount> {
                new EmailAccount {
                    Email = "*****@*****.**"
                }
            } as IList <EmailAccount>));

            _messageTokenProviderMock = new Mock <IMessageTokenProvider>();

            _storeServiceMock = new Mock <IStoreService>();
            _storeServiceMock.Setup(x => x.GetStoreById(It.IsAny <string>())).Returns(Task.FromResult(new Store()));
            _storeServiceMock.Setup(x => x.GetAllStores()).Returns(Task.FromResult(new List <Store>() as IList <Store>));

            _mediatorMock = new Mock <IMediator>();
            _mediatorMock.Setup(x => x.Send(It.IsAny <GetCustomerByIdQuery>(), default))
            .Returns(Task.FromResult(new Customer {
                Email = "*****@*****.**"
            }));

            _emailAccountSettingsMock = new Mock <EmailAccountSettings>();
            _commonSetting            = new Mock <CommonSettings>();

            _workflowMessageService = new WorkflowMessageService(
                _messageTemplateServiceMock.Object,
                _queuedEmailServiceMock.Object,
                _languageServiceMock.Object,
                _emailAccountServiceMock.Object,
                _messageTokenProviderMock.Object,
                _storeServiceMock.Object,
                _mediatorMock.Object,
                _emailAccountSettingsMock.Object,
                _commonSetting.Object);
            _product = new Product();
        }
Пример #2
0
        public virtual void Execute()
        {
            //T_CMS_Master_ContractCollection
            try
            {
                REmployeeCollections objEmpMissingList = ReportManager.FiveDayReminder(new REmployeePara()
                {
                    EntityID = 10001, NumOfDay = 5, FromDate = SystemConfig.CurrentDate
                });
                if (objEmpMissingList.Count > 0)
                {
                    EmpReminderModel objReminder = new EmpReminderModel();
                    objReminder.EmployeeList = objEmpMissingList;
                    WorkflowMessageService.SendFiveDayReminderMessage("[email protected];[email protected];[email protected];", objReminder);
                }

                //get the probation List
                //QueuedEmailCollection objEmailList = T_CMS_Master_ContractManager.GetProbationContractList(1);

                //foreach (QueuedEmail queuedEmail in objEmailList)
                //{
                //    //Insert into QueEmail and the email will auto send by the system
                //    QueuedEmailManager.Add(queuedEmail);


                //}
                //QueuedEmailManager.Add(new QueuedEmail()
                //{
                //    CompanyID = 1,
                //    Id = 0,
                //    To = "*****@*****.**",
                //    CC= "*****@*****.**",
                //    From = "*****@*****.**",
                //    Subject="Reminder - Go to Binh Hung",
                //    Body="It is a day we spend together, please join Binh Hung Tour",
                // CreatedDate = DateTime.Now,
                // CreatedOnUtc = DateTime.UtcNow

                //});
            }
            catch (Exception exc)
            {
                // _logger.Error(string.Format("Error sending e-mail. {0}", exc.Message), exc);
            }
            finally
            {
                //queuedEmail.SentTries = queuedEmail.SentTries + 1;
                //    _queuedEmailService.UpdateQueuedEmail(queuedEmail);
            }
        }
Пример #3
0
 public WebsiteController()
 {
     _workflowMessageService = new WorkflowMessageService();
 }
 public AccountController()
 {
     _workflowMessageService = new WorkflowMessageService();
 }
Пример #5
0
 public PayPalController()
 {
     db = new GreenProDbEntities();
     _workflowMessageService = new WorkflowMessageService();
 }
Пример #6
0
 public CarUsersController()
 {
     _workflowMessageService = new WorkflowMessageService();
 }
 public GaragesCarDayController()
 {
     db = new GreenProDbEntities();
     _workflowMessageService = new WorkflowMessageService();
 }
Пример #8
0
 public HomeController()
 {
     _workflowMessageService = new WorkflowMessageService();
     _db = new Data.GreenProDbEntities();
 }
Пример #9
0
 public CrewLeaderController()
 {
     db = new GreenProDbEntities();
     _workflowMessageService = new WorkflowMessageService();
 }