프로젝트

일반

사용자정보

개정판 84190963

ID84190963486bf08e1f3d453b19fbfceb7bc42abe
상위 efe30d10
하위 c47493ca, 71946024

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

정합성 여부 설정 수정

Change-Id: I1dfa77ec2922cee0be5f2599b6e660ee65d62692

차이점 보기:

KCOM/App.xaml.cs
242 242
#endif
243 243

  
244 244
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
245
                _PemssEndPoint = new EndpointAddress(string.Format("{0}/PemssService.svc", sBaseServiceURL));
245

  
246
#if DEBUG
247
                _PemssEndPoint = new EndpointAddress(string.Format("{0}/PemssService.svc", "http://localhost:13009"));
248
#else
249
                          _PemssEndPoint = new EndpointAddress(string.Format("{0}/PemssService.svc", sBaseServiceURL));
250
#endif
246 251
                await SplashScreenAsnyc();
247 252
                base.OnStartup(e);
248 253

  
KCOM/Behaviors/GridViewAutoWidthBehavior.cs
6 6
using System.Text;
7 7
using System.Threading.Tasks;
8 8
using System.Windows;
9
using System.Windows.Data;
9 10
using System.Windows.Media;
10 11
using System.Windows.Shapes;
11 12
using Telerik.Windows.Controls;
12 13

  
13 14
namespace KCOM.Behaviors
14 15
{
15
    public class GridViewAutoWidthBehavior : System.Windows.Interactivity.Behavior<Telerik.Windows.Controls.RadGridView>
16
    public class GridViewAutoWidthBehavior
16 17
    {
17
        protected override void OnAttached()
18
        private readonly RadGridView gridView = null;
19

  
20
        public static bool GetIsEnabled(DependencyObject obj)
18 21
        {
19
            AssociatedObject.Loaded += AssociatedObject_Loaded;
20
            base.OnAttached();
22
            return (bool)obj.GetValue(IsEnabledProperty);
21 23
        }
22 24

  
23
        protected override void OnDetaching()
25
        public static void SetIsEnabled(DependencyObject obj, bool value)
24 26
        {
25
            AssociatedObject.Loaded -= AssociatedObject_Loaded;
26
            base.OnDetaching();
27
            obj.SetValue(IsEnabledProperty, value);
27 28
        }
28 29

  
29
        private void AssociatedObject_Loaded(object sender, RoutedEventArgs e)
30
        // Using a DependencyProperty as the backing store for IsEnabled.  This enables animation, styling, binding, etc...
31
        public static readonly DependencyProperty IsEnabledProperty =
32
            DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(GridViewAutoWidthBehavior), new PropertyMetadata(false, OnIsEnabledChanged));
33

  
34
        private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
30 35
        {
31
            System.Windows.Controls.Panel panel = null;
36
            RadGridView grid = d as RadGridView;
32 37

  
33
            var obj = VisualTreeHelper.GetParent(AssociatedObject);
38
            if (grid != null)
39
            {
40
                var behavior = new GridViewAutoWidthBehavior(grid);
41
            }
42
        }
34 43

  
35
            if (obj is System.Windows.Controls.Panel)
44
        public GridViewAutoWidthBehavior(RadGridView grid)
45
        {
46
            this.gridView = grid;
47
            if (this.gridView != null)
36 48
            {
37
                panel = obj as System.Windows.Controls.Panel;
38

  
39
                panel.LayoutUpdated += (snd, evt) =>
40
                {
41
                    var margin = AssociatedObject.Margin.Left + AssociatedObject.Margin.Right;
42

  
43
                    var changeValue = panel.DesiredSize.Width - margin;
44

  
45
                    if (AssociatedObject.Width != panel.DesiredSize.Width + margin)
46
                    {
47
                        AssociatedObject.Width = changeValue;
48

  
49
                        foreach (var item in AssociatedObject.Columns)
50
                        {
51
                            if(item.Width.IsAuto)
52
                            {
53
                                item.Width = new GridViewLength(AssociatedObject.Width - AssociatedObject.Columns.Cast<GridViewBoundColumnBase>().Where(x => !x.Width.IsAuto).Sum(x => item.Width.Value),GridViewLengthUnitType.Auto);
54
                            }
55
                        }
56
                    }
57
                };
49
                this.gridView.LoadingRowDetails += new EventHandler<Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs>(OnLoadingRowDetails);
58 50
            }
59 51
        }
52

  
53
        void OnLoadingRowDetails(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
54
        {
55
            var widthProxy = new WidthProxy();
56
            widthProxy.TargetElement = e.DetailsElement;
57
            widthProxy.SetBinding(WidthProxy.WidthProperty, new Binding("ActualWidth") { Source = sender as RadGridView });
58
        }
59

  
60 60
    }
61 61
}
KCOM/Behaviors/WidthProxy.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Windows;
7

  
8
namespace KCOM.Behaviors
9
{
10
    public class WidthProxy : FrameworkElement
11
    {
12
        public FrameworkElement TargetElement
13
        {
14
            get;
15
            set;
16
        }
17

  
18
        // Using a DependencyProperty as the backing store for TargetElement.
19
        public static readonly DependencyProperty TargetElementProperty =
20
        DependencyProperty.Register("TargetElement", typeof(FrameworkElement), typeof(WidthProxy), new PropertyMetadata(OnWidthChanged));
21

  
22
        public double Width
23
        {
24
            get
25
            {
26
                return (double)this.GetValue(WidthProperty);
27
            }
28
            set
29
            {
30
                this.SetValue(WidthProperty, value);
31
            }
32
        }
33

  
34
        public static readonly DependencyProperty WidthProperty =
35
        DependencyProperty.Register("Width", typeof(double), typeof(WidthProxy), new PropertyMetadata(OnWidthChanged));
36

  
37
        private static void OnWidthChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
38
        {
39
            ((WidthProxy)obj).TargetElement.Width = (double)args.NewValue - 50.0;
40
        }
41
    }
42
}
KCOM/Connected Services/PemssService/KCOM.PemssService.DocumentInfo.datasource
6 6
    cause the file to be unrecognizable by the program.
