private void SendEmailForUploading(int projectId, int userId, string fileDescription, string filePath)
        {
            if (projectId == 0)
            {
                return;
            }
            UserApplication    userApp     = new UserApplication();
            ProjectApplication projectApp  = new ProjectApplication();
            UsersEntity        usersEntity = userApp.GetUser(userId);

            //发邮件的角色必须是Client或PM
            if (usersEntity.Role != RolesEnum.CLIENT && usersEntity.Role != RolesEnum.PM && usersEntity.Status == Status.Active.ToString().ToUpper())
            {
                return;
            }

            ProjectsEntity projectEntity = projectApp.Get(projectId);
            IEmailSender   smtpClient    = new SmtpClientEmailSender(new TextFileLogger());

            //邮件参数初始化
            string contentTemplete = GetEmailTemplate("SendEmailToCilentAndPMWhenUploading.txt").Trim();

            if (!string.IsNullOrEmpty(contentTemplete))
            {
                contentTemplete = contentTemplete.Replace("[UploadUser]", usersEntity.FirstName)
                                  .Replace("[ProjectTitle]", projectEntity.Title)
                                  .Replace("[DateTime]", DateTime.Now.ToString("MM/dd/yyyy HH:mm"))
                                  .Replace("[FileDescription]", fileDescription)
                                  .Replace("[FilePath]", filePath);
            }
            string to      = string.Empty;
            string subject = string.Format("Notice - {0} uploaded a file or some files ", usersEntity.FirstName);

            List <int> userIdList = projectApp.GetActiveUserIdByProjectId(projectId);

            if (userIdList != null && userIdList.Count > 0)
            {
                userIdList.RemoveAll(o => o == userId);
                foreach (int item in userIdList)
                {
                    var userItem = userApp.GetUser(item);
                    if (userItem.Role == RolesEnum.CLIENT || userItem.Role == RolesEnum.PM)
                    {
                        to = userItem.Email;
                        if (!string.IsNullOrEmpty(contentTemplete))
                        {
                            string content = contentTemplete.Replace("[FirstName]", userItem.FirstName)
                                             .Replace("[LastName]", userItem.LastName);
                            smtpClient.SendMail(to, subject, content, false, MailPriority.Normal);
                        }
                    }
                }
            }
        }