public ChatMessage(User user, string message) { this.OwnerUserId = user.UserId; this.OwnerUserName = user.UserName; this.MessageDateTime = DateTime.Now; this.Message = message; }
public static void AddNewRegisteredUser(RegisterModel registerModel) { using (UowData db = new UowData()) { User newUser = new User(registerModel); db.Users.Add(newUser); db.SaveChanges(); } }
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(); } }
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; }
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; }
public UserViewModel(User user) { this.UserId = user.UserId; this.UserName = user.UserName; this.FirstName = user.FirstName; this.LastName = user.LastName; this.Email = user.Email; }