Exemple #1
0
        public string GetPupilUsername(int personid, string udf)
        {
            try
            {
                var studentsedt          = new EditStudentInformationReadOnly();
                StudentEditResult status = studentsedt.Load(new Person(personid), DateTime.Now);

                foreach (UDFValue udfVal in studentsedt.Student.UDFValues)
                {
                    if (udfVal.FieldTypeCode == UDFFieldType.STRING1_CODE)
                    {
                        if (udfVal.TypedValueAttribute.Description == udf)
                        {
                            return(((StringAttribute)udfVal.TypedValueAttribute).Value);
                        }
                    }
                }
                studentsedt.Dispose();
            }
            catch (Exception GetStudentUdfException)
            {
                logger.Log(LogLevel.Error, GetStudentUdfException);
            }
            return(null);
        }
Exemple #2
0
 public string GetPupilAdmissionDate(Int32 personid)
 {
     try
     {
         var studentsedt          = new EditStudentInformationReadOnly();
         StudentEditResult status = studentsedt.Load(new Person(personid), DateTime.Now);
         return(studentsedt.Student.DateOfAdmission.ToString());
     }
     catch (Exception GetPupilAdmis_Exception)
     {
         logger.Log(LogLevel.Error, GetPupilAdmis_Exception);
     }
     return(null);
 }
Exemple #3
0
 public string GetPupilRegistration(Int32 personid)
 {
     try
     {
         var studentsedt          = new EditStudentInformationReadOnly();
         StudentEditResult status = studentsedt.Load(new Person(personid), DateTime.Now);
         return(studentsedt.Student.RegGroup.Description);
     }
     catch (Exception GetPupilReg_Exception)
     {
         logger.Log(LogLevel.Error, GetPupilReg_Exception);
     }
     return(null);
 }
Exemple #4
0
        public string GetPupilEmail(Int32 personid)
        {
            string result = "";

            try
            {
                var studentsedt          = new EditStudentInformationReadOnly();
                StudentEditResult status = studentsedt.Load(new Person(personid), DateTime.Now);
                if (studentsedt.Student.Communication.Emails.Value.Count > 0)
                {
                    logger.Log(LogLevel.Debug, " - eMail: " + studentsedt.Student.Communication.Emails.Value.Count);

                    int    workcount      = 1;
                    string emailaddresses = null;

                    foreach (EMail item in studentsedt.Student.Communication.Emails.Value)
                    {
                        //int location = item.Location.ID;
                        //if (location == emailLocationId)

                        if (workcount == 1)
                        {
                            emailaddresses = item.Address.ToLower();
                        }
                        else
                        {
                            emailaddresses = emailaddresses + "," + item.Address.ToLower();
                        }
                        workcount = workcount + 1;
                    }
                    if (string.IsNullOrEmpty(emailaddresses))
                    {
                        return("<NO TYPE EMAILS>");
                    }
                    return(emailaddresses);
                }
                return("<BLANK>");
            }
            catch (Exception GetPupilEmail_Exception)
            {
                logger.Log(LogLevel.Info, GetPupilEmail_Exception);
            }
            return(result);
        }
Exemple #5
0
        public string GetPupilTelephone(Int32 personid)
        {
            string result = "";

            try
            {
                var studentsedt          = new EditStudentInformationReadOnly();
                StudentEditResult status = studentsedt.Load(new Person(personid), DateTime.Now);
                if (studentsedt.Student.Communication.Phones.Value.Count > 0)
                {
                    logger.Log(LogLevel.Debug, " - telephone: " + studentsedt.Student.Communication.Phones.Value.Count);

                    int    workcount = 1;
                    string telephone = null;

                    foreach (Telephone item in studentsedt.Student.Communication.Phones.Value)
                    {
                        //int location = item.Location.ID;
                        //if (location == telephoneLocationId)
                        if (workcount == 1)
                        {
                            telephone = item.Number.ToLower();
                        }
                        else
                        {
                            telephone = telephone + "," + item.Number.ToLower();
                        }
                        workcount = workcount + 1;
                    }
                    if (string.IsNullOrEmpty(telephone))
                    {
                        return("<NO TYPE TELEPHONE>");
                    }
                    return(telephone);
                }
                return("<NO TELEPHONE>");
            }
            catch (Exception GetPupilEmail_Exception)
            {
                logger.Log(LogLevel.Info, GetPupilEmail_Exception);
            }
            return(result);
        }