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;
 }
Exemple #3
0
 public bool UpdateUserPassword(string username, string password)
 {
     MainUnitOfWork unitOfWork = new MainUnitOfWork();
     var user = unitOfWork.Session.QueryOver<EPUser>().Where(p => p.Username == username).SingleOrDefault();
     user.Password = password;
     unitOfWork.Begin();
     unitOfWork.Session.Update(user);
     unitOfWork.Commit();
     return true;
 }
Exemple #4
0
 public bool FinishJob(int jobId, int emailCount, int smsCount)
 {
     var unitOfWork = new MainUnitOfWork();
     unitOfWork.Begin();
     Job job = unitOfWork.Session.Get<Job>(jobId);
     job.EndDate = DateTime.Now;
     job.EmailSent = emailCount;
     job.SmsSent = smsCount;
     job.StatusId = (int)JobStatus.JobCompleted;
     unitOfWork.Session.Update(job);
     unitOfWork.Commit();
     return true;
 }
Exemple #5
0
 public int AddJob(int emailBatchSize, int smsBatchSize)
 {
     var unitOfWork = new MainUnitOfWork();
     unitOfWork.Begin();
     Job job = new Job
     {
         Name = "JOB" + DateTime.Now.Ticks,
         StartDate = DateTime.Now,
         EmailBatch = emailBatchSize,
         SmsBatch = smsBatchSize,
         StatusId = (int)JobStatus.JobStarted
     };
     var id =  (int)unitOfWork.Session.Save(job);
     unitOfWork.Commit();
     return id;
 }