7 7
-->
8 8
<GenericObjectDataSource DisplayName="DocumentInfo" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
9
   <TypeInfo>KCOM.PemssService.DocumentInfo</TypeInfo>
9
   <TypeInfo>KCOM.PemssService.DocumentInfo, Connected Services.PemssService.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
10 10
</GenericObjectDataSource>
KCOM/Connected Services/PemssService/KCOM.PemssService.Requirement.datasource
6 6
    cause the file to be unrecognizable by the program.
7 7
-->
8 8
<GenericObjectDataSource DisplayName="Requirement" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
9
   <TypeInfo>KCOM.PemssService.Requirement</TypeInfo>
9
   <TypeInfo>KCOM.PemssService.Requirement, Connected Services.PemssService.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
10 10
</GenericObjectDataSource>
KCOM/Connected Services/PemssService/PemssService.xsd
44 44
  <xs:element name="ArrayOfVpCommant" nillable="true" type="tns:ArrayOfVpCommant" />
45 45
  <xs:complexType name="VpCommant">
46 46
    <xs:sequence>
47
      <xs:element minOccurs="0" name="bdId" nillable="true" type="xs:string" />
48 47
      <xs:element minOccurs="0" name="comment" nillable="true" type="xs:string" />
49 48
      <xs:element minOccurs="0" name="commentId" nillable="true" type="xs:string" />
50
      <xs:element minOccurs="0" name="condition" nillable="true" type="xs:string" />
51
      <xs:element minOccurs="0" name="dId" nillable="true" type="xs:string" />
49
      <xs:element minOccurs="0" name="condition" type="xs:boolean" />
50
      <xs:element minOccurs="0" name="created" nillable="true" type="xs:string" />
51
      <xs:element minOccurs="0" name="createdBy" nillable="true" type="xs:string" />
52
      <xs:element minOccurs="0" name="createdByName" nillable="true" type="xs:string" />
52 53
      <xs:element minOccurs="0" name="mdId" nillable="true" type="xs:string" />
53
      <xs:element minOccurs="0" name="pId" nillable="true" type="xs:string" />
54
      <xs:element minOccurs="0" name="uId" nillable="true" type="xs:string" />
55 54
    </xs:sequence>
56 55
  </xs:complexType>
57 56
  <xs:element name="VpCommant" nillable="true" type="tns:VpCommant" />
KCOM/Connected Services/PemssService/Reference.cs
305 305
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
306 306
        
307 307
        [System.Runtime.Serialization.OptionalFieldAttribute()]
308
        private string bdIdField;
309
        
310
        [System.Runtime.Serialization.OptionalFieldAttribute()]
311 308
        private string commentField;
312 309
        
313 310
        [System.Runtime.Serialization.OptionalFieldAttribute()]
314 311
        private string commentIdField;
315 312
        
316 313
        [System.Runtime.Serialization.OptionalFieldAttribute()]
317
        private string conditionField;
314
        private bool conditionField;
318 315
        
319 316
        [System.Runtime.Serialization.OptionalFieldAttribute()]
320
        private string dIdField;
317
        private string createdField;
321 318
        
322 319
        [System.Runtime.Serialization.OptionalFieldAttribute()]
323
        private string mdIdField;
320
        private string createdByField;
324 321
        
325 322
        [System.Runtime.Serialization.OptionalFieldAttribute()]
326
        private string pIdField;
323
        private string createdByNameField;
327 324
        
328 325
        [System.Runtime.Serialization.OptionalFieldAttribute()]
329
        private string uIdField;
326
        private string mdIdField;
330 327
        
331 328
        [global::System.ComponentModel.BrowsableAttribute(false)]
332 329
        public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
......
339 336
        }
340 337
        
341 338
        [System.Runtime.Serialization.DataMemberAttribute()]
342
        public string bdId {
343
            get {
344
                return this.bdIdField;
345
            }
346
            set {
347
                if ((object.ReferenceEquals(this.bdIdField, value) != true)) {
348
                    this.bdIdField = value;
349
                    this.RaisePropertyChanged("bdId");
350
                }
351
            }
352
        }
353
        
354
        [System.Runtime.Serialization.DataMemberAttribute()]
