Exemplo n.º 1
0
 public ChatMessage(User user, string message)
 {
     this.OwnerUserId = user.UserId;
     this.OwnerUserName = user.UserName;
     this.MessageDateTime = DateTime.Now;
     this.Message = message;
 }
Exemplo n.º 2
0
        public static void AddNewRegisteredUser(RegisterModel registerModel)
        {
            using (UowData db = new UowData())
            {
                User newUser = new User(registerModel);

                db.Users.Add(newUser);
                db.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public static void AddChatMessage(User user, string message)
        {
            using (UowData db = new UowData())
            {
                ChatMessage newChatMessage = new ChatMessage(user, message);

                db.ChatMessages.Add(newChatMessage);

                db.SaveChanges();
            }
        }
Exemplo n.º 4
0
 public FriendshipRequest(User fromUser, User toUser)
 {
     this.FromUserUserId = fromUser.UserId;
     this.FromUserUserName = fromUser.UserName;
     this.ToUserUserId = toUser.UserId;
     this.ToUserUserName = toUser.UserName;
     this.IsApproved = false;
     this.Since = DateTime.Now;
     this.Till = null;
     this.CanceledFromUserUserId = null;
     this.CanceledFromUserUserName = null;
     this.IsActive = true;
 }
Exemplo n.º 5
0
 public FaceState(Face face, User user)
 {
     this.FaceId = face.FaceId;
     this.Face = face;
     this.OwnerUserId = user.UserId;
     this.OwnerUserName = user.UserName;
     this.Owner = user;
     this.RentDateTime = DateTime.Now;
     this.LeaveDateTime = null;
     this.LeisureActivity = false;
     this.WorkActivity = false;
     this.TradeActivity = false;
     this.StorageActivity = false;
     this.GardeningActivity = false;
     this.AccessActivity = false;
     this.SportsActivity = false;
     this.IsActive = true;
     this.State = 0;
     this.Type = 0;
     this.Purpose = null;
 }
Exemplo n.º 6
0
 public UserViewModel(User user)
 {
     this.UserId = user.UserId;
     this.UserName = user.UserName;
     this.FirstName = user.FirstName;
     this.LastName = user.LastName;
     this.Email = user.Email;
 }