Example #1
0
 public void UpdateRemeberUserName(Domain.Models.UserInfo userInfo, string email)
 {
     using (var db = new SortingDbContext())
     {
         var user = db.UserInfo.FirstOrDefault(o => o.UserId == userInfo.UserId);
         if (user == null)
         {
             db.UserInfo.Add(new Domain.Models.UserInfo
             {
                 IsRemeberUserName = true,
                 LastLoginTime     = DateTime.Now,
                 Pcid     = userInfo.Pcid,
                 PcName   = userInfo.PcName,
                 UserId   = userInfo.UserId,
                 UserName = userInfo.UserName,
                 Email    = email
             });
             db.SaveChangesAsync();
         }
         else
         {
             user.LastLoginTime     = DateTime.Now;
             user.IsRemeberUserName = true;
             db.UserInfo.AddOrUpdate(user);
             db.SaveChanges();
         }
     }
 }
Example #2
0
 public PcUpDownService(SlaveInfoService slaveInfoService, ButtonService buttonService, SynchronizationContext current, SysConfig SysConfig, Domain.Models.UserInfo UserInfo)
 {
     this.SlaveInfoService = slaveInfoService;
     this.ButtonService    = buttonService;
     this.SysConfig        = SysConfig;
     this.current          = current;
     this.UserInfo         = UserInfo;
 }
Example #3
0
 public void Delete(Domain.Models.UserInfo curUser)
 {
     using (var db = new SortingDbContext())
     {
         var user = db.UserInfo.FirstOrDefault(o => o.UserId == curUser.UserId);
         db.UserInfo.Remove(user);
         db.SaveChanges();
     }
 }
Example #4
0
 public UpDownService(SysConfig sysConfig, SlaveInfoService slaveInfoService, Domain.Models.UserInfo curUser)
 {
     this.slaveInfoService = slaveInfoService;
     this.curUser          = curUser;
     this.sysConfig        = sysConfig;
 }