示例#1
0
文件: Course.cs 项目: glakuub/SWZ
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            result.Append(Id.ToString());
            result.Append("|");
            result.Append(CourseCode.ToString());
            result.Append("|");
            result.Append(CourseName.ToString());
            result.Append("|");
            result.Append(Ects.ToString());
            result.Append("|");
            result.Append(CourseType.ToString());
            result.Append("|");
            result.Append(Zzu.ToString());
            result.Append("|");
            result.Append(SemesterNumber.ToString());
            result.Append("|");
            result.Append(StudyPlanID.ToString());
            result.Append("|");
            result.Append(CoursesGroupID.ToString());
            result.Append("|");
            result.Append(IsCoursesGroup.ToString());
            return(result.ToString());
        }
示例#2
0
 private static void fieldOfStudyType(Document doc, CourseType Type)
 {
     doc.Add(new Paragraph("Forma Studiów: ".ToUpper())
             .Add(new Paragraph(EnumTranslator.Translate(Type.ToString()))
                  .SetTextAlignment(iText.Layout.Properties.TextAlignment.RIGHT))
             .SetFixedLeading(0.5f));
 }
示例#3
0
        public static CourseBuilder Build(CourseType courseType, Provider withProvider = null)
        {
            var result = new CourseBuilder()
                         .WithCode(courseType.ToString())
                         .WithProvider(withProvider)
                         .AddCourseSite(courseType);

            return(result);
        }
示例#4
0
        /// <summary>
        /// 通过反射获取CourseType上的注解
        /// </summary>
        /// <param name="course"></param>
        /// <returns></returns>
        public static String GetInfo(CourseType course)
        {
            Type type = typeof(CourseType);

            foreach (MemberInfo mInfo in type.GetMembers())
            {
                if (mInfo.Name.Equals(course.ToString()))
                {
                    foreach (Attribute attr in Attribute.GetCustomAttributes(mInfo))
                    {
                        if (attr.GetType() == typeof(DescriptionAttribute))
                        {
                            //Console.WriteLine(((DescriptionAttribute)attr).Description);
                            return(((DescriptionAttribute)attr).Description);
                        }
                    }
                }
            }

            return(null);
        }
示例#5
0
 public override string ToString()
 {
     return(String.Format($"{FirstName} {LastName} subject {_subject.ToString()}"));
 }