Exemplo n.º 1
0
        public UserModel GetUser(int userId)
        {
            UserModel model = new UserModel();

            User user = session.Load<User>(userId);
            return model.FilledBy(user);
        }
Exemplo n.º 2
0
 public static void FilledBy(this IList<UserModel> model, IList<User> users)
 {
     foreach (User user in users)
     {
         UserModel item = new UserModel();
         item.FilledBy(user);
         model.Add(item);
     }
 }
Exemplo n.º 3
0
        public static void FilledBy(this AuthorizationModel model, Authorization authorization)
        {
            model.Id = authorization.Id;
            model.CanAdmin = authorization.IsAdmin;
            model.CanOwn = authorization.IsOwner;
            model.CanPublish = authorization.IsPublisher;

            UserModel user = new UserModel();
            user.FilledBy(authorization.User);
            model.User = user;
        }
        public static TaskHistoryItemModel FilledBy(this TaskHistoryItemModel model, HistoryItem item)
        {
            model.CreateTime = item.CreateTime;

            UserModel executor = new UserModel();
            executor.FilledBy(item.Executor);
            model.Executor = executor;
            model.Comment = item.Comment;
            model.Description = item.Description;

            return model;
        }