Beispiel #1
0
        internal async Task <int> SignUpAsync(IDapperHelper db)
        {
            EMAIL = EmailReplace(EMAIL);

            if (EMAIL.IsNull())
            {
                throw new Exception("이메일을 정확히 입력해주세요");
            }
            if (PASSWORD.IsNull())
            {
                throw new Exception("비밀번호를 정확히 입력해주세요");
            }
            if (USER_NAME.IsNull())
            {
                throw new Exception("닉네임을 정확히 입력해주세요");
            }

            EMAIL     = EMAIL.Trim();
            PASSWORD  = PASSWORD.Trim();
            USER_NAME = USER_NAME.Trim();

            if (PASSWORD.Length < 8)
            {
                throw new Exception("비밀번호를 8자이상 입력해주세요");
            }

            //이메일 중복 확인
            if ((await db.GetQueryFromXmlAsync <int>("User.xml", "GetCheckEmail", this)).FirstOrDefault() > 0)
            {
                throw new Exception("이미 사용중인 이메일 입니다");
            }

            await CheckUserNameAsync(db);

            //U_ID 가져옴
            this.U_ID = (await db.GetQueryFromXmlAsync <uint>("User.xml", "GetSignUp_Uid", new { })).FirstOrDefault();

            //PASSWORD 암호화
            PASSWORD = HMacSha256.GetHMac(PASSWORD, U_ID.ToString());

            //Insert
            return(await db.ExecuteFromXmlAsync("User.xml", "InsertSignUp", this));
        }
Beispiel #2
0
 public override bool Validate()
 {
     return(!(USER_NAME.Trim().Equals("") ||
              USER_PSWD.Trim().Equals("") ||
              GROUP_NAME.Trim().Equals("")));
 }