355 339
        public string comment {
356 340
            get {
357 341
                return this.commentField;
......
378 362
        }
379 363
        
380 364
        [System.Runtime.Serialization.DataMemberAttribute()]
381
        public string condition {
365
        public bool condition {
382 366
            get {
383 367
                return this.conditionField;
384 368
            }
385 369
            set {
386
                if ((object.ReferenceEquals(this.conditionField, value) != true)) {
370
                if ((this.conditionField.Equals(value) != true)) {
387 371
                    this.conditionField = value;
388 372
                    this.RaisePropertyChanged("condition");
389 373
                }
......
391 375
        }
392 376
        
393 377
        [System.Runtime.Serialization.DataMemberAttribute()]
394
        public string dId {
378
        public string created {
395 379
            get {
396
                return this.dIdField;
380
                return this.createdField;
397 381
            }
398 382
            set {
399
                if ((object.ReferenceEquals(this.dIdField, value) != true)) {
400
                    this.dIdField = value;
401
                    this.RaisePropertyChanged("dId");
383
                if ((object.ReferenceEquals(this.createdField, value) != true)) {
384
                    this.createdField = value;
385
                    this.RaisePropertyChanged("created");
402 386
                }
403 387
            }
404 388
        }
405 389
        
406 390
        [System.Runtime.Serialization.DataMemberAttribute()]
407
        public string mdId {
391
        public string createdBy {
408 392
            get {
409
                return this.mdIdField;
393
                return this.createdByField;
410 394
            }
411 395
            set {
412
                if ((object.ReferenceEquals(this.mdIdField, value) != true)) {
413
                    this.mdIdField = value;
414
                    this.RaisePropertyChanged("mdId");
396
                if ((object.ReferenceEquals(this.createdByField, value) != true)) {
397
                    this.createdByField = value;
398
                    this.RaisePropertyChanged("createdBy");
415 399
                }
416 400
            }
417 401
        }
418 402
        
419 403
        [System.Runtime.Serialization.DataMemberAttribute()]
420
        public string pId {
404
        public string createdByName {
421 405
            get {
422
                return this.pIdField;
406
                return this.createdByNameField;
423 407
            }
424 408
            set {
425
                if ((object.ReferenceEquals(this.pIdField, value) != true)) {
426
                    this.pIdField = value;
427
                    this.RaisePropertyChanged("pId");
409
                if ((object.ReferenceEquals(this.createdByNameField, value) != true)) {
410
                    this.createdByNameField = value;
411
                    this.RaisePropertyChanged("createdByName");
428 412
                }
429 413
            }
430 414
        }
431 415
        
432 416
        [System.Runtime.Serialization.DataMemberAttribute()]
433
        public string uId {
417
        public string mdId {
434 418
            get {
435
                return this.uIdField;
419
                return this.mdIdField;
436 420
            }
437 421
            set {
438
                if ((object.ReferenceEquals(this.uIdField, value) != true)) {
439
                    this.uIdField = value;
440
                    this.RaisePropertyChanged("uId");
422
                if ((object.ReferenceEquals(this.mdIdField, value) != true)) {
423
                    this.mdIdField = value;
424
                    this.RaisePropertyChanged("mdId");
441 425
                }
442 426
            }
443 427
        }
KCOM/KCOM.csproj
259 259
    <Compile Include="AbstractDatabase.cs" />
260 260
    <Compile Include="AppSQLiteDatabase.cs" />
261 261
    <Compile Include="Behaviors\GridViewAutoWidthBehavior.cs" />
262
    <Compile Include="Behaviors\WidthProxy.cs" />
262 263
    <Compile Include="Behaviors\WindowBehavior.cs" />
263 264
    <Compile Include="Common\Check_Inferface.cs" />
264 265
    <Compile Include="Common\Check_Uri.cs" />
......
290 291
      <DependentUpon>addToFavoriteWindow_Internal.xaml</DependentUpon>
291 292
    </Compile>
292 293
    <Compile Include="Converters\StringMultiLineConvert.cs" />
294
    <Compile Include="Views\AddRequirement.xaml.cs">
295
      <DependentUpon>AddRequirement.xaml</DependentUpon>
296
    </Compile>
293 297
    <Compile Include="Views\RequirementView.xaml.cs">
294 298
      <DependentUpon>RequirementView.xaml</DependentUpon>
295 299
    </Compile>
......
383 387
      <SubType>Designer</SubType>
384 388
      <Generator>MSBuild:Compile</Generator>
385 389
    </Page>
390
    <Page Include="Views\AddRequirement.xaml">
391
      <SubType>Designer</SubType>
392
      <Generator>MSBuild:Compile</Generator>
393
    </Page>
386 394
    <Page Include="Views\RequirementView.xaml">
387 395
      <SubType>Designer</SubType>
388 396
      <Generator>MSBuild:Compile</Generator>
KCOM/KCOM.csproj.user
16 16
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQyIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOmZhbHNlLCJOZXdDb21tZW50UGVybWlzc2lvbiI6dHJ1ZSwiUHJvamVjdE5PIjoiMDAwMDAwIiwiVXNlcklEIjoiZG9mdGVjaCIsIk1vZGUiOjB9</StartArguments>
17 17
  </PropertyGroup>
18 18
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
19
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjEyOCIsImJQYXJ0bmVyIjpmYWxzZSwiQ3JlYXRlRmluYWxQREZQZXJtaXNzaW9uIjoidHJ1ZSIsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjoidHJ1ZSIsIlByb2plY3ROTyI6IjExMTExMSIsIlVzZXJJRCI6ImFkbWluIiwiTW9kZSI6MH0=/</StartArguments>
19
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjE0MyIsImJQYXJ0bmVyIjpmYWxzZSwiQ3JlYXRlRmluYWxQREZQZXJtaXNzaW9uIjoidHJ1ZSIsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjoidHJ1ZSIsIlByb2plY3ROTyI6IjExMTExMSIsIlVzZXJJRCI6ImFkbWluIiwiTW9kZSI6MH0=/</StartArguments>
20 20
    <StartAction>Project</StartAction>
21 21
    <StartProgram>C:\Program Files\DOFTECH\MARKUS\KCOM.exe</StartProgram>
22 22
  </PropertyGroup>
KCOM/ViewModel/RequirementViewModel.cs
57 57
            }
58 58
        }
59 59

  
60
        private VpCommant selectVPComment;
61

  
62
        public VpCommant SelectVPComment
63
        {
64
            get
65
            {
66
                return selectVPComment;
67
            }
68
            set
69
            {
70
                if (selectVPComment != value)
71
                {
72
                    selectVPComment = value;
73
                    OnPropertyChanged(() => SelectVPComment);
74
                }
75
            }
76
        }
77
        
60 78

  
61 79
        public AsyncCommand RefreshCommand => new AsyncCommand(()=> OnGetRequirementDataAsync());
62 80

  
63
        public RelayCommand AddVPCommentCommand => new RelayCommand(x => OnAddVPCommentCommand());
81
        public RelayCommand AddVPCommentCommand => new RelayCommand(x => OnAddVPCommentCommand(x));
82

  
83
        public RelayCommand DelVPCommentCommand => new RelayCommand(x => OnDelVPCommentCommand(x));
84

  
85
        public RelayCommand SelectedVPCommentCommand => new RelayCommand(x => OnSelectedVPCommentCommand(x));
64 86

  
65 87

  
66 88
        #region 초기화 및 종료 이벤트
......
102 124
        }
103 125

  
104 126

  
105
        private void OnAddVPCommentCommand()
127
        private void OnAddVPCommentCommand(object obj)
106 128
        {
129
            if (obj == null)
130
            {
131
                selectedComment = null;
132
            }
133
            else
134
            {
135
                SelectRequirement = (obj as Telerik.Windows.Controls.GridView.GridViewRow).DataContext as Requirement;
136
            }
137

  
107 138
            if (SelectRequirement != null && SelectionSet.Instance.SelectedItems?.Count() > 0)
108 139
            {
109
                var parameters = new DialogParameters()
110
                {
111
                    ContentStyle = (Style)App.Current.Resources["AddVpCommantWindowStyle"],
112
                    Content = "마크업에 대한 코멘트 : ",
113
                    Closed = new EventHandler<WindowClosedEventArgs>(OnAddVpCommantWindowClosed),
114
                    Owner = App.Current.Windows.Cast<System.Windows.Window>().FirstOrDefault()
115
                };
140
                Views.AddRequirement addRequirement = new Views.AddRequirement();
141
                addRequirement.Header = "정합성 코멘트 연결 추가";
142
                addRequirement.Width = 600;
143
                addRequirement.Header = 150;
144

  
145
                addRequirement.Closed += new EventHandler<WindowClosedEventArgs>(OnAddVpCommantWindowClosed);
146
                addRequirement.ShowDialogCenter();
147
                
116 148

  
117
                RadWindow.Prompt(parameters);
149
                //var parameters = new DialogParameters()
150
                //{
151
                //    ContentStyle = (Style)App.Current.Resources["AddVpCommantWindowStyle"],
152
                //    Content = "마크업에 대한 코멘트 : ",
153
                //    Closed = new EventHandler<WindowClosedEventArgs>(OnAddVpCommantWindowClosed),
154
                //    Owner = App.Current.Windows.Cast<System.Windows.Window>().FirstOrDefault()
155
                //};
156

  
157
                //RadWindow.Prompt(parameters);
118 158
            }
119 159
            else
120 160
            {
......
129 169
                    };
130 170
                }
131 171

  
132
                if (SelectionSet.Instance.SelectedItems?.Count() > 0)
172
                if (SelectionSet.Instance.SelectedItems == null || SelectionSet.Instance.SelectedItems.Count() == 0)
133 173
                {
134 174
                    parameters = new DialogParameters()
135 175
                    {
......
142 182
            }
143 183
        }
144 184

  
185
        private void OnDelVPCommentCommand(object obj)
186
        {
187
            if(obj is Telerik.Windows.Controls.GridView.GridViewRow)
188
            {
189
                selectedComment = (obj as Telerik.Windows.Controls.GridView.GridViewRow).DataContext as VpCommant;
190

  
191
                var parameters = new DialogParameters()
192
                {
193
                    Content = "해당 Comment를 삭제 하시겠습니까?",
194
                    Closed = new EventHandler<WindowClosedEventArgs>(OnDelVPCommentWindowClosed),
195
                    Owner = App.Current.Windows.Cast<System.Windows.Window>().FirstOrDefault(),
196
                   
197
                };
198

  
199
                RadWindow.Confirm(parameters);
200
            }
201
        }
202

  
203
        private void OnSelectedVPCommentCommand(object obj)
204
        {
205
            if (SelectVPComment != null)
206
            {
207
                var iditems = SelectVPComment.commentId.Split(',');
208

  
209
                var selectComments = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(x=>iditems.Count(y=> y == x.CommentID) > 0).ToList();
210

  
211
                foreach (var item in selectComments)
212
                {
213

  
214
                }
215

  
216
                //selectedComment
217
                //SelectionSet.Instance.SelectControl  = selectedComment;
218

  
219
                //if (instanceFavoVP.PAGE_NO == Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber)
220
                //{
221
                //    Common.ViewerDataModel.Instance.SystemMain.DialogMessage_Alert("You have selected the current page", "Notice");
222
                //}
223
                //else
224
                //{
225
                //    Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(instanceFavoVP.PAGE_NO);
226
                //}
227
            }
228
        }
229

  
230
        private void OnVpCommentSelectCommand(object x)
231
        {
232
            throw new NotImplementedException();
233
        }
234

  
235

  
236
        private VpCommant selectedComment;
237

  
238
        private async void OnDelVPCommentWindowClosed(object sender, WindowClosedEventArgs e)
239
        {
240
            VpCommant deleteComment = selectedComment;
241
            selectedComment = null;
242

  
243
            if (e.DialogResult == true)
244
            {
245
                try
246
                {
247
                    string projectNo = App.ViewInfo.ProjectNO;
248
                    string docId = App.ViewInfo.DocumentItemID;
249
                    string mdId = deleteComment.mdId;
250
                    string userId = deleteComment.createdBy;
251
                    string commentId = deleteComment.commentId;
252

  
253
                    var result = await pemssServiceClient.RemoveRequirementCommentAsync(projectNo, docId, mdId, commentId, userId);
254

  
255
                }
256
                catch (Exception)
257
                {
258
                    MessageBox.Show("삭제 오류");
259
                }
260

  
261
                await OnGetRequirementDataAsync();
262
            }
263
        }
264

  
145 265
        private async void OnAddVpCommantWindowClosed(object sender, WindowClosedEventArgs e)
146 266
        {
147 267
           if(e.DialogResult == true)
148 268
            {
149
                if(string.IsNullOrWhiteSpace(e.PromptResult))
269
                var addrequirement = sender as Views.AddRequirement;
270

  
271
                if(string.IsNullOrWhiteSpace(addrequirement.Comment))
150 272
                {
151 273
                    var parameters = new DialogParameters()
152 274
                    {
......
158 280
                    return;
159 281
                }
160 282

  
161
                string commentOnMarkup = e.PromptResult?.ToString();
283
                string commentOnMarkup = addrequirement.Comment;
162 284

  
163
                string markupId = string.Join(",",SelectionSet.Instance.SelectedItems.Select(f => f.MarkupInfoID));
285
                string markupId = string.Join(",",SelectionSet.Instance.SelectedItems.Select(f => f.CommentID));
164 286
                string projectNo = App.ViewInfo.ProjectNO;
165 287
                string docId = App.ViewInfo.DocumentItemID;
166 288
                string mdId = SelectRequirement.mdId;
167 289
                string userId = App.PEMSSInfo.UserID;
168 290

  
169
                bool condition = true;
291
                bool condition = addrequirement.IsContition;
170 292
         
171 293
                var result = await pemssServiceClient.SetRequirementCommentAsync(projectNo,docId,mdId,markupId,commentOnMarkup,condition,userId);
294

  
295
                await OnGetRequirementDataAsync();
172 296
            }
173 297
        }
174 298

  
KCOM/Views/AddRequirement.xaml
1
<telerik:RadWindow x:Class="KCOM.Views.AddRequirement"
2
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
5
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
6
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
7
             xmlns:local="clr-namespace:KCOM.Views" Header="" HideMaximizeButton="True" HideMinimizeButton="True"
8
             mc:Ignorable="d" CanClose="False" CanMove="False" Width="600" Height="165">
9
    <Grid Background="#FFF1F1F1">
10
        <Grid.RowDefinitions>
11
            <RowDefinition Height="Auto"/>
12
            <RowDefinition Height="Auto"/>
13
            <RowDefinition Height="Auto"/>
14
        </Grid.RowDefinitions>
15
        <Border Margin="5">
16
            <StackPanel Orientation="Vertical" Margin="5">
17
                <TextBlock Text="코멘트 입력 : " FontWeight="Bold" FontFamily="Arial"/>
18
                <TextBox Margin="0,8" x:Name="txtComment" IsTabStop="True" TabIndex="0" Focusable="True" Text=""/>
19
                <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
20
                    <TextBlock Text="정합성 여부 : " FontWeight="Bold" FontFamily="Arial"/>
21
                    <CheckBox x:Name="chkCondition" IsChecked="True"/>
22
                </StackPanel>
23
            </StackPanel>
24
        </Border>
25
        <Grid Grid.Row="2" HorizontalAlignment="Center" Margin="10">
26
            <Grid.ColumnDefinitions>
27
                <ColumnDefinition Width="Auto"/>
28
                <ColumnDefinition Width="20"/>
29
                <ColumnDefinition Width="Auto"/>
30
            </Grid.ColumnDefinitions>
31
            <telerik:RadButton Content="확인" FontSize="12" Height="24" Width="80" Click="Ok_click"/>
32
            <telerik:RadButton Content="취소" Grid.Column="2" FontSize="12" Height="24" Width="80" Click="Cancel_click"/>
33
        </Grid>
34
    </Grid>
35
</telerik:RadWindow>
KCOM/Views/AddRequirement.xaml.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Windows;
7
using System.Windows.Controls;
8
using System.Windows.Data;
9
using System.Windows.Documents;
10
using System.Windows.Input;
11
using System.Windows.Media;
12
using System.Windows.Media.Imaging;
13
using System.Windows.Navigation;
14
using System.Windows.Shapes;
15
using Telerik.Windows.Controls;
16

  
17
namespace KCOM.Views
18
{
19
    /// <summary>
20
    /// AddRequirement.xaml에 대한 상호 작용 논리
21
    /// </summary>
22
    public partial class AddRequirement : RadWindow
23
    {
24
        public AddRequirement()
25
        {
26
            InitializeComponent();
27
        }
28

  
29
        public string Comment { get; set; }
30
        public bool IsContition { get; set; }
31

  
32
        private void Ok_click(object sender, RoutedEventArgs e)
33
        {
34
            Comment = txtComment.Text;
35
            IsContition = chkCondition.IsChecked.GetValueOrDefault();
36

  
37
            this.DialogResult =true;
38
            this.Close();
39
        }
40

  
41
        private void Cancel_click(object sender, RoutedEventArgs e)
42
        {
43
            this.DialogResult = false;
44
            this.Close();
45
        }
46
    }
47
}
KCOM/Views/MainMenu.xaml
538 538
                </telerik:RadPaneGroup>
539 539
            </telerik:RadSplitContainer>
540 540

  
541
            <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedRight" MaxWidth="450" Width="300">
541
            <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedRight" MaxWidth="450" Width="400">
542 542
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Office2016">
543
                    <telerik:RadPane Header="PEMSS" Visibility="Visible" CanFloat="False" CanUserClose="False"  ContextMenuTemplate="{x:Null}" IsPinned="True" telerik:StyleManager.Theme="Office2016" x:Name="pemssPanel">
543
                    <telerik:RadPane Header="PEMSS" Visibility="Visible" CanFloat="False"  CanUserClose="False"  ContextMenuTemplate="{x:Null}" IsPinned="True" telerik:StyleManager.Theme="Office2016" x:Name="pemssPanel">
544 544
                        <view:RequirementView/>
545 545
                    </telerik:RadPane>
546 546
                </telerik:RadPaneGroup>
KCOM/Views/RequirementView.xaml
11 11
        xmlns:Behaviors="clr-namespace:KCOM.Behaviors"
12 12
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
13 13
        mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="350">
14
    <UserControl.DataContext>
14
    <!--<UserControl.DataContext>
15 15
        <viewmodel:RequirementViewModel x:Name="ViewModel"/>
16
    </UserControl.DataContext>
16
    </UserControl.DataContext>-->
17 17
    <i:Interaction.Triggers>
18 18
        <i:EventTrigger  EventName="Loaded">
19 19
            <i:InvokeCommandAction Command="{Binding LoadedCommand}"/>
......
23 23
        </i:EventTrigger>
24 24
    </i:Interaction.Triggers>
25 25
    <UserControl.Resources>
26
        <viewmodel:RequirementViewModel x:Key="ViewModel"/>
26 27
        <convert:StringMultiLineConvert x:Key="StringMultiLineConvert"/>
27 28
    </UserControl.Resources>
29
    <UserControl.DataContext>
30
        <Binding Mode="OneWay" Source="{StaticResource ViewModel}"/>
31
    </UserControl.DataContext>
28 32
    <Grid x:Name="grid" Margin="2" LayoutUpdated="Grid_LayoutUpdated">
29 33
        <Grid.ColumnDefinitions>
30 34
            <ColumnDefinition Width="*"/>
......
42 46
                <ColumnDefinition Width="4"/>
43 47
                <ColumnDefinition/>
44 48
            </Grid.ColumnDefinitions>
45
            <telerik:RadButton Content="추가" Background="#3d3d3d" Foreground="White" Margin="5,0" MinWidth="60" Command="{Binding AddVPCommentCommand}"/>
46
        </Grid>
47
        <WrapPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal">
48
            <telerik:RadToggleButton Width="20" Height="20" Command="{Binding RefreshCommand}" Margin="3">
49
                <Image Stretch="Fill" Source="/KCOM;component/Resources/Images/MenuImage/Refresh.png"/>
50
            </telerik:RadToggleButton>
51
            <!--<telerik:RadToggleButton Width="15" Height="15"  Command="{Binding RefreshCommand}">
49
            <WrapPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal" Visibility="Collapsed">
50
                <telerik:RadButton Content="추가" Background="#3d3d3d" Foreground="White" Margin="5,0" MinWidth="60" Command="{Binding AddVPCommentCommand}"/>
51
                <telerik:RadToggleButton Width="20" Height="20" Command="{Binding RefreshCommand}" Margin="3">
52
                    <Image Stretch="Fill" Source="/KCOM;component/Resources/Images/MenuImage/Refresh.png"/>
53
                </telerik:RadToggleButton>
54
                <!--<telerik:RadToggleButton Width="15" Height="15"  Command="{Binding RefreshCommand}">
52 55
                <Image Stretch="Fill" Source="/KCOM;component/Resources/Images/MenuImage/Refresh.png"/>
53 56
            </telerik:RadToggleButton>-->
54
        </WrapPanel>
57
            </WrapPanel>
58
        </Grid>
59
        
55 60
        <telerik:RadGridView Grid.Row="2" AutoGenerateColumns="False" ItemsSource="{Binding RequirementList}" ShowGroupPanel="False"
56 61
                              CanUserFreezeColumns="False" x:Name="Gridview" SelectedItem="{Binding SelectRequirement}"
57
                              RowIndicatorVisibility="Collapsed" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ColumnWidth="Auto"
62
                              RowIndicatorVisibility="Collapsed" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ColumnWidth="*"
58 63
                              IsExpandedBinding="{Binding IsExpanded,Mode=TwoWay}" IsExpandableBinding="{Binding IsExpandable, Mode=TwoWay}"
59 64
                             GridLinesVisibility="Horizontal" HorizontalGridLinesBrush="Orange">
60
            <i:Interaction.Behaviors>
61
                <behavior:GridViewAutoWidthBehavior/>
62
            </i:Interaction.Behaviors>
63 65
            <telerik:RadGridView.ChildTableDefinitions>
64 66
                <telerik:GridViewTableDefinition/>
65 67
            </telerik:RadGridView.ChildTableDefinitions>
66 68
            <telerik:RadGridView.Columns>
67
                <telerik:GridViewDataColumn Header="Commant" IsReadOnly="True" IsFilterable="False" Width="Auto"
68
                                            TextAlignment="Left" TextWrapping="Wrap"
69
                <telerik:GridViewDataColumn Header="Commant" IsReadOnly="True" IsFilterable="True"
70
                                            TextAlignment="Left" TextWrapping="WrapWithOverflow"
69 71
                                            DataMemberBinding="{Binding mdText,Converter={StaticResource StringMultiLineConvert}}"/>
70 72
            </telerik:RadGridView.Columns>
71 73
            <telerik:RadGridView.HierarchyChildTemplate>
......
77 79
                        </Grid.RowDefinitions>
78 80
                        <Grid.ColumnDefinitions>
79 81
                            <ColumnDefinition Width="10"/>
80
                            <ColumnDefinition Width="Auto"/>
82
                            <ColumnDefinition Width="*"/>
81 83
                        </Grid.ColumnDefinitions>
84
                        <telerik:RadPathButton Width="100" Height="24" HorizontalAlignment="Left" Content="연결 추가" FontSize="12" Grid.ColumnSpan="2" Margin="15,2,2,2"
85
                                                    Command="{Binding AddVPCommentCommand, Source={StaticResource ViewModel}}"
86
                                                    ContentPlacement="Left"
87
                                                    CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewRow}}"
88
                                                   PathGeometry="m4,7l0,2l3,0l0,3l2,0l0,-3l3,0l0,-2l-3,0l0,-3l-2,0l0,3l-3,0zm4,9c-4.41828,0 -8,-3.58172 -8,-8c0,-4.41828 3.58172,-8 8,-8c4.41828,0 8,3.58172 8,8c0,4.41828 -3.58172,8 -8,8zm0,0" >
89
                            <telerik:RadPathButton.PathStyle>
90
                                <Style TargetType="Path">
91
                                    <Setter Property="Width" Value="18"/>
92
                                    <Setter Property="Height" Value="18"/>
93
                                    <Setter Property="Fill" Value="#FF0A93E2" />
94
                                    <Setter Property="Stretch" Value="Fill" />
95
                                    <Setter Property="HorizontalAlignment" Value="Right" />
96
                                    <Setter Property="VerticalAlignment" Value="Center" />
97
                                </Style>
98
                            </telerik:RadPathButton.PathStyle>
99
                        </telerik:RadPathButton>
82 100
                        <telerik:RadGridView x:Name="DetailGridView" GroupRenderMode="Flat" Grid.Row="1"
83 101
										 BorderThickness="0,1,0,1" Grid.Column="1"
84
										 GridLinesVisibility="Horizontal"
85
                                             ScrollViewer.HorizontalScrollBarVisibility="Disabled"
102
										 GridLinesVisibility="Both"
103
                                             ScrollViewer.HorizontalScrollBarVisibility="Disabled"  ColumnWidth="*"
86 104
										 CanUserFreezeColumns="False" HorizontalGridLinesBrush="#FFB0AFAF"
87
										 AutoGenerateColumns="False"
105
										 AutoGenerateColumns="False" behavior:GridViewAutoWidthBehavior.IsEnabled="True"
88 106
										 ItemsSource="{Binding VpComments}"
89
										 ShowGroupPanel="False"
107
										 ShowGroupPanel="False" SelectedItem="{Binding SelectVPComment, Source={StaticResource ViewModel}}"
90 108
										 IsReadOnly="True">
91
                            <i:Interaction.Behaviors>
92
                                <behavior:GridViewAutoWidthBehavior/>
93
                            </i:Interaction.Behaviors>
109
                            <i:Interaction.Triggers>
110
                                <i:EventTrigger  EventName="SelectionChanged">
111
                                    <i:InvokeCommandAction Command="{Binding SelectedVPCommentCommand, Source={StaticResource ViewModel}}"/>
112
                                </i:EventTrigger>
113
                            </i:Interaction.Triggers>
94 114
                            <telerik:RadGridView.Columns>
95
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding createdByName}" MinWidth="60" IsFilterable="False" 
115
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding createdByName}" Width="80" IsFilterable="False" IsReadOnly="True"
96 116
														Header="Create User" />
97
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding comment}" Width="Auto" TextAlignment="Left" TextTrimming="CharacterEllipsis" IsFilterable="False" 
117
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding comment}" TextAlignment="Left" IsReadOnly="True" TextTrimming="CharacterEllipsis" IsFilterable="False" 
98 118
														Header="Comment" />
99
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding condition}" MinWidth="60" IsFilterable="False" 
100
														Header="Condition" />
119
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding condition}" Header="Condition" Width="64"  IsReadOnly="True">
120
                                    <telerik:GridViewDataColumn.CellTemplate>
121
                                        <DataTemplate>
122
                                            <CheckBox IsChecked="{Binding condition, Mode=TwoWay}"/>
123
                                        </DataTemplate>
124
                                    </telerik:GridViewDataColumn.CellTemplate>
125
                                </telerik:GridViewDataColumn>
126
                                <telerik:GridViewDataColumn Width="24" IsFilterable="False" IsReadOnly="True">
127
                                    <telerik:GridViewDataColumn.CellTemplate>
128
                                        <DataTemplate>
129
                                            <telerik:RadPathButton ToolTip="Delete Comment" Height="22" Width="22"
130
                                                    Command="{Binding DelVPCommentCommand, Source={StaticResource ViewModel}}"
131
                                                    CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewRow}}" Background="{x:Null}" BorderBrush="{x:Null}"
