markus / KCOM / Events / SaveCommand.cs @ 54e35b39
이력 | 보기 | 이력해설 | 다운로드 (4.77 KB)
1 | 787a4489 | KangIngu | using IKCOM; |
---|---|---|---|
2 | using KCOM.Common; |
||
3 | using KCOMDataModel.Common; |
||
4 | using KCOMDataModel.DataModel; |
||
5 | using MarkupToPDF.Common; |
||
6 | using MarkupToPDF.Controls.Parsing; |
||
7 | using System; |
||
8 | using System.Collections.Generic; |
||
9 | using System.Linq; |
||
10 | using System.Text; |
||
11 | using System.Windows.Controls; |
||
12 | |||
13 | namespace KCOM.Events |
||
14 | { |
||
15 | de6499db | humkyung | public class SaveCommand |
16 | 787a4489 | KangIngu | { |
17 | de6499db | humkyung | private static readonly SaveCommand _instance = new SaveCommand(); |
18 | |||
19 | // Explicit static constructor to tell C# compiler |
||
20 | // not to mark type as beforefieldinit |
||
21 | static SaveCommand() |
||
22 | { |
||
23 | } |
||
24 | |||
25 | private SaveCommand() |
||
26 | { |
||
27 | } |
||
28 | |||
29 | public static SaveCommand Instance |
||
30 | { |
||
31 | get |
||
32 | { |
||
33 | return _instance; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | 787a4489 | KangIngu | #region Properties |
38 | |||
39 | public ViewInfo _ViewInfo; |
||
40 | public string Project_No |
||
41 | { |
||
42 | get; |
||
43 | set; |
||
44 | } |
||
45 | public string document_id |
||
46 | { |
||
47 | get; |
||
48 | set; |
||
49 | } |
||
50 | |||
51 | public string user_id |
||
52 | { |
||
53 | get; |
||
54 | set; |
||
55 | } |
||
56 | |||
57 | public int page_no |
||
58 | { |
||
59 | get; |
||
60 | set; |
||
61 | } |
||
62 | #endregion |
||
63 | |||
64 | public void MarkupConsolidate() |
||
65 | { |
||
66 | |||
67 | } |
||
68 | |||
69 | de6499db | humkyung | /// <summary> |
70 | /// save comments related to given markup information |
||
71 | /// </summary> |
||
72 | /// <param name="UserState"></param> |
||
73 | /// <param name="iPageNo"></param> |
||
74 | public void Execute(ICollection<MarkupInfoItem> UserStates, int iPageNo) |
||
75 | 787a4489 | KangIngu | { |
76 | 6c781c0c | djkim | try |
77 | 787a4489 | KangIngu | { |
78 | de6499db | humkyung | foreach (var UserState in UserStates) |
79 | 787a4489 | KangIngu | { |
80 | de6499db | humkyung | List<MARKUP_DATA> markupdata = new List<MARKUP_DATA>(); |
81 | ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == UserState.MarkupInfoID).ToList().GroupBy(p => p.CommentID).Select(g => g.First()).ToList().ForEach(value => |
||
82 | { |
||
83 | markupdata.Add(value.GetMarkupData(App.ViewInfo.UserID, iPageNo, UserState.MarkupVersionID)); |
||
84 | }); |
||
85 | |||
86 | Logger.sendReqLog("GetMarkupDataListperPage: ", UserState + "," + Project_No + "," + document_id + "," + user_id + "," + markupdata, 1); |
||
87 | Logger.sendResLog("GetMarkupDataListperPage", Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveMarkupData(UserState, Project_No, document_id, user_id, markupdata).ToString(), 1); |
||
88 | } |
||
89 | a20d338f | ljiyeon | TempFile.Remove(); //임시파일삭제 |
90 | 787a4489 | KangIngu | } |
91 | 6c781c0c | djkim | catch (Exception) |
92 | { |
||
93 | throw; |
||
94 | } |
||
95 | 787a4489 | KangIngu | } |
96 | |||
97 | public void SymbolSave(string Name, string Url, string Data) |
||
98 | { |
||
99 | 6c781c0c | djkim | try |
100 | 787a4489 | KangIngu | { |
101 | SYMBOL_PRIVATE symbol_private = new SYMBOL_PRIVATE |
||
102 | { |
||
103 | 24678e06 | humkyung | ID = Commons.shortGuid(), |
104 | 787a4489 | KangIngu | MEMBER_USER_ID = App.ViewInfo.UserID, |
105 | NAME = Name, |
||
106 | IMAGE_URL = Url, |
||
107 | DATA = Data |
||
108 | }; |
||
109 | 0f065e57 | ljiyeon | |
110 | Logger.sendReqLog("SaveSymbolAsync: ", symbol_private.ID + "," + symbol_private.MEMBER_USER_ID + "," + symbol_private.NAME + "," + symbol_private.IMAGE_URL + "," + symbol_private.DATA, 1); |
||
111 | 6c781c0c | djkim | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolAsync(symbol_private); |
112 | } |
||
113 | catch(Exception) |
||
114 | { |
||
115 | throw; |
||
116 | } |
||
117 | } |
||
118 | 498f0fc9 | ljiyeon | public void SymbolSave_Public(string Name, string Url, string Data, string Department) |
119 | { |
||
120 | try |
||
121 | { |
||
122 | SYMBOL_PUBLIC symbol_public = new SYMBOL_PUBLIC |
||
123 | { |
||
124 | 24678e06 | humkyung | ID = Commons.shortGuid(), |
125 | 498f0fc9 | ljiyeon | DEPARTMENT = Department, |
126 | NAME = Name, |
||
127 | IMAGE_URL = Url, |
||
128 | DATA = Data |
||
129 | }; |
||
130 | 787a4489 | KangIngu | |
131 | 498f0fc9 | ljiyeon | Logger.sendReqLog("AddPublicSymbol: ", symbol_public.ID + "," + symbol_public.DEPARTMENT + "," + symbol_public.NAME + "," + symbol_public.IMAGE_URL + "," + symbol_public.DATA, 1); |
132 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddPublicSymbol(symbol_public); |
||
133 | } |
||
134 | catch (Exception) |
||
135 | { |
||
136 | throw; |
||
137 | } |
||
138 | } |
||
139 | 6c781c0c | djkim | public void PageAngleSave(string project_no, List<DOCPAGE> _mldocpage) |
140 | { |
||
141 | try |
||
142 | { |
||
143 | 0f065e57 | ljiyeon | |
144 | Logger.sendReqLog("SavePageAngle: ", project_no + "," + _mldocpage, 1); |
||
145 | Logger.sendResLog("SavePageAngle", Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SavePageAngle(project_no, _mldocpage).ToString(), 1); |
||
146 | 2b19f5f2 | djkim | Common.ViewerDataModel.Instance.RotationDocs.Clear(); |
147 | 6c781c0c | djkim | } |
148 | catch (Exception) |
||
149 | { |
||
150 | throw; |
||
151 | 787a4489 | KangIngu | } |
152 | } |
||
153 | } |
||
154 | } |