hytos / ID2.Manager / ID2.Manager.Controller / Controllers / UserController.cs @ 91e72bfe
이력 | 보기 | 이력해설 | 다운로드 (1.59 KB)
1 | 8164f84e | yoush97 | 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 | 709c1971 | yoush97 | public IEnumerable<UserInfo> GetAllUserInfo() |
15 | { |
||
16 | 91e72bfe | yoush97 | 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 | 709c1971 | yoush97 | { |
27 | 91e72bfe | yoush97 | throw ex; |
28 | 709c1971 | yoush97 | } |
29 | 91e72bfe | yoush97 | |
30 | return ret; |
||
31 | 709c1971 | yoush97 | } |
32 | |||
33 | 8164f84e | yoush97 | public UserInfo GetUserInfo(string userId, string userPW) |
34 | { |
||
35 | 91e72bfe | yoush97 | UserInfo ret = null; |
36 | |||
37 | try |
||
38 | 8164f84e | yoush97 | { |
39 | 91e72bfe | yoush97 | using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR)) |
40 | { |
||
41 | ret = rep.GetUserInfo(userId, userPW); |
||
42 | } |
||
43 | 8164f84e | yoush97 | } |
44 | 91e72bfe | yoush97 | 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 | 8164f84e | yoush97 | } |
70 | } |
||
71 | } |