首次推送
This commit is contained in:
228
Mtxfw.DAL/User_xjcjq.cs
Normal file
228
Mtxfw.DAL/User_xjcjq.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace Mtxfw.DAL
|
||||
{
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD>:User_xjcjq
|
||||
/// </summary>
|
||||
public partial class User_xjcjq : Mtxfw.Utility.Myabstract
|
||||
{
|
||||
public User_xjcjq()
|
||||
: base("User_xjcjq")
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public int Add(Mtxfw.Model.User_xjcjq model)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("insert into User_xjcjq(");
|
||||
strSql.Append("cjId,kqjcs,yqjcs,MemberId,Seef,utype)");
|
||||
strSql.Append(" values (");
|
||||
strSql.Append("@cjId,@kqjcs,@yqjcs,@MemberId,@Seef,@utype)");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@cjId", SqlDbType.Int),
|
||||
new SqlParameter("@kqjcs", SqlDbType.Int),
|
||||
new SqlParameter("@yqjcs", SqlDbType.Int),
|
||||
new SqlParameter("@MemberId", SqlDbType.Int),
|
||||
new SqlParameter("@Seef", SqlDbType.Int),
|
||||
new SqlParameter("@utype", SqlDbType.Int)};
|
||||
parameters[0].Value = model.cjId;
|
||||
parameters[1].Value = model.kqjcs;
|
||||
parameters[2].Value = model.yqjcs;
|
||||
parameters[3].Value = model.MemberId;
|
||||
parameters[4].Value = model.Seef;
|
||||
parameters[5].Value = model.utype;
|
||||
object obj = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
|
||||
if (obj == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToInt32(obj);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD>ѳ齱<D1B3><E9BDB1><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public int Updateyqjcs(int yqjcs, int MemberId, int utype, int Id)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("Update User_xjcjq Set ");
|
||||
strSql.Append("yqjcs=@yqjcs");
|
||||
strSql.Append(" Where MemberId=@MemberId And utype=@utype And Id=@Id");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@yqjcs", SqlDbType.Int),
|
||||
new SqlParameter("@MemberId", SqlDbType.Money),
|
||||
new SqlParameter("@utype", SqlDbType.Int),
|
||||
new SqlParameter("@Id", SqlDbType.Int)};
|
||||
parameters[0].Value = yqjcs;
|
||||
parameters[1].Value = MemberId;
|
||||
parameters[2].Value = utype;
|
||||
parameters[3].Value = Id;
|
||||
object obj = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
|
||||
if (obj == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToInt32(obj);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>״̬
|
||||
/// </summary>
|
||||
public int UpdateSeef(int Seef, int Id)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("Update User_xjcjq Set ");
|
||||
strSql.Append("Seef=@Seef");
|
||||
strSql.Append(" Where Id=@Id");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@Seef", SqlDbType.Int),
|
||||
new SqlParameter("@Id", SqlDbType.Int)};
|
||||
parameters[0].Value = Seef;
|
||||
parameters[1].Value = Id;
|
||||
object obj = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
|
||||
if (obj == null)
|
||||
{
|
||||
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_xjcjq ");
|
||||
int rows = 0;
|
||||
if (Id > 0)
|
||||
{
|
||||
strSql.Append(" where Id=@Id");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@Id", SqlDbType.Int)};
|
||||
parameters[0].Value = Id;
|
||||
|
||||
rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
|
||||
}
|
||||
else
|
||||
{
|
||||
rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString());
|
||||
}
|
||||
if (rows > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20>õ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
/// </summary>
|
||||
public Mtxfw.Model.User_xjcjq GetModel(int Id)
|
||||
{
|
||||
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("select top 1 * from User_xjcjq ");
|
||||
strSql.Append(" where Id=@Id");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@Id", SqlDbType.Int,4)
|
||||
};
|
||||
parameters[0].Value = Id;
|
||||
|
||||
Mtxfw.Model.User_xjcjq model = new Mtxfw.Model.User_xjcjq();
|
||||
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
|
||||
{
|
||||
model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["cjId"].ToString() != "")
|
||||
{
|
||||
model.cjId = int.Parse(ds.Tables[0].Rows[0]["cjId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["kqjcs"].ToString() != "")
|
||||
{
|
||||
model.kqjcs = int.Parse(ds.Tables[0].Rows[0]["kqjcs"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["yqjcs"].ToString() != "")
|
||||
{
|
||||
model.yqjcs = int.Parse(ds.Tables[0].Rows[0]["yqjcs"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["MemberId"].ToString() != "")
|
||||
{
|
||||
model.MemberId = int.Parse(ds.Tables[0].Rows[0]["MemberId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["Seef"].ToString() != "")
|
||||
{
|
||||
model.Seef = int.Parse(ds.Tables[0].Rows[0]["Seef"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["utype"].ToString() != "")
|
||||
{
|
||||
model.utype = int.Parse(ds.Tables[0].Rows[0]["utype"].ToString());
|
||||
}
|
||||
return model;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <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_xjcjq ");
|
||||
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_xjcjq ");
|
||||
if (strWhere.Trim() != "")
|
||||
{
|
||||
strSql.Append(" where " + strWhere);
|
||||
}
|
||||
strSql.Append(" order by " + filedOrder);
|
||||
return Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user