public Modeluserinfo getuserinfo() { Blluserinfo blluserinfo = new Blluserinfo(); Modeluserinfo userinfo = blluserinfo.loaduserinfo((int)Session["userid"]); return(userinfo); }
//修改用户详细信息 public int updateUserInfo(Modeluserinfo userinfo) { conn.Open(); string sql = "update tbuserinfo SET user_sex=" + userinfo.userSex + ",user_location='" + userinfo.userLocation + "',user_signature='" + userinfo.userSignature + "',user_rhythm='" + userinfo.userRhythm + "',user_emotion='" + userinfo.userEmotion + "',user_type='" + userinfo.userType + "',user_language='" + userinfo.userLanguage + "',user_singer='" + userinfo.userSinger + "' where user_id=" + userinfo.userId; SqlCommand cmd = new SqlCommand(sql, conn); int temp = cmd.ExecuteNonQuery(); conn.Close(); return(temp); }
//生成用户详细信息 public int insertUserInfo(Modeluserinfo userinfo) { conn.Open(); string sql = "insert into tbuserinfo(user_id,user_sex,user_location,user_signature,user_rhythm,user_emotion,user_type,user_language,user_singer)values(" + userinfo.userId + "," + userinfo.userSex + ",'" + userinfo.userLocation + "','" + userinfo.userSignature + "','" + userinfo.userRhythm + "','" + userinfo.userEmotion + "','" + userinfo.userType + "','" + userinfo.userLanguage + "','" + userinfo.userSinger + "')"; SqlCommand cmd = new SqlCommand(sql, conn); int temp = cmd.ExecuteNonQuery(); conn.Close(); return(temp); }
public static int setUserInfo(string location, string signature, string singer, int sex, string rhythm, string emotion, string type, string language) { Modeluserinfo userinfo = new Modeluserinfo(); userinfo.userId = new inputuserinfo().getId(); userinfo.userLocation = location; userinfo.userSignature = signature; userinfo.userSinger = singer; userinfo.userSex = sex; userinfo.userRhythm = rhythm; userinfo.userEmotion = emotion; userinfo.userType = type; userinfo.userLanguage = language; return(blluserinfo.updateUserInfo(userinfo)); }
//加载用户详细信息 public Modeluserinfo loaduserinfo(int id) { Modeluserinfo userinfo = new Modeluserinfo(); //todo DataSet data = daluserinfo.QueryUsernfoById(id); userinfo.userId = id; userinfo.userSex = (int)data.Tables[0].Rows[0].ItemArray[1]; userinfo.userLocation = data.Tables[0].Rows[0].ItemArray[2].ToString(); userinfo.userSignature = data.Tables[0].Rows[0].ItemArray[3].ToString(); userinfo.userRhythm = data.Tables[0].Rows[0].ItemArray[4].ToString(); userinfo.userEmotion = data.Tables[0].Rows[0].ItemArray[5].ToString(); userinfo.userType = data.Tables[0].Rows[0].ItemArray[6].ToString(); userinfo.userLanguage = data.Tables[0].Rows[0].ItemArray[7].ToString(); userinfo.userSinger = data.Tables[0].Rows[0].ItemArray[8].ToString(); return(userinfo); }
public static int setUserInfo(string username, string userid, string usersex, string userlocation, string usersignature, string userrhythm, string useremotion, string usertype, string userlanguage, string usersinger) { Modeluserinfo userinfo = new Modeluserinfo(); userinfo.userId = int.Parse(userid); userinfo.userSex = int.Parse(usersex); userinfo.userLocation = userlocation; userinfo.userSignature = usersignature; userinfo.userRhythm = userrhythm; userinfo.userEmotion = useremotion; userinfo.userType = usertype; userinfo.userLanguage = userlanguage; userinfo.userSinger = usersinger; blluserinfo.updateUserInfo(userinfo); blluser.updateUserName(int.Parse(userid), username); new updateuserinfo().updateusername(username); return(1); }
//用户注册 public bool signup(Modeluser user) { //判断该用户是否已经注册 if (daluser.is_signout(user.userEmail)) { return(false); } else { daluser.insertuser(user); //查询用户注册后的id int userid = daluser.queryUserIdByEmail(user.userEmail); //根据id插入userinfo,favoriteinfo和recommend bllfavorite.insertFavoriteinfo(userid); Modeluserinfo userinfo = new Modeluserinfo(); userinfo.userId = userid; blluserinfo.insertUserInfo(userinfo); bllrecommend.insertline(userid); return(true); } }
//修改用户详细信息 public int updateUserInfo(Modeluserinfo userinfo) { return(daluserinfo.updateUserInfo(userinfo)); }
//插入用户详细信息 public int insertUserInfo(Modeluserinfo userinfo) { return(daluserinfo.insertUserInfo(userinfo)); }