Esempio n. 1
0
 public ActionLogW(ActionLog log, User user)
 {
     this.Id = log.Id;
     this.UserId = log.User.Id;
     this.TableName = log.TableName;
     this.FullTableName = log.FullTableName;
     this.On = log.On;
     this.ActionTypeId = log.ActionTypeId;
     this.TableNameBg = log.TableNameBg;
     this.UserName = user.Username;
 }
Esempio n. 2
0
 public UserW(User user)
     : this()
 {
     this.Id = user.Id;
     this.Username = user.Username;
     this.Password = user.Password;
     this.FirstName = user.FirstName;
     this.MiddleName = user.MiddleName;
     this.LastName = user.LastName;
     this.Position = user.Position;
     this.RoleId = user.RoleId;
     this.Role = user.Role;
 }
        public Guid GetId()
        {
            User user = new User();
            var context = DbContextFactory.GetDbContext();
            user = context.Users.FirstOrDefault(u => u.Username == Identity.Name);

            if (user == null)
            {
                return Guid.Empty;
            }

            return user.Id;
        }
        public User GetUserData()
        {
            User user = new User();
            var context = DbContextFactory.GetDbContext();
            user = context.Users.FirstOrDefault(u => u.Username == Identity.Name);

            if (user == null)
            {
                user = new User();
                user.FirstName = "Unknown";
            }

            return user;
        }
Esempio n. 5
0
        public User ToBase()
        {
            User user = new User();

            user.Id = this.Id;
            user.Username = this.Username;
            user.Password = this.Password;
            user.FirstName = this.FirstName;
            user.MiddleName = this.MiddleName;
            user.LastName = this.LastName;
            user.Position = this.Position;
            user.RoleId = this.RoleId;
            user.Role = this.Role;

            return user;
        }