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 |
{
|