public static bool InitPortal(out string msg) { try { //AutomaticMigrator.Update(out msg); var user = PortalUser.GetUser("useradmin"); if (user == null) { msg = ""; return(false); } msg = ""; return(user.IsApproved); } catch (Exception ex) { BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); msg = ex.Message; return(false); } }
public static UserProfileInfo GetUserProfile(long userId, out string msg) { try { var user = PortalUser.GetUser(userId); if (user == null || user.UserId < 1) { msg = "User information not found!"; return(null); } msg = ""; var myProfileDetail = new UserProfileInfo { BBPin = "", DateOfBirth = "", FirstName = user.FirstName, FaceBookId = "", Email = user.Email, GooglePlusId = "", LandPhone = "", LastName = user.Surname, MaritalStatus = MaritalStatus.None, MobileNo = user.MobileNumber, ResidentialAddress = "", TwitterId = "", SexId = user.SexId, UserId = userId, }; return(myProfileDetail); } catch (Exception ex) { msg = "Error: " + ex.Message; BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); return(null); } }