public ChildCard(string id, string name, string photo, ChildStatus status) { this.Status = status; this.Id = id; this.Name = name; this.Photo = photo; }
// SET FUNCTIONS // Sets the Status (Home, Sleeping, Normal) of the child public void SetChildStatus(string ChildId, ChildStatus status) { foreach (Child c in children) { if (c.Id == ChildId) { ChildStatus realStatus = status; if (status == ChildStatus.Sleeping && c.Status == ChildStatus.Sleeping) { realStatus = ChildStatus.Normal; } if (status == ChildStatus.Sleeping && c.Status == ChildStatus.Home) { return; } //Send to database DiaryToddlerStatus try { DiaryToddlerStatus dts = getDiaryToddlerStatus(c.Toddler); dts.Status = (int)realStatus; db.SaveChanges(); children.First(ch => ch.Id == ChildId).Status = realStatus; } catch { } } } }
public Child(Toddler toddler, ICollection <Parent> parents, ChildStatus status) { this.Status = status; this.Toddler = toddler; this.Id = toddler.ToddlerId.ToString(); this.Name = toddler.Person.FirstName; this.Photo = toddler.Person.Photo; this.Parents = parents; }
public override void Reset(Point pos) { base.Reset(pos); Status = ChildStatus.Released; }