Public Member Functions | |
Person (string userName, string fullName, DateTime birthDay, Gender gender, double height, double weight, double activityFactor) | |
Create a new person. | |
IEnumerable< FoodItem > | GetConsumedFoodItems () |
Get all FoodItems consumed by this person. | |
IEnumerable< FoodItem > | GetConsumedFoodItems (DateTime start, DateTime end) |
Get all FoodItems consumed by this person between start and end. | |
IEnumerable< Exercise > | GetPerformedExercises () |
void | Save () |
Save this object to database. | |
void | Delete () |
Delete this person from the database. | |
Static Public Member Functions | |
static IEnumerable< Person > | ListUsers () |
List all persons. | |
Properties | |
internal long | Id [get] |
Gets the primary key of the underlying row, 0 if not saved. | |
string | UserName [get, set] |
Gets the username of this Person. | |
string | FullName [get, set] |
Gets/sets the fullname of this person. | |
DateTime | BirthDate [get, set] |
Gets/sets the birthdate of this person. | |
Gender | Gender [get, set] |
Gets/sets the gender of this person. | |
double | Weight [get, set] |
Gets/sets the weight of this person. | |
double | Height [get, set] |
Gets/sets the height of this person. | |
Diet | Diet [get, set] |
Gets/sets the diet of this person. | |
double | ActivityFactor [get, set] |
Activity factor for a person's BMR. | |
int | Age [get] |
Gets the age of the person in years. | |
int | BMR [get] |
Gets the Basal Metabolic Rate of the Person using the Mifflin St. Jeor BMR formula. | |
int | METS [get] |
Private Member Functions | |
Person (User user) | |
Create Person from underlying row. | |
Static Private Member Functions | |
static void | LoadCache () |
Cache all persons. | |
static internal Person | GetById (long userId) |
Get a person by primary key of the underlying row. | |
Private Attributes | |
User | row |
The underlying row. | |
bool | modified = true |
True, if this object have been modified with respect to the database. | |
Diet | diet = null |
Lazily loaded diet cache. | |
Static Private Attributes | |
static Dictionary< long, Person > | cachedPersons = null |
Cached persons. |
Definition at line 8 of file Person.cs.
Foodolini.BusinessLogic.Person.Person | ( | User | user | ) | [private] |
Foodolini.BusinessLogic.Person.Person | ( | string | userName, | |
string | fullName, | |||
DateTime | birthDay, | |||
Gender | gender, | |||
double | height, | |||
double | weight, | |||
double | activityFactor | |||
) |
void Foodolini.BusinessLogic.Person.Delete | ( | ) |
static internal Person Foodolini.BusinessLogic.Person.GetById | ( | long | userId | ) | [static, private] |
IEnumerable<FoodItem> Foodolini.BusinessLogic.Person.GetConsumedFoodItems | ( | DateTime | start, | |
DateTime | end | |||
) |
Get all FoodItems consumed by this person between start and end.
start | Look for FoodItems consumed after this DateTime | |
end | Look for FoodItems consumed before this DateTime |
IEnumerable<FoodItem> Foodolini.BusinessLogic.Person.GetConsumedFoodItems | ( | ) |
IEnumerable<Exercise> Foodolini.BusinessLogic.Person.GetPerformedExercises | ( | ) |
static IEnumerable<Person> Foodolini.BusinessLogic.Person.ListUsers | ( | ) | [static] |
static void Foodolini.BusinessLogic.Person.LoadCache | ( | ) | [static, private] |
void Foodolini.BusinessLogic.Person.Save | ( | ) |
Dictionary<long, Person> Foodolini.BusinessLogic.Person.cachedPersons = null [static, private] |
Diet Foodolini.BusinessLogic.Person.diet = null [private] |
bool Foodolini.BusinessLogic.Person.modified = true [private] |
User Foodolini.BusinessLogic.Person.row [private] |
double Foodolini.BusinessLogic.Person.ActivityFactor [get, set] |
Activity factor for a person's BMR.
Activity factor | Activity level |
---|---|
1.2 | Little or no exercise. Sedentary |
1.375 | Light exercise/sports 1-3 days/week. Light |
1.55 | Moderate exercise/sport 3-5 days/week. Moderate |
1.725 | Hard exercise/sport 6-7 days/week. Hard |
1.9 | Very hard exercise/sport & physical job or 2x training) Extra |
int Foodolini.BusinessLogic.Person.Age [get] |
DateTime Foodolini.BusinessLogic.Person.BirthDate [get, set] |
int Foodolini.BusinessLogic.Person.BMR [get] |
Diet Foodolini.BusinessLogic.Person.Diet [get, set] |
string Foodolini.BusinessLogic.Person.FullName [get, set] |
Gender Foodolini.BusinessLogic.Person.Gender [get, set] |
double Foodolini.BusinessLogic.Person.Height [get, set] |
internal long Foodolini.BusinessLogic.Person.Id [get, private] |
int Foodolini.BusinessLogic.Person.METS [get] |
string Foodolini.BusinessLogic.Person.UserName [get, set] |
double Foodolini.BusinessLogic.Person.Weight [get, set] |