예제 #1
0
        //

        public int Add(Person model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [Person](");
            strSql.Append("username,password,age,registerDate,address)");
            strSql.Append(" values (");
            strSql.Append("@username,@password,@age,@registerDate,@address)");
            //
            var id = DbHelperSql.InsertReturnId(strSql.ToString(), model);

            return(id);
        }
예제 #2
0
        //

        public int Add(User model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [User](");
            strSql.Append("Username,PasswordHash,Email,PhoneNumber,IsFirstTimeLogin,AccessFailedCount,CreationDate,IsActive)");
            strSql.Append(" values (");
            strSql.Append("@Username,@PasswordHash,@Email,@PhoneNumber,@IsFirstTimeLogin,@AccessFailedCount,@CreationDate,@IsActive)");
            //
            var id = DbHelperSql.InsertReturnId(strSql.ToString(), model);

            return(id);
        }