hytos / ID2.Manager / ID2.Manager.Controller / Controllers / UserController.cs @ d8bd4799
이력 | 보기 | 이력해설 | 다운로드 (1.64 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 |
try |
18 |
{ |
19 |
using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR)) |
20 |
{ |
21 |
return rep.GetAllUserInfo(); |
22 |
} |
23 |
} |
24 |
catch (Exception ex) |
25 |
{ |
26 |
throw ex; |
27 |
} |
28 |
} |
29 |
|
30 |
public UserInfo GetUserInfo(string userId, string userPW) |
31 |
{ |
32 |
try |
33 |
{ |
34 |
using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR)) |
35 |
{ |
36 |
return rep.GetUserInfo(userId, userPW); |
37 |
} |
38 |
} |
39 |
catch (Exception ex) |
40 |
{ |
41 |
throw ex; |
42 |
} |
43 |
} |
44 |
|
45 |
public bool SetUserInfo(UserInfo userInfo) |
46 |
{ |
47 |
return SetUserInfo(userInfo, DMLType.NONE); |
48 |
} |
49 |
|
50 |
public bool SetUserInfo(UserInfo userInfo, DMLType dmlType) |
51 |
{ |
52 |
bool ret = false; |
53 |
|
54 |
try |
55 |
{ |
56 |
using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR)) |
57 |
{ |
58 |
ret = rep.SetUserInfo(userInfo, dmlType); |
59 |
} |
60 |
} |
61 |
catch(Exception ex) |
62 |
{ |
63 |
throw ex; |
64 |
} |
65 |
|
66 |
return ret; |
67 |
} |
68 |
} |
69 |
} |