프로젝트

일반

사용자정보

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

markus / ConvertService / ServiceBase / Markus.Service.StationController / ViewModel / ConvertAddDialogViewModel.cs @ 78cffba9

이력 | 보기 | 이력해설 | 다운로드 (7.03 KB)

1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using Telerik.Windows.Controls;
7
using System.IO;
8
using Microsoft.Win32;
9
using Markus.Service.Extensions;
10
using System.Windows;
11
using System.Windows.Controls;
12
using System.ComponentModel;
13

    
14
namespace Markus.Service.StationController.ViewModel
15
{
16
    class ConvertAddDialogViewModel : Mvvm.ToolKit.ViewModelBase
17
    {
18
        #region Construrtor
19

    
20
        public ConvertAddDialogViewModel()
21
        {
22
            ConverAdd_OKCommand = new DelegateCommand(ConverAdd_OK);
23
        }
24

    
25
        #endregion
26

    
27
        #region Propertise
28

    
29
        DataService.DataServiceClient WcfClient = new DataService.DataServiceClient();
30

    
31
        private string _ConverAdd_Project_NO;
32
        public string ConverAdd_Project_NO
33
        {
34
            get { return _ConverAdd_Project_NO; }
35
            set
36
            {
37
                if (_ConverAdd_Project_NO != value)
38
                {
39
                    _ConverAdd_Project_NO = value;
40
                    OnPropertyChanged(() => ConverAdd_Project_NO);
41
                }
42
            }
43
        }
44

    
45
        private string _ConverAdd_DOCUMENT_ID;
46
        public string ConverAdd_DOCUMENT_ID
47
        {
48
            get { return _ConverAdd_DOCUMENT_ID; }
49
            set
50
            {
51
                if (_ConverAdd_DOCUMENT_ID != value)
52
                {
53
                    _ConverAdd_DOCUMENT_ID = value;
54
                    OnPropertyChanged(() => ConverAdd_DOCUMENT_ID);
55
                }
56
            }
57
        }
58

    
59
        private string _ConverAdd_DOCUMENT_URL;
60
        public string ConverAdd_DOCUMENT_URL
61
        {
62
            get { return _ConverAdd_DOCUMENT_URL; }
63
            set
64
            {
65
                if (_ConverAdd_DOCUMENT_URL != value)
66
                {
67
                    _ConverAdd_DOCUMENT_URL = value;
68
                    OnPropertyChanged(() => ConverAdd_DOCUMENT_URL);
69
                }
70
            }
71
        }
72

    
73
        private string _Project_NO_Border = "#FF000000";
74
        public string Project_NO_Border
75
        {
76
            get { return _Project_NO_Border; }
77
            set
78
            {
79
                if (ConverAdd_Project_NO != null)
80
                {
81
                    _Project_NO_Border = "#FF000000";
82
                    OnPropertyChanged(() => Project_NO_Border);
83
                }
84
                else
85
                {
86
                    _Project_NO_Border = "#FFFF0000";
87
                    OnPropertyChanged(() => Project_NO_Border);
88
                }
89
            }
90
        }
91

    
92
        private string _DOCUMENT_ID_Border = "#FF000000";
93
        public string DOCUMENT_ID_Border
94
        {
95
            get { return _DOCUMENT_ID_Border; }
96
            set
97
            {
98
                if (ConverAdd_DOCUMENT_ID != null)
99
                {
100
                    _DOCUMENT_ID_Border = "#FF000000";
101
                    OnPropertyChanged(() => DOCUMENT_ID_Border);
102
                }
103
                else
104
                {
105
                    _DOCUMENT_ID_Border = "#FFFF0000";
106
                    OnPropertyChanged(() => DOCUMENT_ID_Border);
107
                }
108
            }
109
        }
110

    
111
        private string _DOCUMENT_URL_Border = "#FF000000";
112
        public string DOCUMENT_URL_Border
113
        {
114
            get { return _DOCUMENT_URL_Border; }
115
            set
116
            {
117
                if (ConverAdd_DOCUMENT_URL != null)
118
                {
119
                    _DOCUMENT_URL_Border = "#FF000000";
120
                    OnPropertyChanged(() => DOCUMENT_URL_Border);
121
                }
122
                else
123
                {
124
                    _DOCUMENT_URL_Border = "#FFFF0000";
125
                    OnPropertyChanged(() => DOCUMENT_URL_Border);
126
                }
127
            }
128
        }
129

    
130
        private string _Project_NO_Color = "#FFFFFFFF";
131
        public string Project_NO_Color
132
        {
133
            get { return _Project_NO_Color; }
134
            set
135
            {
136
                if (ConverAdd_Project_NO != null)
137
                {
138
                    _Project_NO_Color = "#FFFFFFFF";
139
                    OnPropertyChanged(() => Project_NO_Color);
140
                }
141
                else
142
                {
143
                    _Project_NO_Color = "#FFFF0000";
144
                    OnPropertyChanged(() => Project_NO_Color);
145
                }
146
            }
147
        }
148

    
149
        private string _DOCUMENT_ID_Color = "#FFFFFFFF";
150
        public string DOCUMENT_ID_Color
151
        {
152
            get { return _DOCUMENT_ID_Color; }
153
            set
154
            {
155
                if (ConverAdd_DOCUMENT_ID != null)
156
                {
157
                    _DOCUMENT_ID_Color = "#FFFFFFFF";
158
                    OnPropertyChanged(() => DOCUMENT_ID_Color);
159
                }
160
                else
161
                {
162
                    _DOCUMENT_ID_Color = "#FFFF0000";
163
                    OnPropertyChanged(() => DOCUMENT_ID_Color);
164
                }
165
            }
166
        }
167

    
168
        private string _DOCUMENT_URL_Color = "#FFFFFFFF";
169
        public string DOCUMENT_URL_Color
170
        {
171
            get { return _DOCUMENT_URL_Color; }
172
            set
173
            {
174
                if (ConverAdd_DOCUMENT_URL != null)
175
                {
176
                    _DOCUMENT_URL_Color = "#FFFFFFFF";
177
                    OnPropertyChanged(() => DOCUMENT_URL_Color);
178
                }
179
                else
180
                {
181
                    _DOCUMENT_URL_Color = "#FFFF0000";
182
                    OnPropertyChanged(() => DOCUMENT_URL_Color);
183
                }
184
            }
185
        }
186
        #endregion
187

    
188
        #region Command
189

    
190
        public DelegateCommand ConverAdd_OKCommand { get; private set; }
191

    
192
        #endregion
193

    
194
        #region Fuction
195

    
196
        #region ConverAdd_OK
197
        /// <summary>
198
        /// 그리드 상단 Conver 추가 버튼
199
        /// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 
200
        /// </summary>
201
        public async void ConverAdd_OK(object obj)
202
        {
203
            if (String.IsNullOrEmpty(ConverAdd_Project_NO) || String.IsNullOrEmpty(ConverAdd_DOCUMENT_URL)|| String.IsNullOrEmpty(ConverAdd_DOCUMENT_ID) )
204
            {
205
                Project_NO_Border ="";
206
                DOCUMENT_ID_Border = "";
207
                DOCUMENT_URL_Border = "";
208
                Project_NO_Color = "";
209
                DOCUMENT_ID_Color = "";
210
                DOCUMENT_URL_Color = "";
211
            }
212
            else
213
            {
214
                try
215
                {
216
                    string ConverAdd_ID = GuidExtension.shortGuid();
217
                    var items = await WcfClient.GET_SELECT_CONVERT_INSERTAsync(ConverAdd_ID, ConverAdd_Project_NO, ConverAdd_DOCUMENT_URL, ConverAdd_DOCUMENT_ID);
218
                    System.Diagnostics.Debug.WriteLine(items);
219

    
220
                    MessageBox.Show("데이터베이스에 추가 완료! ");
221
                }
222
                catch (Exception ex)
223
                {
224
                    MessageBox.Show(ex.ToString());
225
                }
226

    
227
                ConverAdd_Project_NO = null;
228
                ConverAdd_DOCUMENT_ID = null;
229
                ConverAdd_DOCUMENT_URL = null;
230
            }
231
        }
232

    
233
        #endregion
234

    
235
        #endregion
236
    }
237
}
클립보드 이미지 추가 (최대 크기: 500 MB)