public MainWindow() { DB = new CDatabase(forumEntities); InitializeComponent(); this.IsEnabled = false; TryLogin tryLogWindow = new TryLogin(stateLog, UserLogined, DB); tryLogWindow.ShowDialog(); //logged? if (stateLog.StateLog == false) //no { this.Close(); return; } else { this.IsEnabled = true; //yes } UserLogined = DB.GetUserInfo(UserLogined.UserName); var mesin = from q in forumEntities.Topic where q.TopicName == UserLogined.UserLoweredName + "privatetopicin" select q.TopicID; CurUserTopicMesIN = mesin.First(); var mesout = from q in forumEntities.Topic where q.TopicName == UserLogined.UserLoweredName + "privatetopicout" select q.TopicID; CurUserTopicMesOUT = mesout.First(); FillShowForumTab(); }
public TryLogin(CLoginState state, Users UserTryLogin, CDatabase db ) { DB = db; User = UserTryLogin; stateLog = state; InitializeComponent(); loginTextBox.Focus(); }
public ShowPosts(Users user, ForumV2Entities f) { forumEntities = f; curUser = user; InitializeComponent(); this.Title = "Messages: " + user.UserName; int privForumID = (from q in forumEntities.Forum where q.ForumName == "usersprivateforum" select q.ForumID).First(); var posts = from q in forumEntities.Post where q.UserId == curUser.UserId && q.ForumID != privForumID select q; ObservableCollection<Post> col = new ObservableCollection<Post>(posts); dataGrid1.ItemsSource = col; }
public ShowUserProfile(Users LogUser,Users selectUser, ForumV2Entities forum, CDatabase db) { LoginedUser = LogUser; curUser = selectUser; forumEntities = forum; DB = db; InitializeComponent(); foreach (Roles r in forumEntities.Roles) { switch (r.RoleName) { case "Admin": RoleAdminID = r.RoleId; break; case "Moderator": RoleModerID = r.RoleId; break; case "LockedUser": RoleBannedID = r.RoleId; break; } } FillProfile(); }
public BanParameters(Users userforban) { UserForBan = userforban; InitializeComponent(); }
/// <summary> /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUsers(Users users) { base.AddObject("Users", users); }
/// <summary> /// Create a new Users object. /// </summary> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="userName">Initial value of the UserName property.</param> /// <param name="userLoweredName">Initial value of the UserLoweredName property.</param> /// <param name="password">Initial value of the Password property.</param> /// <param name="createdDate">Initial value of the CreatedDate property.</param> /// <param name="lockedDateOut">Initial value of the LockedDateOut property.</param> /// <param name="isLocked">Initial value of the IsLocked property.</param> /// <param name="lastActivityDate">Initial value of the LastActivityDate property.</param> /// <param name="email">Initial value of the Email property.</param> /// <param name="loweredEmail">Initial value of the LoweredEmail property.</param> /// <param name="isActivated">Initial value of the IsActivated property.</param> /// <param name="lastLoginDate">Initial value of the LastLoginDate property.</param> public static Users CreateUsers(global::System.Guid userId, global::System.String userName, global::System.String userLoweredName, global::System.String password, global::System.DateTime createdDate, global::System.DateTime lockedDateOut, global::System.Boolean isLocked, global::System.DateTime lastActivityDate, global::System.String email, global::System.String loweredEmail, global::System.Boolean isActivated, global::System.DateTime lastLoginDate) { Users users = new Users(); users.UserId = userId; users.UserName = userName; users.UserLoweredName = userLoweredName; users.Password = password; users.CreatedDate = createdDate; users.LockedDateOut = lockedDateOut; users.IsLocked = isLocked; users.LastActivityDate = lastActivityDate; users.Email = email; users.LoweredEmail = loweredEmail; users.IsActivated = isActivated; users.LastLoginDate = lastLoginDate; return users; }
public ChangePassword(Users UserTryChPass, CDatabase db) { User = UserTryChPass; db = DB; InitializeComponent(); }