예제 #1
0
파일: UsersTest.cs 프로젝트: mericyan/dbang
        public void CreateTest()
        {
            var userInfo = new UserInfoEntity();

            userInfo.PromoterId = 5;
            userInfo.RegionId = 3;
            userInfo.Name = "TestUser";
            userInfo.Password = "******";
            userInfo.VerificationCode = "623026";
            userInfo.VerifiedMobileNumber = "15827555778";

            const bool expected = true;
            bool actual = _users.Create(userInfo);

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public bool Update(UserInfoEntity userInfo)
        {
            return true;

            //const string cmdText = "update users set"
            //    + " promoter_id=@promoterId,"
            //    + " region_id=@regionId,"
            //    + " name=@name,"
            //    + " password=@password,"
            //    + " introduction=@introduction,"
            //    + " default_photo=@defaultPhoto,"
            //    + " default_location=@defaultLocation"
            //    + " where"
            //    + " id=@userId";

            //return _database.ExecuteNonQuery(cmdText, new DataParameter("promoterId", userInfo.PromoterId), new DataParameter("regionId", userInfo.RegionId), new DataParameter("name", userInfo.Name), new DataParameter("password", userInfo.Password), new DataParameter("introduction", userInfo.Introduction), new DataParameter("defaultPhoto", userInfo.DefaultPhoto), new DataParameter("defaultLocation", userInfo.DefaultLocation), new DataParameter("userId", userInfo.Id)) == 1;
        }
예제 #3
0
        public bool Create(UserInfoEntity userInfo)
        {
            return true;
            //const string cmdText = "update users set"
            //    + " promoter_id=@promoterId,"
            //    + " region_id=@regionId,"
            //    + " name=@name,"
            //    + " password=@password,"
            //    + " introduction=@introduction,"
            //    + " default_photo=@defaultPhoto,"
            //    + " default_location=@defaultLocation"
            //    + " where"
            //    + " verification_code=@vCode"
            //    + " and verified_mobile_number=@mNumber"
            //    + " insert logins (user_id) values(@userId)";

            //return _database.ExecuteNonQuery(cmdText, new DataParameter("promoterId", userInfo.PromoterId), new DataParameter("regionId", userInfo.RegionId), new DataParameter("name", userInfo.Name), new DataParameter("password", userInfo.Password), new DataParameter("introduction", userInfo.Introduction), new DataParameter("defaultPhoto", userInfo.DefaultPhoto), new DataParameter("defaultLocation", userInfo.DefaultLocation), new DataParameter("vCode", userInfo.VerificationCode), new DataParameter("mNumber", userInfo.VerifiedMobileNumber), new DataParameter("userId", userInfo.Id)) == 2;
        }