프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Events / SaveCommand.cs @ 073f6118

이력 | 보기 | 이력해설 | 다운로드 (4.95 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 129ca191 humkyung
        public void Execute(ICollection<MarkupInfoItem> UserStates)
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 129ca191 humkyung
                    ViewerDataModel.Instance.MyMarkupList.Where(d => d.MarkupInfoID == UserState.MarkupInfoID).ToList().GroupBy(p => p.ID).Select(g => g.First()).ToList().ForEach(value =>
82 de6499db humkyung
                    {
83 129ca191 humkyung
                        var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, value.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "",
84
                                        value.MarkupInfoID, value.ID);
85
                        markupdata.Add((control as CommentUserInfo).GetMarkupData(App.ViewInfo.UserID, value.PageNumber, UserState.MarkupVersionID));
86 de6499db humkyung
                    });
87 073f6118 djkim
                    Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveMarkupData(UserState, Project_No, document_id, user_id, markupdata);                    
88 de6499db humkyung
                }
89 073f6118 djkim
                //User Information List Rebind
90
                Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewMarkup.Rebind();
91 a20d338f ljiyeon
                TempFile.Remove(); //임시파일삭제
92 787a4489 KangIngu
            }
93 6c781c0c djkim
            catch (Exception)
94
            {
95
                throw;
96
            }
97 787a4489 KangIngu
        }
98
99
        public void SymbolSave(string Name, string Url, string Data)
100
        {
101 6c781c0c djkim
            try
102 787a4489 KangIngu
            {
103
                SYMBOL_PRIVATE symbol_private = new SYMBOL_PRIVATE
104
                {
105 24678e06 humkyung
                    ID = Commons.shortGuid(),
106 787a4489 KangIngu
                    MEMBER_USER_ID = App.ViewInfo.UserID,
107
                    NAME = Name,
108
                    IMAGE_URL = Url,
109
                    DATA = Data
110
                };
111 0f065e57 ljiyeon
112
                Logger.sendReqLog("SaveSymbolAsync: ", symbol_private.ID + "," + symbol_private.MEMBER_USER_ID + "," + symbol_private.NAME + "," + symbol_private.IMAGE_URL + "," + symbol_private.DATA, 1);
113 6c781c0c djkim
                Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolAsync(symbol_private);
114
            }
115
            catch(Exception)
116
            {
117
                throw;
118
            }
119
        }
120 498f0fc9 ljiyeon
        public void SymbolSave_Public(string Name, string Url, string Data, string Department)
121
        {
122
            try
123
            {
124
                SYMBOL_PUBLIC symbol_public = new SYMBOL_PUBLIC
125
                {
126 24678e06 humkyung
                    ID = Commons.shortGuid(),
127 498f0fc9 ljiyeon
                    DEPARTMENT = Department,
128
                    NAME = Name,
129
                    IMAGE_URL = Url,
130
                    DATA = Data
131
                };
132 787a4489 KangIngu
133 498f0fc9 ljiyeon
                Logger.sendReqLog("AddPublicSymbol: ", symbol_public.ID + "," + symbol_public.DEPARTMENT + "," + symbol_public.NAME + "," + symbol_public.IMAGE_URL + "," + symbol_public.DATA, 1);
134
                Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddPublicSymbol(symbol_public);
135
            }
136
            catch (Exception)
137
            {
138
                throw;
139
            }
140
        }
141 129ca191 humkyung
142 6c781c0c djkim
        public void PageAngleSave(string project_no, List<DOCPAGE> _mldocpage)
143
        {
144
            try
145
            {
146 0f065e57 ljiyeon
                Logger.sendReqLog("SavePageAngle: ", project_no + "," + _mldocpage, 1);
147
                Logger.sendResLog("SavePageAngle", Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SavePageAngle(project_no, _mldocpage).ToString(), 1);
148 2b19f5f2 djkim
                Common.ViewerDataModel.Instance.RotationDocs.Clear();
149 6c781c0c djkim
            }
150
            catch (Exception)
151
            {
152
                throw;
153 787a4489 KangIngu
            }
154
        }
155
    }
156
}
클립보드 이미지 추가 (최대 크기: 500 MB)