这是一个数据访问层文件,我没发现有什么构造函数有什么用啊
namespace OldPhotosDAL
{
public class W_OldPhotos
{
public W_OldPhotos()
{ }
#region 成员方法
/// <summary>
/// 增加一条投票数据
/// </summary>
public int AddVoteList(OldPhotosModel.W_OldPhotos_VoteList model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into W_OldPhotos_VoteList(");
strSql.Append("UID,PID)");
strSql.Append(" values (");
strSql.Append("@UID,@PID)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@UID", SqlDbType.NVarChar,100),
new SqlParameter("@PID", SqlDbType.Int,4)
};
parameters[0].Value = model.UID;
parameters[1].Value = model.PID;
object obj = DbHelperSQLl.GetSingle(strSql.ToString(), parameters);
if (obj == null)
{
return 1;
}
else
{
return Convert.ToInt32(obj);
}
}
}
收到一只叮咚
忽然笑
相关分类