132
                                                    PathGeometry="M108.319,108.319c-2.106,2.107-5.523,2.106-7.632-0.001l-0.003-0.003L70.159,77.79L39.63,108.318   c-2.106,2.108-5.523,2.107-7.634,0c-2.104-2.106-2.105-5.523,0-7.633l30.528-30.528l-30.54-30.541   c-2.106-2.104-2.106-5.521,0-7.631c2.105-2.107,5.522-2.107,7.633-0.001l30.541,30.541l30.528-30.527   c2.105-2.105,5.523-2.105,7.633,0c2.109,2.106,2.107,5.524,0,7.633L77.791,70.157l30.527,30.528   C110.427,102.794,110.427,106.212,108.319,108.319 M119.767,119.767c27.396-27.397,27.396-71.818,0-99.217   C92.37-6.849,47.947-6.85,20.547,20.548c-27.397,27.398-27.396,71.819,0.001,99.22C47.947,147.166,92.368,147.165,119.767,119.767">
133
                                            </telerik:RadPathButton>
134
                                        </DataTemplate>
135
                                    </telerik:GridViewDataColumn.CellTemplate>
136
                                </telerik:GridViewDataColumn>
101 137
                            </telerik:RadGridView.Columns>
102 138
                        </telerik:RadGridView>
