Ejemplo n.º 1
0
        public static XElement ToXML(this Nanny N)
        {//converts nanny to xelement
            switchTo B   = new switchTo();
            XElement res = new XElement("Nanny",
                                        new XElement("id", N.NannyId),
                                        new XElement("FirstName", N.NannyFirstName),
                                        new XElement("LastName", N.NannyLastName),
                                        new XElement("PhoneNumber", N.NannyPhoneNumber),
                                        new XElement("Address", N.NannyAddress),
                                        new XElement("DateOfBirth", N.NannyDateOfBirth),
                                        new XElement("Floor", N.NannyFloor),
                                        new XElement("Elevator", N.NannyHaveElevator),
                                        new XElement("MaxAgeOfKid", N.NannyMaxAgeOfKid_InMonth),
                                        new XElement("MaxNumberOfKids", N.NannyMaxNumberOfKids),
                                        new XElement("MinAgeOfKid", N.NannyMinAgeOfKid_InMonth),
                                        new XElement("Experience", N.NannyNumberOfExperience),
                                        new XElement("PaymentPerHour", N.NannyPaymentPerHour),
                                        new XElement("AllowsPaymentByHour", N.NannyAllowsPaymentByHour),
                                        new XElement("PaymentPermonth", N.NannyPaymentPermonth),
                                        new XElement("Vaction", N.NannyVactionByMEducation),
                                        new XElement("StartTime", B.whichDoubleTimeToString(N.NannyIsWorkingOnDay, N.NannyTimeIsWorkingOnDay, 0)),
                                        new XElement("EndTime", B.whichDoubleTimeToString(N.NannyIsWorkingOnDay, N.NannyTimeIsWorkingOnDay, 1)),
                                        new XElement("Days", B.whichBoolTimeToString(N.NannyIsWorkingOnDay)),
                                        new XElement("Recommendations", (from item in N.NannyRecommendations
                                                                         select new XElement("Recommendations", item))));



            return(res);
        }
Ejemplo n.º 2
0
        public static XElement ToXML(this Child C)
        {//converts child to xelement
            switchTo B   = new switchTo();
            XElement res = new XElement("Child",
                                        new XElement("id", C.ChildId),
                                        new XElement("MotherID", C.ChildMotherId),
                                        new XElement("ChildName", C.ChildFirstName),
                                        new XElement("ChildDateOfBirth", C.ChildDateOfBirth),
                                        new XElement("ChildSpecialNeeds", C.ChildWithSpecialNeeds),
                                        new XElement("SpecialNeeds", (from need in C.ChildsSpecialNeedsList
                                                                      select new XElement("need", need))));

            return(res);
        }
Ejemplo n.º 3
0
        public static XElement ToXML(this Mother M)
        {//converts mother to xelement
            switchTo B   = new switchTo();
            XElement res = new XElement("Mother",
                                        new XElement("id", M.MotherId),
                                        new XElement("FirstName", M.MotherFirstName),
                                        new XElement("LastName", M.MotherLastName),
                                        new XElement("PhoneNumber", M.MotherPhoneNumber),
                                        new XElement("Address", M.MotherAddress),
                                        new XElement("Area", M.MotherNannyInArea),
                                        new XElement("Notes", M.MotherNotes),
                                        new XElement("StartTime", B.whichDoubleTimeToString(M.MotherNeedsNanny, M.MotherTimeNeedsNanny, 0)),
                                        new XElement("EndTime", B.whichDoubleTimeToString(M.MotherNeedsNanny, M.MotherTimeNeedsNanny, 1)),
                                        new XElement("Days", B.whichBoolTimeToString(M.MotherNeedsNanny)));

            return(res);
        }
Ejemplo n.º 4
0
        public static XElement ToXML(this Contract C)
        {//converts contract to xelement
            switchTo B   = new switchTo();
            XElement res = new XElement("Contract",
                                        new XElement("Motherid", C.MotherId),
                                        new XElement("Nannyid", C.NannyId),
                                        new XElement("Childid", C.ChildId),
                                        new XElement("NumberOfContract", C.NumberOfContract),
                                        new XElement("Distance", C.Distance),
                                        new XElement("HaveTheyMet", C.HaveTheyMet),
                                        new XElement("IsPymentPerHour", C.IsPymentPerHour),
                                        new XElement("PaymentPerHour", C.PaymentPerHour),
                                        new XElement("PaymentPermonth", C.PaymentPermonth),
                                        new XElement("StartOfemployment", C.StartOfemploymentDate),
                                        new XElement("EndOfemployment", C.EndOfemploymentDate),
                                        new XElement("signed", C.HaveTheysignedContract),
                                        new XElement("WorkTime", B.whichDoubleTimeToString(C.TimeNannyWorkingWeek)));

            return(res);
        }