public static UserLocation LoadLocation(UserLocationType locType, LocalUser user) { UserLocation ul = VBotDB.Instance.UserLocations.FirstOrDefault( l => l.LocalUserID == user.LocalUserID && l.UserLocationType == locType.ToString().ToLower()); if (ul != null) { ul.ParseList(ul.List); } return ul; }
public static UserLocation GetDefaultLocation(UserLocationType locType, LocalUser owner) { UserLocation ul = new UserLocation(); if (locType == VBulletinBot.UserLocationType.FORUM) { ul.PerPage = 5; ul.PageNumber = 1; ul.Title = @"INDEX"; ul.LocationRemoteID = -1; ul.List = string.Empty; ul.UserLocationType = @"forum"; ul.LocalUserID = owner.LocalUserID; } else if (locType == VBulletinBot.UserLocationType.THREAD) { ul.PerPage = 5; ul.PageNumber = 1; ul.Title = string.Empty; ul.LocationRemoteID = 0; ul.List = string.Empty; ul.UserLocationType = @"thread"; ul.LocalUserID = owner.LocalUserID; } else if (locType == VBulletinBot.UserLocationType.POST) { ul.PerPage = 5; ul.PageNumber = 1; ul.Title = string.Empty; ul.LocationRemoteID = 0; ul.List = string.Empty; ul.UserLocationType = @"post"; ul.LocalUserID = owner.LocalUserID; } return ul; }