프로젝트

일반

사용자정보

개정판 9cda6491

ID9cda6491a3f1d0a22ac2849995f7f090d08a4096
상위 61124f6c
하위 241b6337

유성호이(가) 일년 이상 전에 추가함

issue #0000
user 등록/수정
- 기존/신규validation 로직 변경
- 기존인원
- 유저명 체크로직변경
- password 없을 경우는 기존 password 변경 시에는 신규 password
- 자신의 유저정보 변경 시 activeuser 변경하고, 프로젝트 open 시 정보 reload 되도록 수정
- 유저 정보 update 수정

Change-Id: Ic4f761cda648921d1c44bd24c762ac2f9202c076

차이점 보기:

ID2.Manager/ID2.Manager.Dapper/Repository/UserRepository.cs
67 67
                        {
68 68
                            query = $@"
69 69
update dbo.Users
70
set    Password=@Password
71
,Role=@Role
70
set    [Name]=@Name
71
      ,RefProjectID=@RefProjectID
72
      ,Password=@Password
73
      ,Role=@Role
72 74
where  [UID]=@UID;";
73 75
                        }
74 76
                    }
ID2.Manager/ID2.Manager/Forms/AddUser.cs
86 86
            string password = this.radTextBoxPassword.Text.Trim();
87 87
            string confirm = this.radTextBoxConfirm.Text.Trim();
88 88

  
89
            if (this.UserInfo.UID == null)
89
            //ID체크
90
            if (string.IsNullOrEmpty(userId))
