Exemple #1
0
 public bool UpdateUser(EPUser user)
 {
     MainUnitOfWork unitOfWork = new MainUnitOfWork();
     unitOfWork.Begin();
     unitOfWork.Session.Update(user);
     unitOfWork.Commit();
     return true;
 }
Exemple #2
0
 public EPUser RegisterUser(EPUser user)
 {
     MainUnitOfWork unitOfWork = new MainUnitOfWork();
     unitOfWork.Begin();
     user.Id = (int)unitOfWork.Session.Save(user);
     unitOfWork.Commit();
     return user;
 }
 private void SendSmes(EPUser user, IEnumerable<Sms> smsList)
 {
     if (smsList.Count() > 0)
     {
         SmsModule smsModule = new SmsModule(user.EmailUsername, user.EmailPassword);
         foreach (var sms in smsList)
         {
             bool smsSuccess = smsModule.SendSMS(sms.ToNumber, sms.Content);
             sms.StatusId = smsSuccess ? (int)MessageStatus.Send : (int)MessageStatus.Failed;
             sms.StatusDate = DateTime.Now;
             smsCount += 1;
         }
         campaignService.UpdateCampaignSmses(smsList);
     }
 }
        private void SendEmails(EPUser user, IEnumerable<Email> emailList)
        {
            if (emailList.Count() > 0)
            {
                EmailModule emailModule = new EmailModule(user.EmailUsername, user.EmailPassword);
                foreach (var email in emailList)
                {
                    bool emailSuccess = emailModule.SendEmail(user.Name, email.ToAddress, "", "", email.Subject, email.Body);
                    email.StatusId = emailSuccess ? (int)MessageStatus.Send : (int)MessageStatus.Failed;
                    email.StatusDate = DateTime.Now;
                    emailCount += 1;
                }
                campaignService.UpdateCampaignEmails(emailList);

            }
        }