hytos / ID2.Manager / ID2.Manager.Controller / Controllers / UserController.cs @ 00d11333
이력 | 보기 | 이력해설 | 다운로드 (1.77 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Threading.Tasks; |
6 |
|
7 |
using ID2.Manager.Dapper; |
8 |
using ID2.Manager.Data.Models; |
9 |
using ID2.Manager.Dapper.Repository; |
10 |
|
11 |
namespace ID2.Manager.Controller.Controllers |
12 |
{ |
13 |
public class UserController : BaseController |
14 |
{ |
15 |
public IEnumerable<UserInfo> GetAllUserInfo() |
16 |
{ |
17 |
IEnumerable<UserInfo> ret = null; |
18 |
|
19 |
try |
20 |
{ |
21 |
using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR)) |
22 |
{ |
23 |
ret = rep.GetAllUserInfo(); |
24 |
} |
25 |
} |
26 |
catch (Exception ex) |
27 |
{ |
28 |
throw ex; |
29 |
} |
30 |
|
31 |
return ret; |
32 |
} |
33 |
|
34 |
public UserInfo GetUserInfo(string userId, string userPW) |
35 |
{ |
36 |
UserInfo ret = null; |
37 |
|
38 |
try |
39 |
{ |
40 |
using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR)) |
41 |
{ |
42 |
ret = rep.GetUserInfo(userId, userPW); |
43 |
} |
44 |
} |
45 |
catch (Exception ex) |
46 |
{ |
47 |
throw ex; |
48 |
} |
49 |
|
50 |
return ret; |
51 |
} |
52 |
|
53 |
public bool SetUserInfo(UserInfo userInfo) |
54 |
{ |
55 |
return SetUserInfo(userInfo, DMLType.NONE); |
56 |
} |
57 |
|
58 |
public bool SetUserInfo(UserInfo userInfo, DMLType dmlType) |
59 |
{ |
60 |
bool ret = false; |
61 |
|
62 |
try |
63 |
{ |
64 |
using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR)) |
65 |
{ |
66 |
ret = rep.SetUserInfo(userInfo, dmlType); |
67 |
} |
68 |
} |
69 |
catch(Exception ex) |
70 |
{ |
71 |
throw ex; |
72 |
} |
73 |
|
74 |
return ret; |
75 |
} |
76 |
} |
77 |
} |