프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Controller / Controllers / UserController.cs @ 954de090

이력 | 보기 | 이력해설 | 다운로드 (1.64 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 c52f8bbe yoush97
using ID2.Manager.Dapper;
8 8164f84e yoush97
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 709c1971 yoush97
        public IEnumerable<UserInfo> GetAllUserInfo()
16
        {
17 91e72bfe yoush97
            try
18
            {
19
                using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR))
20
                {
21 82705273 yoush97
                    return rep.GetAllUserInfo();
22 91e72bfe yoush97
                }
23
            }
24
            catch (Exception ex)
25 709c1971 yoush97
            {
26 91e72bfe yoush97
                throw ex;
27 709c1971 yoush97
            }
28
        }
29
30 8164f84e yoush97
        public UserInfo GetUserInfo(string userId, string userPW)
31
        {
32 91e72bfe yoush97
            try
33 8164f84e yoush97
            {
34 91e72bfe yoush97
                using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR))
35
                {
36 82705273 yoush97
                    return rep.GetUserInfo(userId, userPW);
37 91e72bfe yoush97
                }
38 8164f84e yoush97
            }
39 91e72bfe yoush97
            catch (Exception ex)
40
            {
41
                throw ex;
42
            }
43
        }
44
45
        public bool SetUserInfo(UserInfo userInfo)
46
        {
47 c52f8bbe yoush97
            return SetUserInfo(userInfo, DMLType.NONE);
48
        }
49
50
        public bool SetUserInfo(UserInfo userInfo, DMLType dmlType)
51
        {
52 91e72bfe yoush97
            bool ret = false;
53
54
            try
55
            {
56
                using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR))
57
                {
58 c52f8bbe yoush97
                    ret = rep.SetUserInfo(userInfo, dmlType);
59 91e72bfe yoush97
                }
60
            }
61
            catch(Exception ex)
62
            {
63
                throw ex;
64
            }
65
66
            return ret;
67 8164f84e yoush97
        }
68
    }
69
}
클립보드 이미지 추가 (최대 크기: 500 MB)