프로젝트

일반

사용자정보

개정판 669a91cf

ID669a91cfe21f67957b6cfef1857051e4e73c2564
상위 c4c99cb9
하위 4e1260ed, 523c6c0f

김태성이(가) 4년 이상 전에 추가함

효성 AutoApprovalTest 수정

Change-Id: Id8ad597480ff40f45ad204dfb285e224901398bd

차이점 보기:

KCOM_API_AutoStamping/AutoStamping.svc.cs
70 70
            return result;
71 71
        }
72 72

  
73
        [OperationContract]
74
        public ProjectInfo[] GetProjectList()
75
        {
76
            ProjectInfo[] result = null;
77

  
78
            try
79
            {
80
                using (KCOMEntities _entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString()))
81
                {
82
                    result = _entity.RUN_PROJECTS.ToList().Select(x => new ProjectInfo { No = x.PROJECT_NO, Name = $"{x.PROJECT_NO} - {x.PROJECT_NAME}"}).ToArray();
83
                }
84

  
85
            }
86
            catch (Exception)
87
            {
88
            }
89

  
90
            return result;
91
        }
92

  
73 93
        /// <summary>
74 94
        /// 심볼로 변경
75 95
        /// </summary>
......
114 134
                        var user = GetSelectMember(cIEntity, project_no, slip_no, user_id);
115 135

  
116 136

  
117
                        if (user.IS_ORIGINATOR == 0)
137
                        if (user.SLIP_COUNT == 0)
118 138
                        {
119
                            result = "You are not an originator of the slip.";
139
                            result = "Slip No does not exist.";
120 140
                        }
121 141
                        else
