Example #1
0
        public static BoardModel Get(uint idx)
        {
            using (var db = new MySqlDapperHelper())
            {
                string sql = @"
SELECT
	A.idx
	,A.title
	,A.contents
    ,A.reg_user
    ,A.reg_username
    ,A.reg_date
    ,A.view_Cnt
    ,A.status_flag
FROM
	t_board A
WHERE
	A.idx = @idx
";
                return(db.QuerySingle <BoardModel>(sql, new { idx = idx }));
            }
        }
Example #2
0
        internal UserModel GetLoginUser()
        {
            //this.User_Name
            //this.Password

            string    sql = @"
SELECT
    user_seq
    ,user_name
    ,email
    ,password
FROM
    t_user
WHERE
    user_name = @user_name
";
            UserModel user;

            using (var db = new MySqlDapperHelper())
            {
                user = db.QuerySingle <UserModel>(sql, this);
            }

            if (user == null)
            {
                throw new Exception("사용자가 존재하지 않습니다");
            }

            if (user.Password != this.Password)
            {
                throw new Exception("비밀번호가 틀립니다");
                //비밀번호 틀린 횟수 -- update
            }

            return(user);
        }