Example #1
0
        /// <summary>
        /// Get year group details
        /// </summary>
        /// <param name="shortName"></param>
        /// <param name="sessionToken"></param>
        /// <returns></returns>
        private static DataEntityDTO getyearGroupDetails(string shortName, SecurityToken sessionToken)
        {
            //New Instance of DataExchangeQuery
            DataExchangeQuery dataExchangeQuery = new DataExchangeQuery();

            DataQuery yearGroupQuery = CreateStandardQuery("YearGroup", "dbo");

            yearGroupQuery.SelectedElements = new Dictionary <string, QuerySelectionElementBase>
            {
                { "YearGroup.ShortName", new QuerySelectionField {
                      SymbolName = "YearGroup.ShortName"
                  } }
            };
            yearGroupQuery.Filter = new AndExpression
            {
                Expressions = new List <object> {
                    new EqualsExpression
                    {
                        CurrentValue = new ParameterValue
                        {
                            SymbolName     = "YearGroup.ShortName",
                            SymbolTypeName = "iSIMS.Common.DataTypes.String"
                        },
                        TestValue = new InputParameterValue()
                        {
                            SymbolName     = "ShortName",
                            SymbolTypeName = typeof(string).FullName
                        }
                    }
                }
            };

            var parameters = new Dictionary <string, object>()
            {
                {
                    "ShortName", shortName
                }
            };

            DataEntityCollectionDTO yearGroupCollection = dataExchangeQuery.RetrieveEntityByQuery(yearGroupQuery, parameters, sessionToken);

            return(yearGroupCollection.DataEntityDtos.FirstOrDefault().Value);
        }
Example #2
0
        /// <summary>
        /// Get Learner Enrolment Status details
        /// </summary>
        /// <param name="enrolmentStatusCode"></param>
        /// <param name="sessionToken"></param>
        /// <returns></returns>
        private static DataEntityDTO getEnrolmentStatus(string enrolmentStatusCode, SecurityToken sessionToken)
        {
            //New Instance of DataExchangeQuery
            DataExchangeQuery dataExchangeQuery = new DataExchangeQuery();
            //Retrieve collection of Genders
            DataQuery enrolmentStatusQuery = CreateStandardQuery("EnrolmentStatus", "dbo");

            enrolmentStatusQuery.SelectedElements = new Dictionary <string, QuerySelectionElementBase>
            {
                { "EnrolmentStatus.Code", new QuerySelectionField {
                      SymbolName = "EnrolmentStatus.Code"
                  } }
            };
            enrolmentStatusQuery.Filter = new AndExpression
            {
                Expressions = new List <object> {
                    new EqualsExpression
                    {
                        CurrentValue = new ParameterValue
                        {
                            SymbolName     = "EnrolmentStatus.Code",
                            SymbolTypeName = "iSIMS.Common.DataTypes.String"
                        },
                        TestValue = new InputParameterValue
                        {
                            SymbolName     = "enrolmentStatusCode",
                            SymbolTypeName = typeof(string).FullName
                        }
                    }
                }
            };

            var parameters = new Dictionary <string, object>()
            {
                { "enrolmentStatusCode", enrolmentStatusCode }
            };

            DataEntityCollectionDTO enrolmentStatusCollection = dataExchangeQuery.RetrieveEntityByQuery(enrolmentStatusQuery, parameters, sessionToken);

            return(enrolmentStatusCollection.DataEntityDtos.FirstOrDefault().Value);
        }
Example #3
0
        /// <summary>
        /// Get School NC year Details for pupil
        /// </summary>
        /// <param name="shortName"></param>
        /// <param name="sessionToken"></param>
        /// <returns></returns>
        private static DataEntityDTO getSchoolNCyearDetails(string shortName, SecurityToken sessionToken)
        {
            //New Instance of DataExchangeQuery
            DataExchangeQuery dataExchangeQuery = new DataExchangeQuery();

            DataQuery schoolNcYearQuery = CreateStandardQuery("SchoolNCYear", "dbo");

            schoolNcYearQuery.SelectedElements = new Dictionary <string, QuerySelectionElementBase>
            {
                { "SchoolNCYear.NCYear", new QuerySelectionField {
                      SymbolName = "SchoolNCYear.NCYear"
                  } }
            };
            schoolNcYearQuery.Filter = new AndExpression
            {
                Expressions = new List <object> {
                    new EqualsExpression
                    {
                        CurrentValue = new ParameterValue
                        {
                            SymbolName     = "SchoolNCYear.NCYear.ShortName",
                            SymbolTypeName = "iSIMS.Common.DataTypes.String"
                        },
                        TestValue = new InputParameterValue()
                        {
                            SymbolName     = "shortname",
                            SymbolTypeName = typeof(string).FullName
                        }
                    }
                }
            };

            //schoolNcYearQuery.Filter = new AndExpression
            //{
            //    Expressions = new List<object> {
            //        new EqualsExpression
            //        {
            //            CurrentValue = new ParameterValue
            //            {
            //                SymbolName = "SchoolNCYear.School",
            //                SymbolTypeName = "iSIMS.Common.DataTypes.Guischoolring"
            //            },
            //           TestValue = new InputParameterValue
            //            {
            //                SymbolName = "schoolId",
            //                SymbolTypeName = typeof(string).FullName
            //            }
            //        }
            //    }
            //};

            var parameters = new Dictionary <string, object>()
            {
                {
                    "Shortname", shortName
                }
            };

            DataEntityCollectionDTO schoolNCyearCollection = dataExchangeQuery.RetrieveEntityByQuery(schoolNcYearQuery, parameters, sessionToken);

            return(schoolNCyearCollection.DataEntityDtos.FirstOrDefault().Value);
        }