103 139
                    </Grid>
PemssAPI/DataModel/VpCommant.cs
11 11
    {
12 12

  
13 13
        [DataMember]
14
        public string pId { get; set; }
15

  
16
        [DataMember]
17
        public string dId { get; set; }
18

  
19
        //입력 날짜 
20
        [DataMember]
21 14
        public string mdId { get; set; }
22 15

  
23

  
24 16
        [DataMember]
25
        public string bdId { get; set; }
26

  
17
        public string commentId { get; set; }
27 18

  
28 19
        [DataMember]
29
        public string commentId { get; set; }
20
        public bool condition { get; set; }
30 21

  
31
        //수정 날짜 
32 22
        [DataMember]
33 23
        public string comment { get; set; }
34 24

  
25
        [DataMember]
26
        public string created { get; set; }
35 27

  
36 28
        [DataMember]
37
        public string uId { get; set; }
29
        public string createdBy { get; set; }
38 30

  
39 31
        [DataMember]
40
        public string condition { get; set; }
32
        public string createdByName { get; set; }
41 33
    }
42 34

  
43 35
}
PemssAPI/PemssApi.cs
4 4
using System.Linq;
5 5
using System.Web;
6 6
using PemssAPI.DataModel;
7
using System.Collections.Specialized;
8
using System.Net.Http;
7 9

  
8 10
namespace KCOM_API
9 11
{
12
    /// <summary>
13
    /// 등록은 POST, 삭제시 DELETE , LIST 는 GET 으로 호출해야 합니다.
14
    /// </summary>
10 15
    public class PemssApi : IDisposable
11 16
    {
12 17
        private string gPemssUri;
......
40 45

  
41 46
                    foreach (var item in JArray.Parse(jObject["rows"].ToString()))
42 47
                    {
48
                        List<VpCommant> VpComments = new List<VpCommant>();
49

  
50
                        if (item["vpComments"].HasValues)
51
                        {
52
                            var comments = JArray.Parse(item["vpComments"].ToString());
53

  
54
                            foreach (var comment in comments)
55
                            {
56
                                VpComments.Add(new VpCommant
57
                                {
58
                                    mdId = item["mdId"]?.ToObject<string>(),
59
                                    created = comment["created"]?.ToObject<string>(),
60
                                    comment = comment["comment"]?.ToObject<string>(),
61
                                    commentId = comment["commentId"]?.ToObject<string>(),
62
                                    condition = comment["condition"].HasValues ? comment["condition"].ToObject<bool>() : false,
63
                                    createdBy  = comment["createdBy"]?.ToObject<string>(),
64
                                    createdByName = comment["createdByName"]?.ToObject<string>(),
65
                                });
66
                            }
67
                        }
68

  
43 69
                        result.Add(new Requirement
44 70
                        {
45 71
                            mdId = item["mdId"]?.ToObject<string>(),
46 72
                            mdText = item["mdText"]?.ToObject<string>(),
47 73
                            MrComments = new List<MrCommant>(),
48
                            VpComments = new List<VpCommant>()
74
                            VpComments = VpComments
49 75
                        });
76

  
77

  
50 78
                    }
51 79
                }
52 80
            }
