public void InitView(UserSelectionType loadMode, Boolean fromAllMyCommunity, Int32 idCommunity, List <Int32> unloadIdUsers, List <Int32> selectedIdUsers) { List <Int32> idCommunities = new List <Int32>() { idCommunity }; InitView(loadMode, fromAllMyCommunity, idCommunities, unloadIdUsers, selectedIdUsers); }
public void InitView(UserSelectionType loadMode, Boolean fromAllMyCommunity, List <Int32> idCommunities, List <Int32> unloadIdUsers, List <Int32> selectedIdUsers) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(); } else { if (unloadIdUsers == null) { unloadIdUsers = new List <Int32>(); } if (selectedIdUsers == null) { selectedIdUsers = new List <Int32>(); } View.isInitialized = true; View.FromAllMyCommunity = fromAllMyCommunity; View.FromCommunities = (fromAllMyCommunity) ? new List <Int32>() : idCommunities; View.UnavailableIdUsers = unloadIdUsers; View.SelectAllUsers = false; View.SelectedIdUsers = (selectedIdUsers == null) ? new List <int>() : selectedIdUsers.Where(s => !unloadIdUsers.Contains(s)).ToList(); View.IsFirstLoad = true; View.IsFirstPreviewLoad = true; switch (loadMode) { case UserSelectionType.SystemUsers: ModuleProfileManagement module = ModuleProfileManagement.CreatePortalmodule(UserContext.UserTypeID); InitializeProfileFilters(module); break; case UserSelectionType.CommunityUsers: if (idCommunities.Any()) { if (idCommunities.Count == 1) { ModuleCommunityManagement cModule = ServiceCommunity.GetModulePermission(UserContext.CurrentUserID, idCommunities[0]); InitializeCommunityFilters(cModule, idCommunities[0], unloadIdUsers); } } break; } } }
private Boolean HasEmployeeUsers(UserSelectionType mode) { switch (mode) { case UserSelectionType.CommunityUsers: dtoUserFilters filter = (dtoUserFilters)View.GetCurrentUserFilters.Clone(); filter.IdProfileType = (int)UserTypeStandard.Employee; filter.IdRole = -1; filter.IdAgency = -1; return((int)Service.CommunitySubscriptionsCount(filter, View.UnavailableIdUsers) > 0); case UserSelectionType.SystemUsers: dtoFilters pFilter = (dtoFilters)View.GetCurrentProfileFilters.Clone(); pFilter.IdProfileType = (int)UserTypeStandard.Employee; pFilter.IdAgency = -1; return(Service.ProfilesCount(pFilter, View.UnavailableIdUsers) > 0); default: return(false); } }
public void InitView(UserSelectionType loadMode, Boolean fromAllMyCommunity, List <Int32> unloadIdUsers, List <Int32> selectedIdUsers) { InitView(loadMode, fromAllMyCommunity, new List <Int32>(), unloadIdUsers, selectedIdUsers); }
public void UserSelectionUpdate(string fromUserID, string toUserID, UserSelectionType selectionType) { using (DBAccess dbaccess = new DBAccess()) { SqlParameter parameter1 = new SqlParameter(); parameter1.ParameterName = "@FromUserID"; parameter1.Value = fromUserID; parameter1.SqlDbType = SqlDbType.Int; SqlParameter parameter2 = new SqlParameter(); parameter2.ParameterName = "@ToUserID"; parameter2.Value = toUserID; parameter2.SqlDbType = SqlDbType.Int; SqlParameter parameter3 = new SqlParameter(); parameter3.ParameterName = "@StatusId"; parameter3.Value = selectionType; parameter3.SqlDbType = SqlDbType.SmallInt; SqlParameter[] parameters = new SqlParameter[3] { parameter1, parameter2, parameter3 }; SqlDataReader reader = dbaccess.ExecuteProcedure("UserSelectionUpdate", this.connectionString, parameters); } }
public void UserSelectionUpdate(string fromUserID, string toUserID, UserSelectionType selectionType) { throw new NotImplementedException(); }
public void UserSelectionGet(string userID, UserSelectionType userSelectionType, Converter converter, object dataObject) { using (DBAccess dbaccess = new DBAccess()) { SqlParameter parameter1 = new SqlParameter(); parameter1.ParameterName = "@UserId"; parameter1.Value = userID; parameter1.SqlDbType = SqlDbType.Int; SqlParameter parameter2 = new SqlParameter(); parameter2.ParameterName = "@TypeId"; parameter2.Value = userSelectionType; parameter2.SqlDbType = SqlDbType.Int; SqlParameter[] parameters = new SqlParameter[2] { parameter1, parameter2 }; SqlDataReader reader = dbaccess.ExecuteProcedure("UserSelectionGet", this.connectionString, parameters); while (reader.Read()) { converter(reader, dataObject); } } }
public void UserSelectionGet(string userID, UserSelectionType userSelectionType, Converter converter, object dataObject) { throw new NotImplementedException(); }
private void MergeUserInfos(string userID, Hashtable userhsh, List<SelectedUser> usertypes, UserSelectionType userSelectionType) { this.userResource.UserSelectionGet(userID, userSelectionType, this.UserSelectionConverter, usertypes); if (userSelectionType == UserSelectionType.MY) { if (usertypes != null && usertypes.Count > 0) { usertypes.ForEach(x => { if (userhsh.Contains(x.UserId)) ((UserInfo)userhsh[x.UserId]).InterestType = ConvertSelectionTypeToScanType((UserSelectionType)Enum.Parse(typeof(UserSelectionType), x.StatusId.ToString()), ((UserInfo)userhsh[x.UserId]).InterestType, userSelectionType); } ); } } else if (userSelectionType == UserSelectionType.OTHERS) { if (usertypes != null && usertypes.Count > 0) { usertypes.ForEach(x => { if (userhsh.Contains(x.UserId)) ((UserInfo)userhsh[x.UserId]).InterestType = ConvertSelectionTypeToScanType((UserSelectionType)Enum.Parse(typeof(UserSelectionType), x.StatusId.ToString()), ((UserInfo)userhsh[x.UserId]).InterestType, userSelectionType); } ); } } usertypes.Clear(); }
private UIScanType ConvertSelectionTypeToScanType(UserSelectionType selectionType, UIScanType scanType, UserSelectionType actionType) { if (actionType == UserSelectionType.MY) { if (selectionType == UserSelectionType.LIKE) return UIScanType.LIKE; else if (selectionType == UserSelectionType.DISLIKE) return UIScanType.TRASH; else return UIScanType.BROWSE; } else { if (scanType == UIScanType.BROWSE) { if (selectionType == UserSelectionType.LIKE) return UIScanType.MISS; } else if (scanType == UIScanType.LIKE) { if (selectionType == UserSelectionType.LIKE) return UIScanType.HIT; } else if (scanType == UIScanType.TRASH) { if (selectionType == UserSelectionType.LIKE) return UIScanType.MISS; } } return scanType; }
public bool UserSelectionUpdate(string fromUserID, string toUserID, UserSelectionType selectionType) { this.userResource.UserSelectionUpdate(fromUserID, toUserID, selectionType); return true; }
public UserInfo[] UserSelectionGet(string userID, UserSelectionType userSelectionType) { List<int> users = new List<int>(); this.userResource.UserSelectionGet(userID, userSelectionType, this.UserSelectionConverter, users); List<UserInfo> userinfos = VisibleProfilesGet(userID); if (userinfos != null) return userinfos.Where(x => users.Contains(x.UserID)).ToArray(); else return null; }