116 lines
3.7 KiB
C#
116 lines
3.7 KiB
C#
|
|
using System;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Data.SqlClient;
|
|||
|
|
|
|||
|
|
namespace Mtxfw.DAL
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD>:user_Results
|
|||
|
|
/// </summary>
|
|||
|
|
public partial class user_info_fenghao : Mtxfw.Utility.Myabstract
|
|||
|
|
{
|
|||
|
|
public user_info_fenghao()
|
|||
|
|
: base("user_info_fenghao")
|
|||
|
|
{ }
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public int Add(Mtxfw.Model.user_info_fenghao model)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql = new StringBuilder();
|
|||
|
|
strSql.Append("insert into user_info_fenghao(");
|
|||
|
|
strSql.Append("MemberId,MemberId2,yuanyin,ResultId,addtime,ttype)");
|
|||
|
|
strSql.Append(" values (");
|
|||
|
|
strSql.Append("@MemberId,@MemberId2,@yuanyin,@ResultId,@addtime,@ttype)");
|
|||
|
|
strSql.Append(";select SCOPE_IDENTITY()");
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@MemberId", SqlDbType.Int),
|
|||
|
|
new SqlParameter("@MemberId2", SqlDbType.Int),
|
|||
|
|
new SqlParameter("@yuanyin", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@ResultId", SqlDbType.BigInt),
|
|||
|
|
new SqlParameter("@addtime", SqlDbType.DateTime),
|
|||
|
|
new SqlParameter("@ttype", SqlDbType.Int)};
|
|||
|
|
parameters[0].Value = model.MemberId;
|
|||
|
|
parameters[1].Value = model.MemberId2;
|
|||
|
|
parameters[2].Value = model.yuanyin;
|
|||
|
|
parameters[3].Value = model.ResultId;
|
|||
|
|
parameters[4].Value = model.addtime;
|
|||
|
|
parameters[5].Value = model.ttype;
|
|||
|
|
string obj = Mtxfw.Utility.SqlDbHelper_U.GetObject(strSql.ToString(), parameters).ToString();
|
|||
|
|
if (obj == "")
|
|||
|
|
{
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return Convert.ToInt32(obj);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// ɾ<><C9BE>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public bool Delete(Int64 Id)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
StringBuilder strSql = new StringBuilder();
|
|||
|
|
strSql.Append("delete from user_info_fenghao");
|
|||
|
|
strSql.Append(" where Id=@Id");
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@Id", SqlDbType.BigInt)
|
|||
|
|
};
|
|||
|
|
parameters[0].Value = Id;
|
|||
|
|
|
|||
|
|
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
|
|||
|
|
if (rows > 0)
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public DataSet GetList(string strWhere)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql = new StringBuilder();
|
|||
|
|
strSql.Append("select * ");
|
|||
|
|
strSql.Append(" FROM user_info_fenghao ");
|
|||
|
|
if (strWhere.Trim() != "")
|
|||
|
|
{
|
|||
|
|
strSql.Append(" where " + strWhere);
|
|||
|
|
}
|
|||
|
|
return Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public DataSet GetList(int Top, string strWhere, string filedOrder)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql = new StringBuilder();
|
|||
|
|
strSql.Append("select ");
|
|||
|
|
if (Top > 0)
|
|||
|
|
{
|
|||
|
|
strSql.Append(" top " + Top.ToString());
|
|||
|
|
}
|
|||
|
|
strSql.Append(" * ");
|
|||
|
|
strSql.Append(" FROM user_info_fenghao ");
|
|||
|
|
if (strWhere.Trim() != "")
|
|||
|
|
{
|
|||
|
|
strSql.Append(" where " + strWhere);
|
|||
|
|
}
|
|||
|
|
strSql.Append(" order by " + filedOrder);
|
|||
|
|
return Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|