......
77 105
            {
78 106
                //http://pemss.i-on.net/rest/ext/comment/requirement?dId=116&mdId=MD0000000352&commentId=1&comment=test&condition=true&uId=admin
79 107

  
80
                var jsonObj = GetWebClientString($"{gPemssUri}/rest/ext/comment/requirement?" 
81
                                    + $"dId={dId}&mdId={mdId}&commentId={commentId}&comment={comment}&condition={condition}&uId={uId}");
108
                var values = new NameValueCollection(){
109
                    { "dId",dId},
110
                    { "mdId", mdId},
111
                    { "commentId" , commentId},
112
                    { "comment" ,comment},
113
                    { "condition" ,condition.ToString()},
114
                    { "uId", uId}
115
                };
116

  
117
                var jsonObj = SetWebClientString($"{gPemssUri}/rest/ext/comment/requirement", values);
118
                //var jsonObj = GetWebClientString($"{gPemssUri}/rest/ext/comment/requirement?"
119
                //                    + $"dId={dId}&mdId={mdId}&commentId={commentId}&comment={comment}&condition={condition}&uId={uId}");
120

  
82 121
                if (jsonObj != null)
83 122
                {
84 123
                    JObject jObject = JObject.Parse(jsonObj, new JsonLoadSettings());
......
113 152
            try
114 153
            {
115 154
                //http://pemss.i-on.net/rest/ext/comment/requirement?dId=116&mdId=MD0000000352&commentId=1&uId=유저아이디
116
              
117
                var jsonObj = GetWebClientString($"{gPemssUri}/rest/ext/comment/requirement?dId={dId}&mdId={mdId}&commentId={commentId}&uId={uId}");
155

  
156
                var values = new NameValueCollection(){
157
                    { "dId",dId},
158
                    { "mdId", mdId},
159
                    { "commentId" , commentId},
160
                    { "uId", uId}
161
                };
162

  
163
                var jsonObj = DeleteWebClientString($"{gPemssUri}/rest/ext/comment/requirement"
164
                                    + $"dId={dId}&mdId={mdId}&commentId={commentId}&uId={uId}");
165

  
166
                // var jsonObj = DeleteWebClientString($"{gPemssUri}/rest/ext/comment/requirement", values);
118 167

  
119 168
                if (jsonObj != null)
120 169
                {
......
234 283
                return null;
235 284
            }
236 285
        }
286

  
287
        private string SetWebClientString(string uri, NameValueCollection valus)
288
        {
289
            try
290
            {
291
                using (System.Net.WebClient client = new System.Net.WebClient { Encoding = System.Text.Encoding.UTF8 })
292
                {
293
                    var response = client.UploadValues(uri,valus);
294

  
295
                    var result = System.Text.Encoding.UTF8.GetString(response);
296

  
297
                    if (string.IsNullOrWhiteSpace(result.Replace("{", "").Replace("}", "")))
298
                    {
299
                        return null;
300
                    }
301
                    else
302
                    {
303
                        return result;
304
                    }
305
                }
306
            }
307
            catch (Exception ex)
308
            {
309
                return null;
310
            }
311
        }
312

  
313
        private string DeleteWebClientString(string uri)
314
        {
315
            try
316
            {
317
                using (var client = new HttpClient())
318
                {
319
                    var response = client.DeleteAsync(uri);
320

  
321
                    var result = response.Result;
322

  
323
                        return result.IsSuccessStatusCode.ToString();
324
                }
325
            }
326
            catch (Exception ex)
327
            {
328
                return null;
329
            }
330
        }
237 331
    }
238 332
}

내보내기 Unified diff

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