Example #1
0
        internal static int CreateUser(DiscuzUserInfo userinfo)
        {
            int    uid      = -1;
            object resultId =

                SafeProcedure.ExecuteScalar(Database.GetDatabase(D4DDefine.JaneBBSDBInstanceName),
                                            "newbbs.dnt_createuser",
                                            delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@username", userinfo.Username);
                parameters.AddWithValue("@nickname", userinfo.Nickname);
                parameters.AddWithValue("@password", userinfo.Password);
                parameters.AddWithValue("@secques", userinfo.Secques);
                parameters.AddWithValue("@gender", userinfo.Gender);
                parameters.AddWithValue("@adminid", userinfo.Adminid);
                parameters.AddWithValue("@groupid", userinfo.Groupid);
                parameters.AddWithValue("@groupexpiry", userinfo.Groupexpiry);
                parameters.AddWithValue("@extgroupids", userinfo.Extgroupids);
                parameters.AddWithValue("@regip", userinfo.Regip);

                parameters.AddWithValue("@joindate", userinfo.Joindate.ToString("yyyy-MM-dd HH:mm:ss"));
                parameters.AddWithValue("@lastip", userinfo.Lastip);
                parameters.AddWithValue("@lastvisit", userinfo.Lastvisit.ToString("yyyy-MM-dd HH:mm:ss"));
                parameters.AddWithValue("@lastactivity", userinfo.Lastactivity.ToString("yyyy-MM-dd HH:mm:ss"));
                parameters.AddWithValue("@lastpost", userinfo.Lastpost.ToString("yyyy-MM-dd HH:mm:ss"));
                parameters.AddWithValue("@lastpostid", userinfo.Lastpostid);
                parameters.AddWithValue("@lastposttitle", userinfo.Lastposttitle);
                parameters.AddWithValue("@posts", userinfo.Posts);
                parameters.AddWithValue("@digestposts", userinfo.Digestposts);
                parameters.AddWithValue("@oltime", userinfo.Oltime);


                parameters.AddWithValue("@pageviews", userinfo.Pageviews);
                parameters.AddWithValue("@credits", userinfo.Credits);
                parameters.AddWithValue("@extcredits1", userinfo.Extcredits1);
                parameters.AddWithValue("@extcredits2", userinfo.Extcredits2);
                parameters.AddWithValue("@extcredits3", userinfo.Extcredits3);
                parameters.AddWithValue("@extcredits4", userinfo.Extcredits4);
                parameters.AddWithValue("@extcredits5", userinfo.Extcredits5);
                parameters.AddWithValue("@extcredits6", userinfo.Extcredits6);
                parameters.AddWithValue("@extcredits7", userinfo.Extcredits7);
                parameters.AddWithValue("@extcredits8", userinfo.Extcredits8);

                parameters.AddWithValue("@avatarshowid", userinfo.Avatarshowid);
                parameters.AddWithValue("@email", userinfo.Email);
                parameters.AddWithValue("@bday", userinfo.Bday);
                parameters.AddWithValue("@tpp", userinfo.Tpp);
                parameters.AddWithValue("@ppp", userinfo.Ppp);
                parameters.AddWithValue("@templateid", userinfo.Templateid);
                parameters.AddWithValue("@pmsound", userinfo.Pmsound);
                parameters.AddWithValue("@showemail", userinfo.Showemail);
                parameters.AddWithValue("@newsletter", userinfo.Newsletter);
                parameters.AddWithValue("@invisible", userinfo.Invisible);

                parameters.AddWithValue("@newpm", userinfo.Newpm);
                parameters.AddWithValue("@accessmasks", userinfo.Accessmasks);
                parameters.AddWithValue("@website", userinfo.Website);
                parameters.AddWithValue("@icq", userinfo.Icq);
                parameters.AddWithValue("@qq", userinfo.Qq);
                parameters.AddWithValue("@yahoo", userinfo.Yahoo);
                parameters.AddWithValue("@msn", userinfo.Msn);
                parameters.AddWithValue("@skype", userinfo.Skype);
                parameters.AddWithValue("@location", userinfo.Location);
                parameters.AddWithValue("@customstatus", userinfo.Customstatus);

                parameters.AddWithValue("@avatar", userinfo.Avatar);
                parameters.AddWithValue("@avatarwidth", userinfo.Avatarwidth);
                parameters.AddWithValue("@avatarheight", userinfo.Avatarheight);
                parameters.AddWithValue("@medals", userinfo.Medals);
                parameters.AddWithValue("@bio", userinfo.Bio);
                parameters.AddWithValue("@signature", userinfo.Signature);
                parameters.AddWithValue("@sightml", userinfo.Sightml);
                parameters.AddWithValue("@authstr", userinfo.Authstr);
                parameters.AddWithValue("@realname", userinfo.Realname);
                parameters.AddWithValue("@idcard", userinfo.Idcard);

                parameters.AddWithValue("@mobile", userinfo.Mobile);
                parameters.AddWithValue("@phone", userinfo.Phone);
            });

            if (resultId != null)
            {
                uid = (int)resultId;
            }

            return(uid);
        }