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(); } } }
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; }
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(); } }
public UpDownService(SysConfig sysConfig, SlaveInfoService slaveInfoService, Domain.Models.UserInfo curUser) { this.slaveInfoService = slaveInfoService; this.curUser = curUser; this.sysConfig = sysConfig; }