hytos / ID2.Manager / ID2.Manager.Common / Informations.cs @ 378846cd
이력 | 보기 | 이력해설 | 다운로드 (4.58 KB)
1 | 35d01ef5 | yoush97 | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | |||
7 | using System.ComponentModel; |
||
8 | |||
9 | using ID2.Manager.Data; |
||
10 | using ID2.Manager.Data.Models; |
||
11 | |||
12 | namespace ID2.Manager.Common |
||
13 | { |
||
14 | public class Informations |
||
15 | { |
||
16 | private static readonly Lazy<Informations> lazy = new Lazy<Informations>(() => new Informations()); |
||
17 | |||
18 | public static Informations Instance |
||
19 | { |
||
20 | get { return lazy.Value; } |
||
21 | } |
||
22 | |||
23 | private Informations() |
||
24 | { |
||
25 | |||
26 | } |
||
27 | |||
28 | public UserInfo ActiveUser { get; set; } |
||
29 | d65eb9b2 | yoush97 | public List<ProjectInfo> ActiveProjects { get; set; } = new List<ProjectInfo>(); |
30 | c95d3bca | yoush97 | |
31 | 709c1971 | yoush97 | public List<UserInfo> UserList { get; set; } = new List<UserInfo>(); |
32 | 8e373ccf | yoush97 | public List<ProjectInfo> ProjectList { get; set; } = new List<ProjectInfo>(); |
33 | 709c1971 | yoush97 | |
34 | 370bd7a1 | yoush97 | public string FindID2LocalPath(string ProjectCode) |
35 | { |
||
36 | var proj = this.ProjectList.Where(x => |
||
37 | { |
||
38 | return x.Code.Equals(ProjectCode); |
||
39 | }).FirstOrDefault(); |
||
40 | |||
41 | 473ee829 | yoush97 | return proj == null ? string.Empty : proj.ID2Info.Path; |
42 | 370bd7a1 | yoush97 | } |
43 | |||
44 | 3a78baea | yoush97 | public int? FindID2Port(string ProjectCode) |
45 | { |
||
46 | var proj = this.ProjectList.Where(x => |
||
47 | { |
||
48 | return x.Code.Equals(ProjectCode); |
||
49 | }).FirstOrDefault(); |
||
50 | |||
51 | return proj?.Port; |
||
52 | } |
||
53 | |||
54 | 386286fa | yoush97 | public string FindID2PrjTeam(string ProjectCode) |
55 | { |
||
56 | var proj = this.ProjectList.Where(x => |
||
57 | { |
||
58 | return x.Code.Equals(ProjectCode); |
||
59 | }).FirstOrDefault(); |
||
60 | |||
61 | return proj?.Team; |
||
62 | } |
||
63 | |||
64 | 3af65061 | yoush97 | public ID2ProjectInfo FindID2Project(string ProjectCode) |
65 | { |
||
66 | var proj = this.ProjectList.Where(x => |
||
67 | { |
||
68 | return x.Code.Equals(ProjectCode); |
||
69 | }).FirstOrDefault(); |
||
70 | |||
71 | return proj.ID2Info; |
||
72 | } |
||
73 | |||
74 | d65eb9b2 | yoush97 | public List<ID2ProjectInfo> FindID2ProjectList(List<string> ProjectGroupIDs) |
75 | e62d9509 | yoush97 | { |
76 | d65eb9b2 | yoush97 | //return this.ProjectList.Where(x => |
77 | //{ |
||
78 | // return x.GroupID.Equals(ProjectGroupID); |
||
79 | //}).Select(x => x.ID2Info).ToList(); |
||
80 | return (from allPrj in this.ProjectList |
||
81 | join GrpPrj in ProjectGroupIDs on allPrj.GroupID equals GrpPrj |
||
82 | select allPrj).Select(x => x.ID2Info).ToList(); |
||
83 | e62d9509 | yoush97 | } |
84 | |||
85 | 739003de | yoush97 | public ProjectInfo FindDocProjectGroup(string RefProjectCode) |
86 | { |
||
87 | return (from allPrj in this.ProjectList |
||
88 | join docPrj in this.ProjectList.Where(x => x.Code.Equals(RefProjectCode)) |
||
89 | .ToList() on allPrj.ProjectID equals docPrj.GroupID |
||
90 | select allPrj).FirstOrDefault(); |
||
91 | } |
||
92 | |||
93 | c95d3bca | yoush97 | private readonly List<string> _JobLevel = new List<string>() { "1", "2", "3", "4", "5" }; |
94 | public List<string> JobLevel |
||
95 | { |
||
96 | get { return _JobLevel; } |
||
97 | } |
||
98 | |||
99 | private readonly List<string> _IsYesNo = new List<string>() { "Yes", "No" }; |
||
100 | public List<string> IsYesNo |
||
101 | { |
||
102 | get { return _IsYesNo; } |
||
103 | } |
||
104 | |||
105 | deaa202b | yoush97 | private readonly List<string> _ClientStatus = new List<string>() { "Waiting", "검토중", "회신완료" }; |
106 | c95d3bca | yoush97 | public List<string> ClientStatus |
107 | { |
||
108 | get { return _ClientStatus; } |
||
109 | } |
||
110 | |||
111 | 482f6326 | yoush97 | private readonly List<string> _ValidationResult = new List<string>() { "O", "X" }; |
112 | c95d3bca | yoush97 | public List<string> ValidationResult |
113 | { |
||
114 | get { return _ValidationResult; } |
||
115 | } |
||
116 | |||
117 | private readonly List<string> _JobStatus = new List<string>() { "시작전", "진행중", "완료", "기타" }; |
||
118 | public List<string> JobStatus |
||
119 | { |
||
120 | get { return _JobStatus; } |
||
121 | } |
||
122 | 881c3398 | yoush97 | |
123 | private readonly List<string> _UserRole = new List<string>() { "Admin", "Manager", "User" }; |
||
124 | public List<string> UserRole |
||
125 | { |
||
126 | get { return _UserRole; } |
||
127 | } |
||
128 | 296ffcbd | yoush97 | |
129 | private readonly List<string> _IsSuccess = new List<string>() { "성공", "실패" }; |
||
130 | public List<string> IsSuccess |
||
131 | { |
||
132 | get { return _IsSuccess; } |
||
133 | } |
||
134 | f2776d44 | yoush97 | |
135 | private readonly Dictionary<string, string> _DateType = new Dictionary<string, string>() |
||
136 | { |
||
137 | { "ID2StartDate", "ID2 시작일" }, |
||
138 | b2ff5ff4 | yoush97 | { "ID2EndDate", "ID2 완료일" }, |
139 | f2776d44 | yoush97 | { "AVEVAConvertDate", "AVEVA 변환일" }, |
140 | c8f723a1 | yoush97 | { "AVEVAWorkDate", "AVEVA 작업일" }, |
141 | { "AVEVAReviewDate", "검토일" } |
||
142 | f2776d44 | yoush97 | }; |
143 | public Dictionary<string, string> DateType |
||
144 | { |
||
145 | get { return _DateType; } |
||
146 | } |
||
147 | 35d01ef5 | yoush97 | } |
148 | } |