示例#1
0
        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);
        }
示例#2
0
        /// <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));
        }
示例#3
0
        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());
        }
示例#4
0
        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);
        }
示例#5
0
        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>();
     }
 }
示例#7
0
        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);
        }
示例#8
0
 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;
 }
示例#9
0
        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);
        }
示例#10
0
        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);
        }
示例#11
0
        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>());
            }
        }
示例#12
0
        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);
        }
示例#13
0
        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));
        }
示例#14
0
        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));
        }
示例#15
0
        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);
        }
示例#16
0
 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);
 }
示例#17
0
        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);
        }
示例#18
0
 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;
 }
示例#19
0
 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);
 }
示例#20
0
        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));
        }
示例#21
0
 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;
 }
示例#22
0
        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();
        }
示例#23
0
        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));
        }
示例#24
0
        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));
        }
示例#25
0
        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));
        }
示例#26
0
        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);
        }
示例#27
0
        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);
        }
示例#28
0
        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;
        }
示例#29
0
        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);
        }
示例#30
0
        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());
        }
示例#31
0
        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);
        }
示例#32
0
 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;
 }
示例#33
0
        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);
        }
示例#34
0
        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);
        }
示例#35
0
 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;
 }
示例#36
0
        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);
        }
示例#37
0
        /// <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);
        }
示例#38
0
 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;
 }
示例#39
0
 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);
 }
示例#40
0
 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);
 }
示例#41
0
 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);
 }
示例#42
0
 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);
 }
示例#43
0
        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;
        }
示例#44
0
        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);
        }
示例#45
0
        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;
        }
示例#46
0
 /// <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);
 }
示例#47
0
 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;
 }
示例#48
0
        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);
        }
示例#49
0
 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;
 }
示例#50
0
 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);
 }