90 91
            {
91
                if (string.IsNullOrEmpty(userId))
92
                {
93
                    RadMessageBox.Show("Please enter the ID.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
94
                    this.radTextBoxUserID.Focus();
95
                    return;
96
                }
97
                else
92
                RadMessageBox.Show("Please enter the ID.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
93
                this.radTextBoxUserID.Focus();
94
                return;
95
            }
96
            else
97
            {
98
                bool isValid = Globals.IsMatchEmailFormat(userId);
99
                if (isValid)
98 100
                {
99
                    if (string.IsNullOrEmpty(userId))
100
                    {
101
                        RadMessageBox.Show("Please enter the ID.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
102
                        this.radTextBoxUserName.Focus();
103
                        return;
104
                    }
105
                    else
101
                    if (this.UserInfo.UID == null)
106 102
                    {
107
                        bool isValid = Globals.IsMatchEmailFormat(userId);
108
                        if (isValid)
103
                        if (informations.UserList.Any(x => x.ID.Equals(userId)))
109 104
                        {
110
                            if (informations.UserList.Any(x => x.ID.Equals(userId)))
111
                            {
112
                                RadMessageBox.Show("ID already exists.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
113
                                this.radTextBoxUserID.Focus();
114
                                return;
115
                            }
116
                        }
117
                        else
118
                        {
119
                            RadMessageBox.Show("The ID does not match the email format.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
105
                            RadMessageBox.Show("ID already exists.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
120 106
                            this.radTextBoxUserID.Focus();
121 107
                            return;
122 108
                        }
123
                    }    
109
                    }
110
                }
111
                else
112
                {
113
                    RadMessageBox.Show("The ID does not match the email format.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
114
                    this.radTextBoxUserID.Focus();
115
                    return;
124 116
                }
125
            }            
117
            }
118
            //Name체크
126 119
            if (string.IsNullOrEmpty(userName))
127 120
            {
128 121
                RadMessageBox.Show("Please enter the Name.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
......
131 124
            }
132 125
            else
133 126
            {
134
                if (informations.UserList.Any(x => x.Name.Equals(userName)))
127
                if (this.UserInfo.UID == null)
135 128
                {
136
                    RadMessageBox.Show("Name already exists.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
137
                    this.radTextBoxUserName.Focus();
138
                    return;
129
                    if (informations.UserList.Any(x => x.Name.Equals(userName)))
130
                    {
131
                        RadMessageBox.Show("Name already exists.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
132
                        this.radTextBoxUserName.Focus();
133
                        return;
134
                    }
135
                }
136
                else
137
                {
138
                    if (!this.UserInfo.Name.Equals(userName))
139
                    {
140
                        if (informations.UserList.Any(x => x.Name.Equals(userName)))
141
                        {
142
                            RadMessageBox.Show("Name already exists.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
143
                            this.radTextBoxUserName.Focus();
144
                            return;
145
                        }
146
                    }
139 147
                }
140 148
            }
141
            if (this.UserInfo.UID == null && string.IsNullOrEmpty(password))
142
            {
143
                RadMessageBox.Show("Please enter the Password.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
144
                this.radTextBoxPassword.Focus();
145
                return;
146
            }
147
            if (string.IsNullOrEmpty(password) && string.IsNullOrEmpty(confirm))
149
            //Password
150
            if (this.UserInfo.UID == null)
148 151
            {
149 152
                if (!ValidatePassword(password, out string errorMessage))
150 153
                {
......
162 165
                    }
163 166
                }
164 167
            }
168
            else
169
            {
170
                if (!(string.IsNullOrEmpty(password) && string.IsNullOrEmpty(confirm)))
171
                {
172
                    if (!ValidatePassword(password, out string errorMessage))
173
                    {
174
                        RadMessageBox.Show(errorMessage, Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
175
                        this.radTextBoxPassword.Focus();
176
                        return;
177
                    }
178
                    else
179
                    {
180
                        if (!password.Equals(confirm))
181
                        {
182
                            RadMessageBox.Show("Password is not the same.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
183
                            this.radTextBoxUserID.Focus();
184
                            return;
185
                        }
186
                    }
187
                }
188
            }
189

  
190
            //if (this.UserInfo.UID == null)
191
            //{
192
            //    if (string.IsNullOrEmpty(userId))
193
            //    {
194
            //        RadMessageBox.Show("Please enter the ID.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
195
            //        this.radTextBoxUserID.Focus();
196
            //        return;
197
            //    }
198
            //    else
199
            //    {
200
            //        if (string.IsNullOrEmpty(userId))
201
            //        {
202
            //            RadMessageBox.Show("Please enter the ID.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
203
            //            this.radTextBoxUserName.Focus();
204
            //            return;
205
            //        }
206
            //        else
207
            //        {
208
            //            bool isValid = Globals.IsMatchEmailFormat(userId);
209
            //            if (isValid)
210
            //            {
211
            //                if (informations.UserList.Any(x => x.ID.Equals(userId)))
212
            //                {
213
            //                    RadMessageBox.Show("ID already exists.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
214
            //                    this.radTextBoxUserID.Focus();
215
            //                    return;
216
            //                }
217
            //            }
218
            //            else
219
            //            {
220
            //                RadMessageBox.Show("The ID does not match the email format.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
221
            //                this.radTextBoxUserID.Focus();
222
            //                return;
223
            //            }
224
            //        }    
225
            //    }
226
            //}            
227
            //if (string.IsNullOrEmpty(userName))
228
            //{
229
            //    RadMessageBox.Show("Please enter the Name.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
230
            //    this.radTextBoxUserName.Focus();
231
            //    return;
232
            //}
233
            //else
234
            //{
235
            //    if (informations.UserList.Any(x => x.Name.Equals(userName)))
236
            //    {
237
            //        RadMessageBox.Show("Name already exists.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
238
            //        this.radTextBoxUserName.Focus();
239
            //        return;
240
            //    }
241
            //}
242
            //if (this.UserInfo.UID == null && string.IsNullOrEmpty(password))
243
            //{
244
            //    RadMessageBox.Show("Please enter the Password.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
245
            //    this.radTextBoxPassword.Focus();
246
            //    return;
247
            //}
248
            //if (string.IsNullOrEmpty(password) && string.IsNullOrEmpty(confirm))
249
            //{
250
            //    if (!ValidatePassword(password, out string errorMessage))
251
            //    {
252
            //        RadMessageBox.Show(errorMessage, Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
253
            //        this.radTextBoxPassword.Focus();
254
            //        return;
255
            //    }
256
            //    else
257
            //    {
258
            //        if (!password.Equals(confirm))
259
            //        {
260
            //            RadMessageBox.Show("Password is not the same.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
261
            //            this.radTextBoxUserID.Focus();
262
            //            return;
263
            //        }
264
            //    }
265
            //}
165 266

  
166 267
            if (RadMessageBox.Show("Do you want to Save the User?", Globals.Name, MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
167 268
            {
......
170 271
                this.UserInfo.Name = userName;
171 272
                this.UserInfo.Role = role;
172 273
                this.UserInfo.RefProjectID = projectId;
173
                this.UserInfo.Password = Globals.EncryptionSHA256(password);
274
                this.UserInfo.Password = string.IsNullOrEmpty(password) ? this.UserInfo.Password : Globals.EncryptionSHA256(password);
174 275

  
175 276
                try
176 277
                {
ID2.Manager/ID2.Manager/Forms/SetupUser.cs
149 149
                        informations.UserList.Clear();
150 150
                    allUserList.ToList().ForEach(x => informations.UserList.Add(x.DeepCopy(x)));
151 151

  
152
                    UserInfo userInfo = allUserList.Where(x => x.ID.Equals(informations.ActiveUser.ID)).FirstOrDefault();
153
                    if (userInfo != null)
154
                    {
155
                        informations.ActiveUser = userInfo;
156
                    }
157

  
152 158
                    this.GetUserList();
153 159
                }
154 160
                else
ID2.Manager/ID2.Manager/Main.cs
913 913

  
914 914
        private void LoadProject()
915 915
        {
916
            this.radLabelElementUser.Text = $"{informations.ActiveUser.ID} {informations.ActiveUser.Name}";
917

  
916 918
            try
917 919
            {
918 920
                #region Date

내보내기 Unified diff

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