/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); RefStudentID = helper.GetString("RefStudentID"); ID = helper.GetString("@ID"); //獎懲編號 SchoolYear = K12.Data.Int.Parse(helper.GetString("SchoolYear")); //學年度 Semester = K12.Data.Int.Parse(helper.GetString("Semester")); //學期 OccurDate = K12.Data.DateTimeHelper.ParseDirect(helper.GetDateString("OccurDate")); //獎勵日期 RegisterDate = K12.Data.DateTimeHelper.Parse(helper.GetDateString("RegisterDate")); Reason = helper.GetString("Reason"); //事由 if (helper.GetElement("Detail/Discipline/Merit") != null) { MeritA = K12.Data.Int.ParseAllowNull(helper.GetString("Detail/Discipline/Merit/@A")); MeritB = K12.Data.Int.ParseAllowNull(helper.GetString("Detail/Discipline/Merit/@B")); MeritC = K12.Data.Int.ParseAllowNull(helper.GetString("Detail/Discipline/Merit/@C")); } if (helper.GetElement("Detail/Discipline/Demerit") != null) { DemeritA = K12.Data.Int.ParseAllowNull(helper.GetString("Detail/Discipline/Demerit/@A")); //大過 DemeritB = K12.Data.Int.ParseAllowNull(helper.GetString("Detail/Discipline/Demerit/@B")); //小過 DemeritC = K12.Data.Int.ParseAllowNull(helper.GetString("Detail/Discipline/Demerit/@C")); //警告 ClearDate = K12.Data.DateTimeHelper.Parse(helper.GetString("Detail/Discipline/Demerit/@ClearDate")); //銷過日期 ClearReason = helper.GetString("Detail/Discipline/Demerit/@ClearReason"); //銷過事由 Cleared = helper.GetString("Detail/Discipline/Demerit/@Cleared"); //銷過 } MeritFlag = helper.GetString("MeritFlag"); //0是懲戒,1是獎勵,2是留察 }
/// <summary> /// 從XML載入設定 /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); StudentID = data.GetAttribute("RefStudentID"); ADDate = helper.GetDateString("ADDate"); ADNumber = helper.GetString("ADNumber"); Birthdate = helper.GetDateString("Birthdate"); Comment = helper.GetString("Comment"); Gender = helper.GetString("Gender"); GradeYear = helper.GetString("GradeYear"); ID = helper.GetString("@ID"); IDNumber = helper.GetString("IDNumber"); LastADDate = helper.GetDateString("LastADDate"); LastADNumber = helper.GetString("LastADNumber"); StudentName = helper.GetString("Name"); StudentNumber = helper.GetString("StudentNumber"); UpdateCode = helper.GetString("UpdateCode"); UpdateDate = helper.GetDateString("UpdateDate"); UpdateDescription = helper.GetString("UpdateDescription"); Department = helper.GetString("Department"); SchoolYear = K12.Data.Int.ParseAllowNull(helper.GetString("SchoolYear")); Semester = K12.Data.Int.ParseAllowNull(helper.GetString("Semester")); Attributes = new AutoDictionary(data.SelectSingleNode("ContextInfo/ContextInfo") as XmlElement, false); }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper xdata = new XmlHelper(data); RefStudentID = data.GetAttribute("RefStudentID"); Permanent = xdata.GetString("Permanent"); Contact = xdata.GetString("Contact"); Cell = xdata.GetString("Cell"); int index = 0; Phone1 = Phone2 = Phone3 = string.Empty; foreach (XmlElement each in xdata.GetElements("Phones/PhoneNumber")) { switch (index) { case 0: Phone1 = each.InnerText; break; case 1: Phone2 = each.InnerText; break; case 2: Phone3 = each.InnerText; break; } index++; } }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); ID = helper.GetString("@ID"); Name = helper.GetString("ExamName"); Description = helper.GetString("Description"); DisplayOrder = K12.Data.Int.ParseAllowNull(helper.GetString("DisplayOrder")); }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { County = Area = ZipCode = string.Empty; if (data == null) return; XmlHelper xdata = new XmlHelper(data); County = xdata.GetString("@County"); Area = xdata.GetString("@Name"); ZipCode = xdata.GetString("@Code"); }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="element"></param> public void Load(XmlElement element) { XmlHelper helper = new XmlHelper(element); RefStudentID = helper.GetString("RefStudentID"); ID = helper.GetString("@ID"); SchoolYear = K12.Data.Int.Parse(helper.GetString("SchoolYear")); Semester = K12.Data.Int.Parse(helper.GetString("Semester")); TextScore = helper.GetElement("TextScore"); InitialSummary = helper.GetElement("InitialSummary"); Summary = helper.GetElement("Summary"); Diff = K12.Data.Decimal.ParseAllowNull(helper.GetString("SupervisedByDiff")); Comment = helper.GetString("SupervisedByComment"); OtherDiff = helper.GetElement("OtherDiff"); }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); ID = helper.GetString("@ID"); Name = helper.GetString("Name"); List<ProgramSubject> list = new List<ProgramSubject>(); foreach (var subject in helper.GetElements("Content/GraduationPlan/Subject")) { subject.SetAttribute("ID", ID); subject.SetAttribute("Name", Name); list.Add(new ProgramSubject(subject)); } Subjects = list; }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); RefStudentID = helper.GetString("@ID"); Domains = new Dictionary<string, GradDomainScore>(); foreach (var domainElement in helper.GetElements("GradScore/GradScore/Domain")) { GradDomainScore domainScore = new GradDomainScore(domainElement); Domains.Add(domainScore.Domain, domainScore); } decimal score; if (decimal.TryParse(helper.GetString("GradScore/GradScore/LearnDomainScore"), out score)) LearnDomainScore = score; if (decimal.TryParse(helper.GetString("GradScore/GradScore/CourseLearnScore"), out score)) CourseLearnScore = score; }
/// <summary> /// 從DataRow載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public void Load(DataRow Row) { RefStudentID = "" + Row["id"]; Name = "" + Row["contact_name"]; Nationality = "" + Row["contact_nationality"]; Relationship = "" + Row["contact_relationship"]; string OtherInfo = "" + Row["contact_other_info"]; if (!string.IsNullOrEmpty(OtherInfo)) { XmlDocument Document = new XmlDocument(); Document.LoadXml(OtherInfo); XmlHelper xdata = new XmlHelper(Document.DocumentElement); //最高學歷 EducationDegree = xdata.GetString("EducationDegree"); //公司資訊 CompanyName = xdata.GetString("Company/Name"); CompanyTitle = xdata.GetString("Company/Title"); CompanyCategory = xdata.GetString("Company/Category"); //電話資訊 CellPhone = xdata.GetString("PhoneList/Phone[@Title='手機']"); HomePhone = xdata.GetString("PhoneList/Phone[@Title='住家電話']"); CompanyPhone = xdata.GetString("PhoneList/Phone[@Title='辦公室電話']"); Hospital = xdata.GetString("Hospital"); //地址資訊 AddressZipCode = xdata.GetString("AddressList/Address/ZipCode"); AddressCounty = xdata.GetString("AddressList/Address/County"); AddressDistrict = xdata.GetString("AddressList/Address/District"); AddressArea = xdata.GetString("AddressList/Address/Area"); AddressTown = xdata.GetString("AddressList/Address/Town"); AddressDetail = xdata.GetString("AddressList/Address/Detail"); AddressLongitude = xdata.GetString("AddressList/Address/Longitude"); AddressLatitude = xdata.GetString("AddressList/Address/Latitude"); } }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="Row"></param> public void Load(DataRow Row) { RefStudentID = "" + Row["id"]; string OtherInfo = "" + Row["sibling_info"]; if (!string.IsNullOrEmpty(OtherInfo)) { SiblingItems = new List<SiblingItem>(); XmlDocument Document = new XmlDocument(); Document.LoadXml(OtherInfo); XmlHelper Elements = new XmlHelper(Document.DocumentElement); foreach (XmlElement Element in Elements.GetElements("SiblingInfo")) { SiblingItem Item = new SiblingItem(Element); SiblingItems.Add(Item); } } }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public virtual void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); ID = helper.GetString("@ID"); Name = helper.GetString("Name"); Content = helper.GetElement("Content/ScoreCalcRule"); #region 精準位數 //if (scoreCalcRule.SelectSingleNode("各項成績計算位數/學年分項成績計算位數") != null) //{ // if (int.TryParse(helper.GetText("各項成績計算位數/學年分項成績計算位數/@位數"), out tryParseint)) // decimals = tryParseint; // if (bool.TryParse(helper.GetText("各項成績計算位數/學年分項成績計算位數/@四捨五入"), out tryParsebool) && tryParsebool) // mode = RoundMode.四捨五入; // if (bool.TryParse(helper.GetText("各項成績計算位數/學年分項成績計算位數/@無條件捨去"), out tryParsebool) && tryParsebool) // mode = RoundMode.無條件捨去; // if (bool.TryParse(helper.GetText("各項成績計算位數/學年分項成績計算位數/@無條件進位"), out tryParsebool) && tryParsebool) // mode = RoundMode.無條件進位; //} #endregion }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public virtual void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); RefStudentID = helper.GetString("RefStudentID"); ID = helper.GetString("@ID"); SchoolYear = K12.Data.Int.Parse(helper.GetString("SchoolYear")); Semester = K12.Data.Int.Parse(helper.GetString("Semester")); OccurDate = DateTime.Parse(helper.GetDateString("OccurDate")); PeriodDetail = new List<AttendancePeriod>(); foreach (XmlElement each in helper.GetElements("Detail/Attendance/Period")) { each.SetAttribute("RefStudentID", helper.GetString("RefStudentID")); each.SetAttribute("ID", helper.GetString("@ID")); each.SetAttribute("SchoolYear", helper.GetString("SchoolYear")); each.SetAttribute("Semester", helper.GetString("Semester")); each.SetAttribute("OccurDate", helper.GetDateString("OccurDate")); each.SetAttribute("DayOfWeek",DayOfWeek); PeriodDetail.Add(new AttendancePeriod(each)); } }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public virtual void Load(XmlElement data) { XmlHelper xmldata = new XmlHelper(data); ID = xmldata.GetString("@ID"); Name = xmldata.GetString("TemplateName"); Description = xmldata.GetString("Description"); StartTime = xmldata.GetString("StartTime"); EndTime = xmldata.GetString("EndTime"); AllowUpload = xmldata.GetString("AllowUpload").Equals("是")?true:false; if (data.SelectSingleNode("Extension/Extension") == null) data.SelectSingleNode("Extension").AppendChild(data.OwnerDocument.CreateElement("Extension")); Extension = xmldata.GetElement("Extension/Extension"); }
public void Load(XmlElement element) { InitialElement = element; XmlHelper helper = new XmlHelper(element); ID = helper.GetString("@ID"); string strStatus = helper.GetString("Status"); if (strStatus.Equals("一般")) Status = StudentStatus.一般; else if (strStatus.Equals("畢業或離校")) Status = StudentStatus.畢業或離校; else if (strStatus.Equals("休學")) Status = StudentStatus.休學; else if (strStatus.Equals("輟學")) Status = StudentStatus.輟學; else if (strStatus.Equals("延修")) Status = StudentStatus.延修; else if (strStatus.Equals("刪除")) Status = StudentStatus.刪除; else if (strStatus.Equals("轉出")) Status = StudentStatus.轉出; else if (strStatus.Equals("退學")) Status = StudentStatus.退學; SeatNo = K12.Data.Int.ParseAllowNull(helper.GetString("SeatNo")); Name = helper.GetString("Name"); EnglishName = helper.GetString("EnglishName"); StudentNumber = helper.GetString("StudentNumber"); Gender = helper.GetString("Gender"); IDNumber = helper.GetString("IDNumber"); Birthday = K12.Data.DateTimeHelper.Parse(helper.GetString("Birthdate")); BirthPlace = helper.GetString("BirthPlace"); OverrideDepartmentID = helper.GetString("OverrideDeptID"); if (OverrideDepartmentID == "") OverrideDepartmentID = null; OverrideProgramPlanID = helper.GetString("RefGraduationPlanID"); if (OverrideProgramPlanID == "") OverrideProgramPlanID = null; OverrideScoreCalcRuleID = helper.GetString("RefScoreCalcRuleID"); if (OverrideScoreCalcRuleID == "") OverrideScoreCalcRuleID = null; RefClassID = helper.GetString("RefClassID"); Nationality = helper.GetString("Nationality"); AccountType = helper.GetString("AccountType"); SALoginName = helper.GetString("SALoginName"); mSAPassword = helper.GetString("SAPassword"); EnrollmentCategory = helper.GetString("EnrollmentCategory"); HomeSchooling = helper.GetString("HomeSchooling").ToLower().StartsWith("t") ? true : false; Comment = helper.GetString("Comment"); }
/// <summary> /// XML參數建構式 /// </summary> /// <param name="element"></param> public virtual void Load(XmlElement element) { XmlHelper helper = new XmlHelper(element); RefAssessmentSetupID = helper.GetString("ExamTemplateID"); RefExamID = helper.GetString("RefExamID"); ID = helper.GetString("@ID"); ExamName = helper.GetString("ExamName"); UseScore = (helper.GetString("UseScore") == "是") ? true : false; UseText = (helper.GetString("UseText") == "是") ? true : false; Weight = K12.Data.Int.Parse(helper.GetString("Weight")); StartTime = helper.GetString("StartTime"); EndTime = helper.GetString("EndTime"); OpenTeacherAccess = helper.GetString("OpenTeacherAccess").Equals("是")?true:false; InputRequired = helper.GetString("InputRequired").Equals("否")?true:false; if (element.SelectSingleNode("Extension/Extension") == null) element.SelectSingleNode("Extension").AppendChild(element.OwnerDocument.CreateElement("Extension")); Extension = helper.GetElement("Extension/Extension"); }
/// <summary> /// 從XML載入資料 /// <![CDATA[ /// ]]> /// </summary> /// <param name="element"></param> public virtual void Load(XmlElement element) { XmlHelper helper = new XmlHelper(element); ID = helper.GetString("@ID"); Score = K12.Data.Decimal.Parse(helper.GetString("Score")); RefSCAttendID = helper.GetString("AttendID"); RefExamID = helper.GetString("ExamID"); RefStudentID = helper.GetString("RefStudentID"); RefCourseID = helper.GetString("RefCourseID"); if (element.SelectSingleNode("Extension/Extension") == null) element.SelectSingleNode("Extension").AppendChild(element.OwnerDocument.CreateElement("Extension")); Extension = helper.GetElement("Extension/Extension"); if (Extension.SelectSingleNode("Text") == null) Extension.AppendChild(Extension.OwnerDocument.CreateElement("Text")); //Effort = K12.Data.Int.ParseAllowNull(helper.GetString("Extension/Extension/Effort")); //Text = helper.GetString("Extension/Extension/Text"); #region ResponseXml參考 //<Score ID="2285"> // <Extensions /> // <RequiredBy>校訂</RequiredBy> // <AttendScore /> // <IsRequired>選</IsRequired> // <ExamName>第二次月考</ExamName> // <AttendID>2967</AttendID> // <RefStudentID>170626</RefStudentID> // <RefCourseID>111</RefCourseID> // <Score>80</Score> // <ExamID>494</ExamID> //</Score> #endregion }
/// <summary> /// XML參數建構式 /// <![CDATA[ /// ]]> /// </summary> /// <param name="data"></param> public AddressItem(XmlElement data) { County = Town = District = Area = Detail = Longitude = Latitude = string.Empty; if (data == null) return; XmlHelper xdata = new XmlHelper(data); ZipCode = xdata.GetString("ZipCode"); County = xdata.GetString("County"); Town = xdata.GetString("Town"); District = xdata.GetString("District"); Area = xdata.GetString("Area"); Detail = xdata.GetString("DetailAddress"); Longitude = xdata.GetString("Longitude"); Latitude = xdata.GetString("Latitude"); }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="element"></param> public virtual void Load(XmlElement element) { XmlHelper helper = new XmlHelper(element); ID = helper.GetString("@ID"); RefStudentID = helper.GetString("RefStudentId"); SchoolYear = helper.GetInteger("SchoolYear", 0); Semester = helper.GetInteger("Semester", 0); GradeYear = helper.GetInteger("GradeYear", 0); LearnDomainScore = K12.Data.Decimal.ParseAllowNull(helper.GetString("ScoreInfo/LearnDomainScore")); CourseLearnScore = K12.Data.Decimal.ParseAllowNull(helper.GetString("ScoreInfo/CourseLearnScore")); Subjects = new Dictionary<string, SubjectScore>(); foreach (var subjectElement in helper.GetElements("ScoreInfo/SemesterSubjectScoreInfo/Subject")) { subjectElement.SetAttribute("ID", ID); subjectElement.SetAttribute("RefStudentID", RefStudentID); subjectElement.SetAttribute("SchoolYear", K12.Data.Int.GetString(SchoolYear)); subjectElement.SetAttribute("Semester", K12.Data.Int.GetString(Semester)); SubjectScore subjectScore = new SubjectScore(subjectElement); if (!Subjects.ContainsKey(subjectScore.Subject)) Subjects.Add(subjectScore.Subject, subjectScore); } Domains = new Dictionary<string, DomainScore>(); foreach (var domainElement in helper.GetElements("ScoreInfo/Domains/Domain")) { domainElement.SetAttribute("ID", ID); domainElement.SetAttribute("RefStudentID", RefStudentID); domainElement.SetAttribute("SchoolYear", K12.Data.Int.GetString(SchoolYear)); domainElement.SetAttribute("Semester", K12.Data.Int.GetString(Semester)); DomainScore domainScore = new DomainScore(domainElement); if (!Domains.ContainsKey(domainScore.Domain)) Domains.Add(domainScore.Domain, domainScore); } }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ ///<Discipline ID="1097220"> /// <Semester>1</Semester> /// <OccurDate>2007/12/13</OccurDate> /// <Type>1</Type> /// <StudentNumber>514163</StudentNumber> /// <SchoolYear>96</SchoolYear> /// <GradeYear>2</GradeYear> /// <MeritFlag>2</MeritFlag> /// <Name>陳文淇1</Name> /// <Detail> /// <Discipline> /// <Demerit A="0" B="0" C="0" ClearDate="" ClearReason="" Cleared="" /> /// </Discipline> /// </Detail> /// <SeatNo /> /// <Gender>女</Gender> /// <RefStudentID>169968</RefStudentID> /// <ClassName>綜二義</ClassName> /// <Reason>長太醜, 該死</Reason> ///</Discipline> /// ]]> /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper helper = new XmlHelper(data); RefStudentID = helper.GetString("RefStudentID"); ID = helper.GetString("@ID"); //ID SchoolYear = K12.Data.Int.Parse(helper.GetString("SchoolYear")); //學年度 Semester = K12.Data.Int.Parse(helper.GetString("Semester")); //學期 OccurDate = K12.Data.DateTimeHelper.ParseDirect(helper.GetDateString("OccurDate")); //懲戒日期 RegisterDate = K12.Data.DateTimeHelper.Parse(helper.GetDateString("RegisterDate")); Reason = helper.GetString("Reason"); //事由 DemeritA = K12.Data.Int.ParseAllowNull(helper.GetElement("Detail/Discipline/Demerit").Attributes["A"].Value); //大過 DemeritB = K12.Data.Int.ParseAllowNull(helper.GetElement("Detail/Discipline/Demerit").Attributes["B"].Value); //小過 DemeritC = K12.Data.Int.ParseAllowNull(helper.GetElement("Detail/Discipline/Demerit").Attributes["C"].Value); //警告 if (helper.GetElement("Detail/Discipline/Demerit").Attributes["ClearDate"] != null) ClearDate = K12.Data.DateTimeHelper.Parse(helper.GetElement("Detail/Discipline/Demerit").Attributes["ClearDate"].Value); //銷過日期 if (helper.GetElement("Detail/Discipline/Demerit").Attributes["ClearReason"] != null) ClearReason = helper.GetElement("Detail/Discipline/Demerit").Attributes["ClearReason"].Value; //銷過事由 Cleared = helper.GetElement("Detail/Discipline/Demerit").Attributes["Cleared"].Value; //銷過 MeritFlag = helper.GetString("MeritFlag"); //0是懲戒,1是獎勵,2是留察 }
/// <summary> /// 從XML載入值 /// <![CDATA[ ///<SiblingInfo> /// <Relationship>兄</Relationship> /// <Name>王大明</Name> /// <Birthdate/> /// <School/> /// <SchoolLocation/> /// <ClassName/> /// <SeatNo/> /// <Memo/> ///<SiblingInfo> /// ]]> /// </summary> /// <param name="Element"></param> public void Load(XmlElement Element) { XmlHelper Elements = new XmlHelper(Element); Name = Elements.GetString("Name"); Relationship = Elements.GetString("Relationship"); BirthDate = K12.Data.DateTimeHelper.Parse(Elements.GetString("Birthdate")); SchoolName = Elements.GetString("School"); SchoolLocation = Elements.GetString("SchoolLocation"); ClassName = Elements.GetString("ClassName"); Memo = Elements.GetString("Memo"); }
/// <summary> /// XML參數建構式 /// </summary> /// <param name="data"></param> internal Custodian(XmlElement data) { XmlHelper xdata = new XmlHelper(data); Name = xdata.GetString("CustodianName"); Nationality = xdata.GetString("CustodianNationality"); IDNumber = xdata.GetString("CustodianIDNumber"); Relationship = xdata.GetString("CustodianRelationship"); EducationDegree = xdata.GetString("CustodianOtherInfo/EducationDegree"); Job = xdata.GetString("CustodianOtherInfo/Job"); Phone = xdata.GetString("CustodianOtherInfo/Phone"); EMail = xdata.GetString("CustodianOtherInfo/EMail"); CompanyName = xdata.GetString("CustodianOtherInfo/Company/Name"); CompanyTitle = xdata.GetString("CustodianOtherInfo/Company/Title"); CompanyCategory = xdata.GetString("CustodianOtherInfo/Company/Category"); CellPhone = xdata.GetString("CustodianOtherInfo/PhoneList/Phone[@Title='手機']"); HomePhone = xdata.GetString("CustodianOtherInfo/PhoneList/Phone[@Title='住家電話']"); CompanyPhone = xdata.GetString("CustodianOtherInfo/PhoneList/Phone[@Title='辦公室電話']"); AddressZipCode = xdata.GetString("CustodianOtherInfo/AddressList/Address/ZipCode"); AddressCounty = xdata.GetString("CustodianOtherInfo/AddressList/Address/County"); AddressTown = xdata.GetString("CustodianOtherInfo/AddressList/Address/Town"); AddressArea = xdata.GetString("CustodianOtherInfo/AddressList/Address/Area"); AddressDistrict = xdata.GetString("CustodianOtherInfo/AddressList/Address/District"); AddressDetail = xdata.GetString("CustodianOtherInfo/AddressList/Address/Detail"); AddressLongitude = xdata.GetString("CustodianOtherInfo/AddressList/Address/Longitude"); AddressLatitude = xdata.GetString("CustodianOtherInfo/AddressList/Address/Latitude"); }
/// <summary> /// 從XML載入設定值 /// <![CDATA[ /// ]]> /// </summary> /// <param name="element"></param> public void Load(XmlElement element) { XmlHelper helper = new XmlHelper(element); RefStudentID = helper.GetString("RefStudentID"); RefCourseID = helper.GetString("RefCourseID"); Score = K12.Data.Decimal.ParseAllowNull(helper.GetString("Score")); ID = element.GetAttribute("ID"); Effort = K12.Data.Int.ParseAllowNull(helper.GetString("Extension/Extension/Effort")); Text = helper.GetString("Extension/Extension/Text"); OrdinarilyEffort = K12.Data.Int.ParseAllowNull(helper.GetString("Extension/Extension/OrdinarilyEffort")); OrdinarilyScore = K12.Data.Decimal.ParseAllowNull(helper.GetString("Extension/Extension/OrdinarilyScore")); Extensions = helper.GetElement("Extensions/Extensions"); //下面邏輯待確認 switch (helper.GetString("IsRequired")) { case "必": OverrideRequired = true; break; case "選": OverrideRequired = false; break; default: OverrideRequired = null; break; } switch (helper.GetString("RequiredBy")) { case "部訂": case "校訂": OverrideRequiredBy = helper.GetString("RequiredBy"); break; default: OverrideRequiredBy = null; break; } }
/// <summary> /// 依XML載入設定值 /// </summary> /// <param name="data"></param> public void Load(XmlElement data) { XmlHelper xdata = new XmlHelper(data); Name = xdata.GetString("FatherName"); Nationality = xdata.GetString("FatherNationality"); IDNumber = xdata.GetString("FatherIDNumber"); Living = xdata.GetString("FatherLiving"); EducationDegree = xdata.GetString("FatherOtherInfo/FatherEducationDegree"); Job = xdata.GetString("FatherOtherInfo/FatherJob"); Phone = xdata.GetString("FatherOtherInfo/Phone"); EMail = xdata.GetString("FatherOtherInfo/EMail"); CompanyName = xdata.GetString("FatherOtherInfo/Company/Name"); CompanyTitle = xdata.GetString("FatherOtherInfo/Company/Title"); CompanyCategory = xdata.GetString("FatherOtherInfo/Company/Category"); CellPhone = xdata.GetString("FatherOtherInfo/PhoneList/Phone[@Title='手機']"); HomePhone = xdata.GetString("FatherOtherInfo/PhoneList/Phone[@Title='住家電話']"); CompanyPhone = xdata.GetString("FatherOtherInfo/PhoneList/Phone[@Title='辦公室電話']"); AddressZipCode = xdata.GetString("FatherOtherInfo/AddressList/Address/ZipCode"); AddressCounty = xdata.GetString("FatherOtherInfo/AddressList/Address/County"); AddressTown = xdata.GetString("FatherOtherInfo/AddressList/Address/Town"); AddressDistrict = xdata.GetString("FatherOtherInfo/AddressList/Address/District"); AddressArea = xdata.GetString("FatherOtherInfo/AddressList/Address/Area"); AddressDetail = xdata.GetString("FatherOtherInfo/AddressList/Address/Detail"); AddressLongitude = xdata.GetString("FatherOtherInfo/AddressList/Address/Longitude"); AddressLatitude = xdata.GetString("FatherOtherInfo/AddressList/Address/Latitude"); }