public static List <int> ListSeatNo(string classID) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("ListSeatNoRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); helper.AddElement("Condition"); helper.AddElement("Condition", "RefClassID", classID); dsreq.SetContent(helper); DSResponse rsp = DSAServices.CallService("SmartSchool.Class.ListSeatNo", dsreq); List <int> list = new List <int>(); foreach (XmlNode node in rsp.GetContent().GetElements("SeatNo")) { int no; if (int.TryParse(node.InnerText, out no)) { list.Add(no); } } return(list); }
/// <summary> /// 取得詳細資料列表 /// </summary> /// <param name="id">學生編號</param> /// <returns></returns> public static DSResponse GetDetailList(IEnumerable <string> fields, params string[] list) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetStudentListRequest"); helper.AddElement("Field"); bool hasfield = false; foreach (string field in fields) { helper.AddElement("Field", field); hasfield = true; } if (!hasfield) { throw new Exception("必須傳入Field"); } helper.AddElement("Condition"); foreach (string id in list) { helper.AddElement("Condition", "ID", id); } dsreq.SetContent(helper); return(DSAServices.CallService("SmartSchool.Student.GetDetailList", dsreq)); }
public static DSXmlHelper GetSemesterEntryScoreBySemester(bool includePlace, string schoolYear, string semester, EntryGroup group, params string[] studentIDList) { DSXmlHelper helper = new DSXmlHelper("GetSemesterEntryScore"); DSRequest dsreq = new DSRequest(); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "RefStudentId"); helper.AddElement("Field", "ScoreInfo"); if (includePlace) { helper.AddElement("Field", "ClassRating"); helper.AddElement("Field", "DeptRating"); helper.AddElement("Field", "YearRating"); } helper.AddElement("Condition"); if (studentIDList.Length > 0) { helper.AddElement("Condition", "StudentIDList"); foreach (string id in studentIDList) { helper.AddElement("Condition/StudentIDList", "ID", id); } } helper.AddElement("Condition", "SchoolYear", schoolYear); helper.AddElement("Condition", "Semester", semester); helper.AddElement("Condition", "EntryGroup", group.ToString()); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Score.GetSemesterEntryScore", dsreq); return(dsrsp.GetContent()); }
public static List <TeacherRecord> GetTeachers(IEnumerable <string> primaryKeys) { bool hasKey = false; DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); foreach (var key in primaryKeys) { hasKey = true; helper.AddElement("Condition", "ID", key); } helper.AddElement("Order"); List <TeacherRecord> result = new List <TeacherRecord>(); if (hasKey) { dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Teacher.GetDetailList", dsreq); foreach (XmlElement var in dsrsp.GetContent().GetElements("Teacher")) { result.Add(new TeacherRecord(var)); } } return(result); }
public static DSResponse GetSchoolYearSubjectScoreBySchoolYear(int schoolyear, params string[] studentIDList) { DSXmlHelper helper = new DSXmlHelper("GetSchoolYearSubjectScore"); DSRequest dsreq = new DSRequest(); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "RefStudentId"); helper.AddElement("Field", "SchoolYear"); helper.AddElement("Field", "Semester"); helper.AddElement("Field", "GradeYear"); helper.AddElement("Field", "ScoreInfo"); helper.AddElement("Condition"); helper.AddElement("Condition", "SchoolYear", schoolyear.ToString()); if (studentIDList.Length > 0) { helper.AddElement("Condition", "StudentIDList"); foreach (string id in studentIDList) { helper.AddElement("Condition/StudentIDList", "ID", id); } } helper.AddElement("Order"); helper.AddElement("Order", "RefStudentId"); helper.AddElement("Order", "SchoolYear"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Score.GetSchoolYearSubjectScore", dsreq); return(dsrsp); }
public static List<StudentRecord> GetStudents(IEnumerable<string> primaryKeys) { bool hasKey = false ; DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); foreach ( string var in primaryKeys ) { helper.AddElement("Condition", "ID", var); hasKey = true; } helper.AddElement("Order"); dsreq.SetContent(helper); if ( hasKey ) { DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractListWithTag", dsreq); List<StudentRecord> result = new List<StudentRecord>(); foreach ( XmlElement var in dsrsp.GetContent().GetElements("Student") ) { result.Add(new StudentRecord(var)); System.Diagnostics.Trace.WriteLine("建立StudentRecord{0}", DateTime.Now.ToLongTimeString()); } return result; } else { return new List<StudentRecord>(); } }
public static DSResponse GetExtension(string nameSpace, string[] fields, string[] studentIDs) { if (studentIDs.Length == 0) { return(null); } DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.SetAttribute(".", "Namespace", nameSpace); helper.AddElement("Field"); foreach (string field in fields) { helper.AddElement("Field", field); } if (fields.Length == 0) { helper.AddElement("Field", "All.Field"); } helper.AddElement("Condition"); foreach (string id in studentIDs) { helper.AddElement("Condition", "ID", id); } dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetExtend", dsreq); return(dsrsp); }
public static List<CourseRecord> GetAllCourses() { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetDetailListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "CourseName"); helper.AddElement("Field", "SchoolYear"); helper.AddElement("Field", "Semester"); helper.AddElement("Field", "Period"); helper.AddElement("Field", "Credit"); //helper.AddElement("Field", "IsRequired"); //helper.AddElement("Field", "RequiredBy"); helper.AddElement("Field", "RefExamTemplateID"); helper.AddElement("Field", "RefClassID"); helper.AddElement("Field", "Subject"); helper.AddElement("Field", "Domain"); helper.AddElement("Field", "ScoreCalcFlag"); helper.AddElement("Condition"); helper.AddElement("Order"); helper.AddElement("Order", "ID"); helper.AddElement("Order", "Sequence"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Course.GetDetailList", dsreq); List<CourseRecord> result = new List<CourseRecord>(); foreach (XmlElement var in dsrsp.GetContent().GetElements("Course")) { result.Add(new CourseRecord(var)); } return result; }
public static List <CourseRecord> GetAllCourses() { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetDetailListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "CourseName"); helper.AddElement("Field", "SchoolYear"); helper.AddElement("Field", "Semester"); helper.AddElement("Field", "Period"); helper.AddElement("Field", "Credit"); //helper.AddElement("Field", "IsRequired"); //helper.AddElement("Field", "RequiredBy"); helper.AddElement("Field", "RefExamTemplateID"); helper.AddElement("Field", "RefClassID"); helper.AddElement("Field", "Subject"); helper.AddElement("Field", "Domain"); helper.AddElement("Field", "CourseNumber"); helper.AddElement("Field", "ScoreCalcFlag"); helper.AddElement("Condition"); helper.AddElement("Order"); helper.AddElement("Order", "ID"); helper.AddElement("Order", "Sequence"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Course.GetDetailList", dsreq); List <CourseRecord> result = new List <CourseRecord>(); foreach (XmlElement var in dsrsp.GetContent().GetElements("Course")) { result.Add(new CourseRecord(var)); } return(result); }
public static void SetExtend(string nameSpace, string field, IDictionary <string, string> list) { if (list.Count == 0) { return; } foreach (string var in new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }) { if (field.StartsWith(var)) { throw new Exception("欄位名稱開頭不可為數字"); } } DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.SetAttribute(".", "Namespace", nameSpace); foreach (string id in list.Keys) { helper.AddElement("Student"); helper.SetAttribute("Student", "ID", id); if (string.IsNullOrEmpty(list[id])) { helper.AddElement("Student", field); } else { helper.AddElement("Student", field, list[id]); } } dsreq.SetContent(helper); DSAServices.CallService("SmartSchool.Student.SetExtend", dsreq); }
public static List <StudentRecord> GetStudents(IEnumerable <string> primaryKeys) { bool hasKey = false; DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); foreach (string var in primaryKeys) { helper.AddElement("Condition", "ID", var); hasKey = true; } helper.AddElement("Order"); dsreq.SetContent(helper); if (hasKey) { DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractListWithTag", dsreq); List <StudentRecord> result = new List <StudentRecord>(); foreach (XmlElement var in dsrsp.GetContent().GetElements("Student")) { result.Add(new StudentRecord(var)); System.Diagnostics.Trace.WriteLine("建立StudentRecord{0}", DateTime.Now.ToLongTimeString()); } return(result); } else { return(new List <StudentRecord>()); } }
public DSRequest GetRequest(string rootName, string dataElementName, string fieldElementName, string conditionElementName, string conditionName, string id) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper(rootName); if (!string.IsNullOrEmpty(dataElementName)) { helper.AddElement(dataElementName); helper.AddElement(dataElementName, fieldElementName); helper.AddElement(dataElementName, conditionElementName); fieldElementName = dataElementName + "/" + fieldElementName; conditionElementName = dataElementName + "/" + conditionElementName; } else { helper.AddElement(fieldElementName); helper.AddElement(conditionElementName); } foreach (string key in _nowValues.Keys) { if (_nowValues[key] != _oldValues[key]) { helper.AddElement(fieldElementName, key, _nowValues[key]); } } helper.AddElement(conditionElementName, conditionName, id); dsreq.SetContent(helper); //Console.WriteLine(helper.GetRawXml()); return(dsreq); }
public static DSResponse GetEduDegreeList() { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetEducationDegreeListRequest"); helper.AddElement("Fields"); helper.AddElement("Fields", "All"); request.SetContent(helper); return(FISCA.Authentication.DSAServices.CallService("SmartSchool.Config.GetEducationDegreeList", request)); }
public static DSResponse GetRelationship() { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetRelationshipListRequest"); helper.AddElement("Fields"); helper.AddElement("Fields", "All"); request.SetContent(helper); return(DSAServices.CallService("SmartSchool.Config.GetRelationshipList", request)); }
public static XmlNode GetClassInfo(string studentid) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetClassRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); helper.AddElement("Condition"); helper.AddElement("Condition", "ID", studentid); dsreq.SetContent(helper); return(DSAServices.CallService("SmartSchool.Student.GetClassInfo", dsreq).GetContent().BaseElement); }
public static void UpdateGraduatePhoto(string picBase64String, string StudentID) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("UpdateStudentList"); helper.AddElement("Student"); helper.AddElement("Student", "Field"); helper.AddElement("Student/Field", "GraduatePhoto"); helper.AddCDataSection("Student/Field/GraduatePhoto", picBase64String); helper.AddElement("Student", "Condition"); helper.AddElement("Student/Condition", "ID", StudentID); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService(UPDATE_SERVICENAME, dsreq); }
public static void UpdateGraduatePhoto(string picBase64String, string id) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("UpdateStudentList"); helper.AddElement("Student"); helper.AddElement("Student", "Field"); helper.AddElement("Student/Field", "GraduatePhoto"); helper.AddCDataSection("Student/Field/GraduatePhoto", picBase64String); helper.AddElement("Student", "Condition"); helper.AddElement("Student/Condition", "ID", id); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.Update", dsreq); }
public static List<TeacherRecord> GetAllTeachers() { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); helper.AddElement("Order"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Teacher.GetDetailList", dsreq); List<TeacherRecord> result = new List<TeacherRecord>(); foreach (XmlElement var in dsrsp.GetContent().GetElements("Teacher")) { result.Add(new TeacherRecord(var)); } return result; }
public static DSResponse GetAbsenceList() { string serviceName = "GetAbsenceList"; if (DataCacheManager.Get(serviceName) == null) { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetAbsenceListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); request.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Others.GetAbsenceList", request); DataCacheManager.Add(serviceName, dsrsp); } return DataCacheManager.Get(serviceName); }
public static DSResponse GetMultiParentInfo(params string[] idlist) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetParentInfoRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); helper.AddElement("Condition"); foreach (string id in idlist) { helper.AddElement("Condition", "ID", id); } dsreq.SetContent(helper); return(DSAServices.CallService("SmartSchool.Student.GetMultiParentInfo", dsreq)); }
public static List<StudentRecord> GetAllStudents() { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); helper.AddElement("Order"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractListWithTag", dsreq); List<StudentRecord> result = new List<StudentRecord>(); foreach ( XmlElement var in dsrsp.GetContent().GetElements("Student") ) { result.Add(new StudentRecord(var)); } return result; }
public static DSXmlHelper GetAbstractList(params string[] gradeYear) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.AddElement(".", "Field", "<ID/><Name/><RefClassID/><ClassName/><SeatNo/><RefDepartmentID/><DepartmentName/><GradeYear/>", true); helper.AddElement("Condition"); helper.AddElement("Condition", "Status", "�@��"); foreach (string each in gradeYear) helper.AddElement("Condition", "GradeYear", each); helper.AddElement(".", "Order", "<GradeYear/><RefClassID/><SeatNo/>", true); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractList", dsreq); return dsrsp.GetContent(); }
public static DSResponse GetPhoneDetail(string id) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetStudentListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "PermanentPhone"); helper.AddElement("Field", "ContactPhone"); helper.AddElement("Field", "OtherPhones"); helper.AddElement("Field", "SMSPhone"); helper.AddElement("Condition"); helper.AddElement("Condition", "ID", id); dsreq.SetContent(helper); return(DSAServices.CallService("SmartSchool.Student.GetAbstractList", dsreq)); }
public static DSResponse GetAbsenceList() { string serviceName = "GetAbsenceList"; if (DataCacheManager.Get(serviceName) == null) { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetAbsenceListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); request.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Others.GetAbsenceList", request); DataCacheManager.Add(serviceName, dsrsp); } return(DataCacheManager.Get(serviceName)); }
public static DSResponse GetUpdateCodeSynopsis() { string serviceName = "SmartSchool.Config.GetUpdateCodeSynopsis"; if (DataCacheManager.Get(serviceName) == null) { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetCountyListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "異動代號對照表"); request.SetContent(helper); DSResponse dsrsp = FISCA.Authentication.DSAServices.CallService("SmartSchool.Config.GetUpdateCodeSynopsis", request); DataCacheManager.Add(serviceName, dsrsp); } return(DataCacheManager.Get(serviceName)); }
public static List <TeacherRecord> GetAllTeachers() { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); helper.AddElement("Order"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Teacher.GetDetailList", dsreq); List <TeacherRecord> result = new List <TeacherRecord>(); foreach (XmlElement var in dsrsp.GetContent().GetElements("Teacher")) { result.Add(new TeacherRecord(var)); } return(result); }
public static List <StudentRecord> GetAllStudents() { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); helper.AddElement("Order"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractListWithTag", dsreq); List <StudentRecord> result = new List <StudentRecord>(); foreach (XmlElement var in dsrsp.GetContent().GetElements("Student")) { result.Add(new StudentRecord(var)); } return(result); }
public static List<string> GetCountyList() { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.AddElement("Fields"); helper.AddElement("Fields", "All"); request.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Config.GetCountyTownList", request); List<string> countyList = new List<string>(); foreach (XmlNode node in dsrsp.GetContent().GetElements("Town")) { string county = node.Attributes["County"].Value; if (!countyList.Contains(county)) countyList.Add(county); } return countyList; }
public static List <string> GetNationalityList(this Parent parent) { List <string> List = new List <string>(); DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetNationalityListRequest"); helper.AddElement("Fields"); helper.AddElement("Fields", "All"); request.SetContent(helper); DSXmlHelper response = FISCA.Authentication.DSAServices.CallService("SmartSchool.Config.GetNationalityList", request).GetContent(); foreach (XmlElement Element in response.GetElements("Nationality")) { List.Add(Element.InnerText); } return(List); }
public static DSXmlHelper GetAbstractList(params string[] gradeYear) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.AddElement(".", "Field", "<ID/><Name/><RefClassID/><ClassName/><SeatNo/><RefDepartmentID/><DepartmentName/><GradeYear/>", true); helper.AddElement("Condition"); helper.AddElement("Condition", "Status", "一般"); foreach (string each in gradeYear) { helper.AddElement("Condition", "GradeYear", each); } helper.AddElement(".", "Order", "<GradeYear/><RefClassID/><SeatNo/>", true); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractList", dsreq); return(dsrsp.GetContent()); }
public static List <CourseRecord> GetCourses(IEnumerable <string> primaryKeys) { bool hasKey = false; DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetDetailListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "CourseName"); helper.AddElement("Field", "SchoolYear"); helper.AddElement("Field", "Semester"); helper.AddElement("Field", "Period"); helper.AddElement("Field", "Credit"); //helper.AddElement("Field", "IsRequired"); //helper.AddElement("Field", "RequiredBy"); helper.AddElement("Field", "RefExamTemplateID"); helper.AddElement("Field", "RefClassID"); helper.AddElement("Field", "Subject"); helper.AddElement("Field", "Domain"); helper.AddElement("Field", "ScoreCalcFlag"); helper.AddElement("Field", "CourseNumber"); helper.AddElement("Condition"); foreach (var key in primaryKeys) { helper.AddElement("Condition", "ID", key); hasKey = true; } helper.AddElement("Order"); List <CourseRecord> result = new List <CourseRecord>(); if (hasKey) { dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Course.GetDetailList", dsreq); foreach (XmlElement var in dsrsp.GetContent().GetElements("Course")) { result.Add(new CourseRecord(var)); } } return(result); }
public static DSResponse GetAbstractList() { //DSRequest dsreq = new DSRequest( // "<GetStudentListRequest><Fields><ID/><StudentID/><Name/><EnglishName/><Gender/><Nationality/><SSN/><NationalityLocation/><EthnicGroup/><ClassID/><GradeYear/><ClassName/><SeatNo/><Status/></Fields>"+ // "<Condition><Status>�@��</Status><Status>���</Status><Status>����</Status><Status>�R��</Status></Condition>" + // "<Order><GradeYear/><ClassName/><SeatNo/></Order>"+ // "</GetStudentListRequest>"); DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); //helper.AddElement("Condition", "Status", "�@��"); //helper.AddElement("Condition", "Status", "���"); //helper.AddElement("Condition", "Status", "����"); //helper.AddElement("Condition", "Status", "�R��"); helper.AddElement("Order"); helper.AddElement("Order", "SeatNo"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractListWithTag", dsreq); //DSResponse dsrsp = CallService("SmartSchool.Student.GetAbstractListWithClassInfo", dsreq); return dsrsp; }
public static DSResponse GetDisciplineReasonList() { //string serviceName = "GetDisciplineReasonList"; // 拿掉快取 //if (DataCacheManager.Get(serviceName) == null) //{ DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetDisciplineReasonListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); request.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Config.GetDisciplineReasonList", request); return(dsrsp); //DataCacheManager.Add(serviceName, dsrsp); //} //return DataCacheManager.Get(serviceName); }
public static List <string> GetCountyList() { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.AddElement("Fields"); helper.AddElement("Fields", "All"); request.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Config.GetCountyTownList", request); List <string> countyList = new List <string>(); foreach (XmlNode node in dsrsp.GetContent().GetElements("Town")) { string county = node.Attributes["County"].Value; if (!countyList.Contains(county)) { countyList.Add(county); } } return(countyList); }
public static List<CourseRecord> GetCourses(IEnumerable<string> primaryKeys) { bool hasKey = false; DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetDetailListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "CourseName"); helper.AddElement("Field", "SchoolYear"); helper.AddElement("Field", "Semester"); helper.AddElement("Field", "Period"); helper.AddElement("Field", "Credit"); //helper.AddElement("Field", "IsRequired"); //helper.AddElement("Field", "RequiredBy"); helper.AddElement("Field", "RefExamTemplateID"); helper.AddElement("Field", "RefClassID"); helper.AddElement("Field", "Subject"); helper.AddElement("Field", "Domain"); helper.AddElement("Field", "ScoreCalcFlag"); helper.AddElement("Condition"); foreach (var key in primaryKeys) { helper.AddElement("Condition", "ID", key); hasKey = true; } helper.AddElement("Order"); List<CourseRecord> result = new List<CourseRecord>(); if (hasKey) { dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Course.GetDetailList", dsreq); foreach (XmlElement var in dsrsp.GetContent().GetElements("Course")) { result.Add(new CourseRecord(var)); } } return result; }
public static DSResponse GetAbstractList() { //DSRequest dsreq = new DSRequest( // "<GetStudentListRequest><Fields><ID/><StudentID/><Name/><EnglishName/><Gender/><Nationality/><SSN/><NationalityLocation/><EthnicGroup/><ClassID/><GradeYear/><ClassName/><SeatNo/><Status/></Fields>"+ // "<Condition><Status>一般</Status><Status>休學</Status><Status>輟學</Status><Status>刪除</Status></Condition>" + // "<Order><GradeYear/><ClassName/><SeatNo/></Order>"+ // "</GetStudentListRequest>"); DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); //helper.AddElement("Condition", "Status", "一般"); //helper.AddElement("Condition", "Status", "休學"); //helper.AddElement("Condition", "Status", "延修"); //helper.AddElement("Condition", "Status", "刪除"); helper.AddElement("Order"); helper.AddElement("Order", "SeatNo"); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetAbstractListWithTag", dsreq); //DSResponse dsrsp = CallService("SmartSchool.Student.GetAbstractListWithClassInfo", dsreq); return(dsrsp); }
/// <summary> /// 依年級取得班級清單 /// </summary> /// <param name="gradeYear">年級</param> /// <returns> /// key : 班級編號 /// value : 班級名稱 /// </returns> public static Dictionary <string, string> GetClassListByGradeYear(string gradeYear) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetClassListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); helper.AddElement("Condition"); helper.AddElement("Condition", "GradeYear", gradeYear); helper.AddElement("Order"); helper.AddElement("Order", "DisplayOrder", "ASC"); helper.AddElement("Order", "ID", "ASC"); dsreq.SetContent(helper); DSResponse rsp = DSAServices.CallService("SmartSchool.Class.GetAbstractListByGradeYear", dsreq); Dictionary <string, string> classList = new Dictionary <string, string>(); foreach (XmlNode node in rsp.GetContent().GetElements("Class")) { classList.Add(node.Attributes["ID"].Value, node.Attributes["ClassName"].Value); } return(classList); }
public static List<TeacherRecord> GetTeachers(IEnumerable<string> primaryKeys) { bool hasKey = false; DSRequest dsreq = new DSRequest(); DSXmlHelper helper = CreateBriefFieldHelper(); helper.AddElement("Condition"); foreach ( var key in primaryKeys ) { hasKey = true; helper.AddElement("Condition", "ID", key); } helper.AddElement("Order"); List<TeacherRecord> result = new List<TeacherRecord>(); if ( hasKey ) { dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Teacher.GetDetailList", dsreq); foreach ( XmlElement var in dsrsp.GetContent().GetElements("Teacher") ) { result.Add(new TeacherRecord(var)); } } return result; }
public static DSResponse GetPhoneDetail(string id) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetStudentListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "ID"); helper.AddElement("Field", "PermanentPhone"); helper.AddElement("Field", "ContactPhone"); helper.AddElement("Field", "OtherPhones"); helper.AddElement("Field", "SMSPhone"); helper.AddElement("Condition"); helper.AddElement("Condition", "ID", id); dsreq.SetContent(helper); return DSAServices.CallService("SmartSchool.Student.GetAbstractList", dsreq); }
public static void UpdateFreshmanPhoto(string picBase64String, string id) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("UpdateStudentList"); helper.AddElement("Student"); helper.AddElement("Student", "Field"); helper.AddElement("Student/Field", "FreshmanPhoto"); helper.AddCDataSection("Student/Field/FreshmanPhoto", picBase64String); helper.AddElement("Student", "Condition"); helper.AddElement("Student/Condition", "ID", id); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.Update", dsreq); }
public static void SetExtend(string nameSpace, string field, IDictionary<string, string> list) { if ( list.Count == 0 ) return; foreach ( string var in new string[]{"0","1","2","3","4","5","6","7","8","9"} ) { if ( field.StartsWith(var) ) throw new Exception("���W�ٶ}�Y���i���Ʀr"); } DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.SetAttribute(".", "Namespace", nameSpace); foreach ( string id in list.Keys ) { helper.AddElement("Student"); helper.SetAttribute("Student", "ID", id); if(string.IsNullOrEmpty(list[id])) helper.AddElement("Student", field); else helper.AddElement("Student", field,list[id]); } dsreq.SetContent(helper); DSAServices.CallService("SmartSchool.Student.SetExtend", dsreq); }
public static DSResponse GetRelationship() { DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetRelationshipListRequest"); helper.AddElement("Fields"); helper.AddElement("Fields", "All"); request.SetContent(helper); return DSAServices.CallService("SmartSchool.Config.GetRelationshipList", request); }
public static Dictionary<string,string> SelectFreshmanPhoto(IEnumerable<string> StudentIDs) { Dictionary<string, string> PhotoList = new Dictionary<string, string>(); DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetStudentListRequest"); helper.AddElement("Field"); helper.AddElement("Field","ID"); helper.AddElement("Field", "FreshmanPhoto"); helper.AddElement("Condition"); foreach(string StudentID in StudentIDs) if (!string.IsNullOrEmpty(StudentID)) helper.AddElement("Condition", "ID", StudentID); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService(SELECT_SERVICENAME, dsreq); foreach (XmlElement element in dsrsp.GetContent().GetElements("Student")) { string strStudentID = element.GetAttribute("ID"); string strFrshmanPhoto = element.SelectSingleNode("FreshmanPhoto").InnerText; PhotoList.Add(strStudentID,strFrshmanPhoto); } return PhotoList; }
public static DSResponse GetDisciplineReasonList() { //string serviceName = "GetDisciplineReasonList"; // 拿掉快取 //if (DataCacheManager.Get(serviceName) == null) //{ DSRequest request = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetDisciplineReasonListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); request.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Config.GetDisciplineReasonList", request); return dsrsp; //DataCacheManager.Add(serviceName, dsrsp); //} //return DataCacheManager.Get(serviceName); }
public static string SelectGraduatePhoto(string StudentID) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetStudentListRequest"); helper.AddElement("Field"); helper.AddElement("Field", "GraduatePhoto"); helper.AddElement("Condition"); helper.AddElement("Condition", "ID", StudentID); dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService(SELECT_SERVICENAME, dsreq); string strFreshmanPhoto = dsrsp.GetContent().GetText("Student/GraduatePhoto"); return strFreshmanPhoto; }
/// <summary> /// 取得詳細資料列表 /// </summary> /// <returns></returns> private static DSResponse GetDetailList(IEnumerable<string> fields, params string[] list) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetStudentListRequest"); helper.AddElement("Field"); bool hasfield = false; foreach ( string field in fields ) { helper.AddElement("Field", field); hasfield = true; } if ( !hasfield ) throw new Exception("必須傳入Field"); helper.AddElement("Condition"); foreach ( string id in list ) { helper.AddElement("Condition", "ID", id); } dsreq.SetContent(helper); return DSAServices.CallService("SmartSchool.Student.GetDetailList", dsreq); }
public static XmlNode GetClassInfo(string studentid) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetClassRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); helper.AddElement("Condition"); helper.AddElement("Condition", "ID", studentid); dsreq.SetContent(helper); return DSAServices.CallService("SmartSchool.Student.GetClassInfo", dsreq).GetContent().BaseElement; }
public static DSResponse GetDetailList(IEnumerable<string> fields) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetStudentListRequest"); helper.AddElement("Field"); bool hasfield = false; foreach (string field in fields) { helper.AddElement("Field", field); hasfield = true; } if (!hasfield) throw new Exception("�����ǤJField"); dsreq.SetContent(helper); return DSAServices.CallService("SmartSchool.Student.GetDetailList", dsreq); }
public static DSResponse GetExtension(string nameSpace, string[] fields, string[] studentIDs) { if ( studentIDs.Length == 0 ) return null; DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("Request"); helper.SetAttribute(".","Namespace", nameSpace); helper.AddElement("Field"); foreach ( string field in fields ) helper.AddElement("Field",field); if ( fields.Length == 0 ) helper.AddElement("Field", "All.Field"); helper.AddElement("Condition"); foreach ( string id in studentIDs ) { helper.AddElement("Condition", "ID", id); } dsreq.SetContent(helper); DSResponse dsrsp = DSAServices.CallService("SmartSchool.Student.GetExtend", dsreq); return dsrsp; }
public static DSResponse GetParentInfo(params string[] idlist) { DSRequest dsreq = new DSRequest(); DSXmlHelper helper = new DSXmlHelper("GetParentInfoRequest"); helper.AddElement("Field"); helper.AddElement("Field", "All"); helper.AddElement("Condition"); foreach (string id in idlist) { helper.AddElement("Condition", "ID", id); } dsreq.SetContent(helper); return DSAServices.CallService("SmartSchool.Student.GetParentInfo", dsreq); }