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