// Put implementations of OnBusinessObjectNameBOPropertyNameChanging() // and OnBusinessObjectNameBOPropertyNameChanged() here #endregion #region Extension Methods // Put methods to manipulate Business Objects here. Add, Update etc public UserBO Login(string username, string password) { this.Username = username; this.Password = password; var userAttemptingLogin = new UserBO(); this.SetBO(userAttemptingLogin); var validUsers = new List <UserBO>(); if (this.Context != null) { validUsers = userAttemptingLogin.ToList(this.Context.Context.GetUserLogin(username, password).ToList()); } else { IndicoEntities objContext = new IndicoEntities(); validUsers = userAttemptingLogin.ToList(objContext.GetUserLogin(username, password).ToList()); } if (validUsers.Count > 0) { var user = new UserBO(_context); user.ID = validUsers[0].ID; user.GetObject(true); userAttemptingLogin.SetBO(user); this.SetBO(userAttemptingLogin); } return(this); }
public static string GetProfilePicturePath(int UserID, ImageSize size) { UserBO objUser = new UserBO(); objUser.ID = UserID; objUser.GetObject(); return(UserBO.GetProfilePicturePath(objUser)); }