2008-01-16 16:37
接上面 第三步 SQLDAL 放操作层 (操作类) Member(一)
///
/// 编辑用户信息
///
/// 会员对象
///
public int EditMemberInfo(Member member)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERNAME, member.MemberName),
new SqlParameter(PARM_MEMBERINFO_SEX, member.Sex),
new SqlParameter(PARM_MEMBERINFO_BIRTHDAY, member.Birthday),
new SqlParameter(PARM_RETURN_VALUE, SqlDbType.Int)
};
sqlpar[sqlpar.Length - 1].Direction = ParameterDirection.ReturnValue;
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalBuygoMember, CommandType.StoredProcedure, "proc_EditMemberInfo", sqlpar);
return int.Parse(sqlpar[sqlpar.Length - 1].Value.ToString());
}
///
/// 加载用户的基本信息
///
/// 用户名称
///
public Member LoadBaseMember(string memberName)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERNAME, memberName)
};
DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalBuygoMember, CommandType.StoredProcedure, "proc_SEL_BaseMemberInfo", sqlpar).Tables[0];
string sex = dt.Rows[0]["Sex"].ToString();
DateTime birthday = DateTime.Parse(dt.Rows[0]["Birthday"].ToString());
City city = new City(int.Parse(dt.Rows[0]["CityID"].ToString()), dt.Rows[0]["CityName"].ToString(), dt.Rows[0]["ProvinceName"].ToString());
string mobilePhone = dt.Rows[0]["MobilePhone"].ToString();
string telephone = dt.Rows[0]["Telephone"].ToString();
string qq = dt.Rows[0]["QQ"].ToString();
string msn = dt.Rows[0]["MSN"].ToString();
string email = dt.Rows[0]["E-Mail"].ToString();
string paopao = dt.Rows[0]["Paopao"].ToString();
string other = dt.Rows[0]["Other"].ToString();
string icq = dt.Rows[0]["ICQ"].ToString();
return new Member(0, memberName, sex, birthday, city, mobilePhone, telephone, qq, msn, email, paopao, other, icq);
}
//查看会员
public DataTable MemberList()
{
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalBuygoMember, CommandType.StoredProcedure, "proc_BuygoMember_SEL_MemberInfo").Tables[0];//proc_BuygoMember_SEL_MemberInfo//FK_FRIENDLI_REFERENCE_MEMBERIN
}
public DataTable MemberList(string membername)
{
SqlParameter[] sqlper = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERNAME,membername)
};
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalBuygoMember, CommandType.StoredProcedure, "proc_SEL_BaseMemberInfo", sqlper).Tables[0];//proc_SEL_BaseMemberInfo
}
public DataTable BaseList()
{
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_SELBaseInfo").Tables[0];//proc_BuygoMember_SEL_MemberInfo//FK_FRIENDLI_REFERENCE_MEMBERIN
}
public DataTable NewMemberlist()
{
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_SEL_NEWMember").Tables[0];
}
public DataTable TopClick()
{
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_SEL_Top_Member").Tables[0];
}
//会员推荐
public int Recom(string membername)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERNAME,membername),
new SqlParameter(PARM_RETURN_VALUE, SqlDbType.Int)
};
sqlpar[sqlpar.Length - 1].Direction = ParameterDirection.ReturnValue;
SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_EditRecom", sqlpar);//proc_SEL_BaseMemberInfo
return int.Parse(sqlpar[sqlpar.Length - 1].Value.ToString());
}
//删除会员
public void DelMember(int MemberName)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERNAME,MemberName)
};
SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalBuygoMember, CommandType.StoredProcedure, "proc_BuygoMember_DELMemberInfo", sqlpar);//proc_SEL_BaseMemberInfo
}
//判断性别
public DataTable sex(string MemberName)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter (PARM_MEMBERINFO_MEMBERNAME,MemberName)
};
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalBuygoMember, CommandType.StoredProcedure, "proc_BuygoMember_SEL_sex", sqlpar).Tables[0];
}
public string UpdataPassword(string question, string password, string answer, string MemberName)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_PASSWORD,password),
new SqlParameter(PARM_MEMBERINFO_ANSWER,answer),
new SqlParameter(PARM_MEMBERINFO_QUESTION,question),
new SqlParameter(PARM_MEMBERINFO_MEMBERNAME,MemberName),
new SqlParameter(PARM_RETURN_VALUE,SqlDbType.Int),
};
sqlpar[sqlpar.Length - 1].Direction = ParameterDirection.ReturnValue;
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalBuygoMember, CommandType.StoredProcedure, "proc_updatePassword", sqlpar);
return sqlpar[sqlpar.Length - 1].Value.ToString();
}
public DataSet GetMemberInfo(string memberID)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERID,memberID)
};
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_SEL_FriendInfo_FV2", sqlpar);
}
public DataTable IDname(string MemberID)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter (PARM_MEMBERINFO_MEMBERID,MemberID)
};
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_SEL_IDNAME", sqlpar).Tables[0];
}
///
///
///
///
///
public void UpdataUserhead(string memberID, string picturename)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERID,memberID),
new SqlParameter(PARM_MEMBERINFO_PICTURENAME,picturename),
};
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_updatauserhead", sqlpar);
}
public DataSet GetSomeoneinfo(string memberID)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERID,memberID)
};
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_friend_info", sqlpar);
}
public DataSet ShowAll(string memberID)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter (PARM_MEMBERINFO_MEMBERID,memberID)
};
return SqlHelper .ExecuteDataset(SqlHelper .ConnectionStringLocalFriednDB,CommandType.StoredProcedure,"proc_Friend_SeLAll",sqlpar);
}
查询用户头像
public DataTable headphoto(string MemberID)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter (PARM_MEMBERINFO_MEMBERID,MemberID)
};
return SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_SEL_HeadPhoto",sqlpar).Tables[0];
}
//查看会员
public int AddMerID(string MemberID, string LMemberID)
{
SqlParameter[] sqlpar = new SqlParameter[]
{
new SqlParameter(PARM_MEMBERINFO_MEMBERID, MemberID),
new SqlParameter(PARM_MEMBERINFO_L_MEMBERID, LMemberID),
new SqlParameter(PARM_RETURN_VALUE, SqlDbType.Int)
};
sqlpar[sqlpar.Length - 1].Direction = ParameterDirection.ReturnValue;
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalFriednDB, CommandType.StoredProcedure, "proc_Friend_AddLookMember", sqlpar);
return int.Parse(sqlpar[sqlpar.Length - 1].Value.ToString());
}
///查看过的会员
public DataTable LookMember(string MemberID)
{
SqlParameter [] sqlpar=new SqlParameter []
{
new SqlParameter (PARM_MEMBERINFO_MEMBERID, MemberID)
};
return SqlHelper .ExecuteDataset (SqlHelper .ConnectionStringLocalFriednDB,CommandType.StoredProcedure,"proc_Friend_SEL_LOOK",sqlpar ).Tables[0];
}
}
}