コード例 #1
0
 /// <summary>
 ///Copy  Constructor for mother requests
 /// </summary>
 public MotherRequest(MotherRequest mp)
 {
     Address          = mp.Address;
     SearchAddress    = mp.SearchAddress;
     DistanceWanted   = mp.DistanceWanted;
     DistanceAccepted = mp.DistanceAccepted;
     P = new Planning(mp.P.Plan);
 }
コード例 #2
0
ファイル: Mother.cs プロジェクト: RaphTaxi/NannyProject
 public Mother(Mother m)
 {
     ID           = m.ID;
     FamilyName   = m.FamilyName;
     FirstName    = m.FirstName;
     Phone        = m.Phone;
     Commentaries = m.Commentaries;
     Request      = new MotherRequest(m.Request);
 }
コード例 #3
0
ファイル: Mother.cs プロジェクト: RaphTaxi/NannyProject
        //----------------
        //  CONSTRUCTOR
        //----------------

        /// <summary>
        /// Constructor for mother class
        /// Initialize the daylist
        /// </summary>
        public Mother()
        {
            Request      = new MotherRequest();
            ID           = 0;
            FamilyName   = "";
            FirstName    = "";
            Phone        = "";
            Commentaries = "";
        }
コード例 #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="m"></param>
        /// <param name="n"></param>
        public CoupleMotherNanny(MotherRequest m, Nanny n)
        {
            //  assign the nanny
            N = n;

            bool concordance = true;

            for (int i = 0; i < 7; i++)
            {
                if (m.P.Plan[i].Selected == true &&
                    n.P.Plan[i].Selected == false)
                {
                    concordance = false;
                }

                if (m.P.Plan[i].Start <n.P.Plan[i].Start ||
                                       m.P.Plan[i].End> n.P.Plan[i].End)
                {
                    concordance = false;
                }
            }

            AbsoluteConcordance = concordance;
            TotalMinutes        = 0;

            if (!AbsoluteConcordance)
            {
                double total      = 0;
                double totalstart = 0;
                double totalend   = 0;
                for (int i = 0; i < 7; i++)
                {
                    if (m.P.Plan[i].Start < n.P.Plan[i].Start)
                    {
                        totalstart = Math.Abs((n.P.Plan[i].Start - m.P.Plan[i].Start).TotalMinutes);
                    }

                    if (m.P.Plan[i].End > n.P.Plan[i].End)
                    {
                        totalend = Math.Abs((m.P.Plan[i].End - n.P.Plan[i].End).TotalMinutes);
                    }
                    total += totalstart + totalend;
                }
                TotalMinutes = total;
            }
        }