public WorkingSetSharingWindow(List<WorkingSet> allWorkingSets,List<User> allUsers,User currentUser) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); this.allWorkingSets = allWorkingSets; this.allUsers = allUsers; this.currentUser = currentUser; // initialize content this.initializeWorkingSets(); this.initializeUserList(); // align filters this.alignUserFilters(); this.alignWorkingSetFilters(); //check if we have a current user if (this.currentUser == null) { this.meUserButton.Enabled = false; this.MyWorkingSetsButton.Enabled = false; } //enable sorting this.WorkingSetsList.ListViewItemSorter = new ListViewColumnSorter(); this.userList.ListViewItemSorter = new ListViewColumnSorter(); }
public WorkingSet(EAWrappers.Model model,string ID,User user, string name) { this.model = model; this.ID = ID; this.user = user; this.name = name; }
/// <summary> /// copy the workingset tot the given user /// </summary> /// <param name="user">the user to copy the working set to</param> /// <param name="overwrite">if true then the first workingset found with the same name /// for the given user will be overwritten</param> public void copyToUser(User user, bool overwrite) { if (overwrite) { //check if a workingset with the same name already exists WorkingSet workingSetToOverwrite = this.model.workingSets.Find(w => w.user != null && w.user.login == user.login && w.name == this.name); if (workingSetToOverwrite != null) { workingSetToOverwrite.delete(); } } string insertQuery = @"insert into t_document (DocID,DocName, Notes, Style,ElementID, ElementType,StrContent,BinContent,DocType,Author,DocDate ) select '"+Guid.NewGuid().ToString("B")+@"',d.DocName, d.Notes, d.Style, d.ElementID, d.ElementType,d.StrContent,d.BinContent,d.DocType,'" + user.fullName + @"',d.DocDate from t_document d where d.DocID like '"+this.ID+"'"; this.model.executeSQL(insertQuery); }
private void refresh() { if (this.allWorkingSets.Count > 1) { UTF_EA.Model model = this.allWorkingSets[0].model; this.allWorkingSets = model.workingSets; this.allUsers = model.users; this.currentUser = model.currentUser; this.initializeWorkingSets(); this.initializeUserList(); } }
/// <summary> /// filters the given user agains the filters set on the gui /// </summary> /// <param name="user">the user to filter</param> /// <returns>true if the user matches the filter</returns> private bool filterUser(User user) { bool pass = true; if (pass && this.userLoginFilter.TextLength > 0) pass = user.login.StartsWith(this.userLoginFilter.Text,StringComparison.InvariantCultureIgnoreCase); if (pass && this.userFirstNameFilter.TextLength > 0) pass = user.firstName.StartsWith(this.userFirstNameFilter.Text,StringComparison.InvariantCultureIgnoreCase); if (pass && this.userLastNameFilter.TextLength > 0) pass = user.lastName.StartsWith(this.userLastNameFilter.Text,StringComparison.InvariantCultureIgnoreCase); return pass; }