Beispiel #1
0
        private async Task SendMail()
        {
            if (!await _notificationService.IsSend())
            {
                #region *) Field
                string token  = Request.Headers["Authorization"];
                var    userID = Extensions.GetDecodeTokenByProperty(token, "nameid").ToInt();

                var auditUploadModel = _actionPlanService.CheckLateOnUpdateData(userID);
                var model            = _actionPlanService.CheckDeadline();
                #endregion

                #region 1) Late On Update
                Thread lateOnTask = new Thread(async() => await CheckLateOnUpdate(auditUploadModel));
                lateOnTask.Start();

                #endregion

                #region 2) Check Late On Task
                Thread lateOnUpload = new Thread(async() => await CheckLateOnTask(model));
                lateOnUpload.Start();
                #endregion

                #region *) Thông báo để biết gửi mail hay chưa

                var itemSendMail = new StateSendMail();
                await _notificationService.AddSendMail(itemSendMail);

                await _errorMessageService.Add(new ErrorMessage
                {
                    Function = "Send Mail",
                    Name     = "[KPI System] Late on task, [KPI System] Late on upload data"
                });

                #endregion
            }
        }
Beispiel #2
0
 private void LOG(string Name)
 {
     _errorMessageService.Add(new Models.EF.ErrorMessage {
         Function = "Sending Mail", Name = Name
     });
 }