Esempio n. 1
0
 public ChildCard(string id, string name, string photo, ChildStatus status)
 {
     this.Status = status;
     this.Id     = id;
     this.Name   = name;
     this.Photo  = photo;
 }
Esempio n. 2
0
        // 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
                    {
                    }
                }
            }
        }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 public override void Reset(Point pos)
 {
     base.Reset(pos);
     Status = ChildStatus.Released;
 }