Example #1
0
        public XDocument CreateFileDataXML()
        {
            XDocument xDoc = new XDocument(
                new XDeclaration("1.0", "utf-8", "yes"),
                new XElement("TTNQHBNHN", new XAttribute("id", Patient_ID.ToString()), new XAttribute("code", Patient_Code),
                             new XElement("BasicInfor",
                                          new XElement("fullName", FullName),
                                          new XElement("dateOfBirth", DateOfBirth.ToString()),
                                          new XElement("phoneNumber", PhoneNo),
                                          new XElement("email", Email),
                                          new XElement("nationalInfor", new XAttribute("nationID", NationID), new XAttribute("classID", ClassID), new XAttribute("provinceCode", ProvinceCode), new XAttribute("districtCode", DistrictCode)),
                                          new XElement("CMNDInfor", new XAttribute("noCMND", CMND_No), new XAttribute("dateOfId", CMND_DateOfID.ToString()), new XAttribute("address", CMND_Address), new XAttribute("addressOfId", CMND_AddressOfID)),
                                          new XElement("status", Status))));

            return(xDoc);
        }
        public XDocument CreateFileDataXML()
        {
            XDocument xDoc = new XDocument(
                new XDeclaration("1.0", "utf-8", "yes"),
                new XElement("TTBNHT", new XAttribute("id", Patient_ID.ToString()), new XAttribute("code", Patient_Code),
                             new XElement("BasicInfor",
                                          new XElement("fullName", FullName),
                                          new XElement("dateOfBirth", DateOfBirth.ToString()),
                                          new XElement("phoneNumber", PhoneNo),
                                          new XElement("email", Email),
                                          new XElement("levelId", LevelID),
                                          new XElement("job", Job),
                                          new XElement("nationalInfor", new XAttribute("nationID", NationID), new XAttribute("classID", ClassID), new XAttribute("provinceCode", ProvinceCode), new XAttribute("districtCode", DistrictCode)),
                                          new XElement("CMNDInfor", new XAttribute("noCMND", CMND_No), new XAttribute("dateOfId", CMND_DateOfID.ToString()), new XAttribute("address", CMND_Address), new XAttribute("addressOfId", CMND_AddressOfID)),
                                          new XElement("marriageInformation", new XAttribute("isMarried", IsMarried), new XAttribute("hasChild", HasChild), new XAttribute("numberOfChild", NoOfChild), new XAttribute("yearOfChildLast", YearOfChildLast), new XAttribute("dayOfHaveBaby", DayOfHaveBaby)),
                                          new XElement("HeathStatus", new XAttribute("heathStatus", HeathStatus), new XAttribute("historyOfPatient", HistoryOfPatient), new XAttribute("historyOfFamily", HistoryOfFamily)),
                                          new XElement("FP",
                                                       new XElement("FPRightThumb", FPRightThumb),
                                                       new XElement("FPLeftThumb", FPLeftThumb),
                                                       new XElement("FPRightIndex", FPRightIndex),
                                                       new XElement("FPLeftIndex", FPLeftIndex)),
                                          new XElement("WifeInfors", new XAttribute("wifeName", WifeName), new XAttribute("wIdentify", WIdentify), new XAttribute("wDateOfId", WDateOfID), new XAttribute("wAddress", WAddress), new XAttribute("wPhone", WPhone), new XAttribute("wEmail", WEmail)),
                                          new XElement("createdDate", CreatedDate.ToString()))));

            return(xDoc);
        }