122 142
                        {
123
                            if (user.USER_NAME == null)
143
                            if (user.IS_ORIGINATOR == 0)
124 144
                            {
125
                                result = "user name IS NULL.";
145
                                result = "User ID is not the Originator for that Slip No.";
126 146
                            }
127 147
                            else
128 148
                            {
129
                                userName = user.USER_NAME;
130

  
131
                                foreach (DOCUMENT_ITEM dOCUMENTITEM in list)
149
                                if (user.USER_NAME == null)
132 150
                                {
133
                                    DOCINFO dOCINFO = (
134
                                        from x in cIEntity.DOCINFO
135
                                        where x.PROJECT_NO == project_no && x.DOCUMENT_ID == dOCUMENTITEM.DOCUMENT_ID
136
                                        select x).FirstOrDefault<DOCINFO>();
137

  
138
                                    MARKUP_INFO mARKUPINFO = (
139
                                        from x in cIEntity.MARKUP_INFO
140
                                        where x.DOCINFO_ID == dOCINFO.ID && x.AVOID_CONSOLIDATE == 0 && x.CONSOLIDATE == 1
141
                                        select x).FirstOrDefault<MARKUP_INFO>();
151
                                    result = "user name IS NULL.";
152
                                }
153
                                else
154
                                {
155
                                    userName = user.USER_NAME;
142 156

  
143
                                    if (mARKUPINFO == null)
157
                                    foreach (DOCUMENT_ITEM dOCUMENTITEM in list)
144 158
                                    {
145
                                        var pageInfo = dOCINFO.DOCPAGE.First();
159
                                        DOCINFO dOCINFO = (
160
                                            from x in cIEntity.DOCINFO
161
                                            where x.PROJECT_NO == project_no && x.DOCUMENT_ID == dOCUMENTITEM.DOCUMENT_ID
162
                                            select x).FirstOrDefault<DOCINFO>();
146 163

  
147
                                        mARKUPINFO = new MARKUP_INFO()
148
                                        {
149
                                            ID = shortGuid(),
150
                                            DOCINFO_ID = dOCINFO.ID,
151
                                            USER_ID = user_id,
152
                                            CREATE_TIME = DateTime.Now,
153
                                            CONSOLIDATE = 1,
154
                                            AVOID_CONSOLIDATE = 0,
155
                                            PART_CONSOLIDATE = 0,
156
                                            DESCRIPTION = "",
157
                                            UPDATE_TIME = new DateTime?(DateTime.Now),
158
                                        };
159

  
160
                                        cIEntity.MARKUP_INFO.AddObject(mARKUPINFO);
161

  
162
                                        MARKUP_INFO_VERSION mARKUPINFOVERSION = new MARKUP_INFO_VERSION()
164
                                        MARKUP_INFO mARKUPINFO = (
165
                                            from x in cIEntity.MARKUP_INFO
166
                                            where x.DOCINFO_ID == dOCINFO.ID && x.AVOID_CONSOLIDATE == 0 && x.CONSOLIDATE == 1
167
                                            select x).FirstOrDefault<MARKUP_INFO>();
168

  
169
                                        if (mARKUPINFO == null)
163 170
                                        {
164
                                            ID = shortGuid(),
165
                                            MARKUPINFO_ID = mARKUPINFO.ID,
166
                                            CREATE_DATE = DateTime.Now
167
                                        };
171
                                            var pageInfo = dOCINFO.DOCPAGE.First();
168 172

  
169
                                        cIEntity.MARKUP_INFO_VERSION.AddObject(mARKUPINFOVERSION);
173
                                            mARKUPINFO = new MARKUP_INFO()
174
                                            {
175
                                                ID = shortGuid(),
176
                                                DOCINFO_ID = dOCINFO.ID,
177
                                                USER_ID = user_id,
178
                                                CREATE_TIME = DateTime.Now,
179
                                                CONSOLIDATE = 1,
180
                                                AVOID_CONSOLIDATE = 0,
181
                                                PART_CONSOLIDATE = 0,
182
                                                DESCRIPTION = "",
183
                                                UPDATE_TIME = new DateTime?(DateTime.Now),
184
                                            };
170 185

  
171
                                        Point startPoint = new Point(15, 15);
186
                                            cIEntity.MARKUP_INFO.AddObject(mARKUPINFO);
172 187

  
173
                                        var symCtrl = GetSymNControl(Convert.ToDouble(pageInfo.PAGE_WIDTH), Convert.ToDouble(pageInfo.PAGE_HEIGHT), mARKUPINFO.USER_ID, mARKUPINFO.ID, startPoint, _stampData);
188
                                            MARKUP_INFO_VERSION mARKUPINFOVERSION = new MARKUP_INFO_VERSION()
189
                                            {
190
                                                ID = shortGuid(),
191
                                                MARKUPINFO_ID = mARKUPINFO.ID,
192
                                                CREATE_DATE = DateTime.Now
193
                                            };
174 194

  
175
                                        var bottom = Rect.Offset(symCtrl.ItemRect, new Vector(0, symCtrl.ItemRect.Height));
195
                                            cIEntity.MARKUP_INFO_VERSION.AddObject(mARKUPINFOVERSION);
176 196

  
177
                                        var txtOriginator = GetTextControl(Convert.ToDouble(pageInfo.PAGE_WIDTH), Convert.ToDouble(pageInfo.PAGE_HEIGHT), mARKUPINFO.USER_ID, mARKUPINFO.ID
178
                                                       , userName, 20, System.Windows.Media.Color.FromArgb(255, 0, 0, 255), FontWeights.Bold, TextAlignment.Center, bottom, bottom.Top + 3);
197
                                            Point startPoint = new Point(15, 15);
179 198

  
180
                                        var dtfi = new System.Globalization.DateTimeFormatInfo { DateSeparator = "-", ShortDatePattern = @"yyyy/MM/dd" };
199
                                            var symCtrl = GetSymNControl(Convert.ToDouble(pageInfo.PAGE_WIDTH), Convert.ToDouble(pageInfo.PAGE_HEIGHT), mARKUPINFO.USER_ID, mARKUPINFO.ID, startPoint, _stampData);
181 200

  
182
                                        var txtDate = GetTextControl(Convert.ToDouble(pageInfo.PAGE_WIDTH), Convert.ToDouble(pageInfo.PAGE_HEIGHT), mARKUPINFO.USER_ID, mARKUPINFO.ID
183
                                                       , DateTime.Now.ToString("d", dtfi), 20,System.Windows.Media.Color.FromArgb(255, 255, 0, 0), FontWeights.Bold, TextAlignment.Center, bottom, txtOriginator.StartPoint.Y + txtOriginator.BoxHeight + 2);
201
                                            var bottom = Rect.Offset(symCtrl.ItemRect, new Vector(0, symCtrl.ItemRect.Height));
184 202

  
185
                                        var symData = symCtrl.GetMarkupData(mARKUPINFO.USER_ID, 1, mARKUPINFOVERSION.ID);
186
                                        cIEntity.MARKUP_DATA.AddObject(symData);
187
                                        cIEntity.MARKUP_DATA.AddObject(txtOriginator.GetMarkupData(mARKUPINFO.USER_ID, 1, mARKUPINFOVERSION.ID));
188
                                        cIEntity.MARKUP_DATA.AddObject(txtDate.GetMarkupData(mARKUPINFO.USER_ID, 1, mARKUPINFOVERSION.ID));
189
                                    }
190
                                    cIEntity.SaveChanges();
203
                                            var txtOriginator = GetTextControl(Convert.ToDouble(pageInfo.PAGE_WIDTH), Convert.ToDouble(pageInfo.PAGE_HEIGHT), mARKUPINFO.USER_ID, mARKUPINFO.ID
204
                                                           , userName, 20, System.Windows.Media.Color.FromArgb(255, 0, 0, 255), FontWeights.Bold, TextAlignment.Center, bottom, bottom.Top + 3);
191 205

  
206
                                            var dtfi = new System.Globalization.DateTimeFormatInfo { DateSeparator = "-", ShortDatePattern = @"yyyy/MM/dd" };
192 207

  
193
                                    this.SetFinalPDF(project_no, dOCINFO.ID, mARKUPINFO.ID, user_id);
208
                                            var txtDate = GetTextControl(Convert.ToDouble(pageInfo.PAGE_WIDTH), Convert.ToDouble(pageInfo.PAGE_HEIGHT), mARKUPINFO.USER_ID, mARKUPINFO.ID
209
                                                           , DateTime.Now.ToString("d", dtfi), 20, System.Windows.Media.Color.FromArgb(255, 255, 0, 0), FontWeights.Bold, TextAlignment.Center, bottom, txtOriginator.StartPoint.Y + txtOriginator.BoxHeight + 2);
210

  
211
                                            var symData = symCtrl.GetMarkupData(mARKUPINFO.USER_ID, 1, mARKUPINFOVERSION.ID);
212
                                            cIEntity.MARKUP_DATA.AddObject(symData);
213
                                            cIEntity.MARKUP_DATA.AddObject(txtOriginator.GetMarkupData(mARKUPINFO.USER_ID, 1, mARKUPINFOVERSION.ID));
214
                                            cIEntity.MARKUP_DATA.AddObject(txtDate.GetMarkupData(mARKUPINFO.USER_ID, 1, mARKUPINFOVERSION.ID));
215
                                        }
216
                                        cIEntity.SaveChanges();
217

  
218

  
219
                                        this.SetFinalPDF(project_no, dOCINFO.ID, mARKUPINFO.ID, user_id);
220
                                    }
194 221
                                }
195 222
                            }
196 223
                        }
......
700 727
        /// 0보다 크면 originator
701 728
        /// </summary>
702 729
        public int IS_ORIGINATOR { get; set; }
730

  
731
        /// <summary>
732
        /// 해당 SLIP NO가 있는지
733
        /// </summary>
734
        public int SLIP_COUNT { get; set; }
735
    }
736

  
737

  
738
    [DataContract]
739
    public class ProjectInfo
740
    {
741
        [DataMember]
742
        public string No { get; set; }
743

  
744
        [DataMember]
745
        public string Name { get; set; }
703 746
    }
704 747
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)