-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDegreeInfo.cs
134 lines (116 loc) · 5.03 KB
/
DegreeInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DegreeMapperWebAPI
{
public class DegreeInfo
{
public int Id { get; set; }
public string Degree { get; set; }
public int CatalogId { get; set; }
public string CatalogYear { get; set; }
public int InstitutionId { get; set; }
public string Institution { get; set; }
public int CollegeId { get; set; }
public string College { get; set; }
public string CatalogUrl { get; set; }
public string CollegeUrl { get; set; }
public string DegreeUrl { get; set; }
public string GPA { get; set; }
public bool LimitedAccess { get; set; }
public bool RestrictedAccess { get; set; }
public int UCFDegreeId { get; set; }
public string AdditionalRequirement { get; set; }
public string ForeignLanguageRequirement { get; set; }
public string UndergraduateCatalogUrl { get; set; }
public List<string> Notes { get; set; }
public DegreeInfo()
{
Notes = new List<string>();
}
public static DegreeInfo Get(int id)
{
Degree d = DegreeMapperWebAPI.Degree.Get(id);
DegreeInfo di = new DegreeInfo();
if (di != null)
{
di.Id = d.Id;
di.Degree = d.Name;
di.CatalogId = d.CatalogId;
di.CatalogYear = d.CatalogYear;
di.College = d.CollegeName;
di.CatalogUrl = d.CatalogUrl;
//di.CollegeUrl = ;
di.DegreeUrl = d.DegreeURL;
di.Institution = d.Institution;
di.InstitutionId = d.InstitutionId;
di.RestrictedAccess = d.RestrictedAccess;
di.LimitedAccess = d.LimitedAccess;
di.UndergraduateCatalogUrl = d.UndergraduateCatalogUrl;
if (d.UCFDegreeId.HasValue)
{
di.UCFDegreeId = d.UCFDegreeId.Value;
}
di.GPA = d.GPA;
GetRequirement(ref di);
GetForeignLanguageRequirement(ref di);
GetNotes(ref di);
}
return di;
}
private static void GetRequirement(ref DegreeInfo di)
{
int requirementId = DegreeMapperWebAPI.Note.NoteTypeValue.AdditionalRequirement;
string UCFRequirement = DegreeMapperWebAPI.Note.List(di.UCFDegreeId, null).Where(x => x.NoteType == requirementId).Select(x => x.Value).FirstOrDefault();
if (!string.IsNullOrEmpty(UCFRequirement))
{
di.AdditionalRequirement = UCFRequirement;
}
/**
FOR PHASE 1 WE WILL NOT USE PARTNER REQUIREMENTS
PARTNER REQUIREMENTS IS NOT AVAILABLE
**/
//string partnerRequirement = DegreeMapping.Models.Note.List(di.Id).Where(x => x.NoteType == requirementId).Select(x => x.Value).FirstOrDefault();
//if (!string.IsNullOrEmpty(partnerRequirement))
//{
// di.AdditionalRequirement += string.Format("<div>{0}</div>",partnerRequirement);
//}
}
private static void GetForeignLanguageRequirement(ref DegreeInfo di)
{
int requirementId = DegreeMapperWebAPI.Note.NoteTypeValue.ForeignLanguageRequirement;
string UCFForeingLanguage = DegreeMapperWebAPI.Note.List(di.UCFDegreeId, null).Where(x => x.NoteType == requirementId).Select(x => x.Value).FirstOrDefault();
if (!string.IsNullOrEmpty(UCFForeingLanguage))
{
di.ForeignLanguageRequirement = UCFForeingLanguage;
}
//string partnerForeignLanguage = DegreeMapping.Models.Note.List(di.Id).Where(x => x.NoteType == requirementId).Select(x => x.Value).FirstOrDefault();
//if (!string.IsNullOrEmpty(partnerForeignLanguage))
//{
// di.ForeignLanguageRequirement += string.Format("<div>{0}</div>",partnerForeignLanguage);
//}
}
private static void GetNotes(ref DegreeInfo di)
{
int listItemdId = DegreeMapperWebAPI.Note.NoteTypeValue.ListItem;
List<Note> list_ucfNotes = DegreeMapperWebAPI.Note.List(di.UCFDegreeId, null).Where(x => x.NoteType == listItemdId).OrderBy(x => x.OrderBy).ToList();
if (list_ucfNotes.Count > 0)
{
foreach (Note n in list_ucfNotes.OrderBy(x => x.OrderBy))
{
di.Notes.Add(n.Value);
}
}
List<Note> list_partnerNotes = DegreeMapperWebAPI.Note.List(di.Id, null).Where(x => x.NoteType == listItemdId).OrderBy(x => x.OrderBy).ToList();
if (list_partnerNotes.Count > 0)
{
foreach (Note n in list_partnerNotes.OrderBy(x => x.OrderBy))
{
di.Notes.Add(n.Value);
}
}
}
}
}