代码修改后的版本,全部提交
This commit is contained in:
207
Mtxfw.DAL/user_zzjf_log.cs
Normal file
207
Mtxfw.DAL/user_zzjf_log.cs
Normal file
@@ -0,0 +1,207 @@
|
||||
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_zzjf_log : Mtxfw.Utility.Myabstract
|
||||
{
|
||||
public user_zzjf_log()
|
||||
: base("user_zzjf_log")
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public Int64 Add(Mtxfw.Model.user_zzjf_log model)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("insert into user_zzjf_log(");
|
||||
strSql.Append("num,zznum,zzjg,zzjf,xzjf,addtime,seef,seeftime,gtype)");
|
||||
strSql.Append(" values (");
|
||||
strSql.Append("@num,@zznum,@zzjg,@zzjf,@xzjf,@addtime,@seef,@seeftime,@gtype)");
|
||||
strSql.Append(";select SCOPE_IDENTITY()");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@num", SqlDbType.Decimal),
|
||||
new SqlParameter("@zznum", SqlDbType.Decimal),
|
||||
new SqlParameter("@zzjg", SqlDbType.Decimal),
|
||||
new SqlParameter("@zzjf", SqlDbType.Decimal),
|
||||
new SqlParameter("@xzjf", SqlDbType.Decimal),
|
||||
new SqlParameter("@addtime", SqlDbType.DateTime),
|
||||
new SqlParameter("@seef", SqlDbType.Int),
|
||||
new SqlParameter("@seeftime", SqlDbType.DateTime),
|
||||
new SqlParameter("@gtype", SqlDbType.Int)};
|
||||
parameters[0].Value = model.num;
|
||||
parameters[1].Value = model.zznum;
|
||||
parameters[2].Value = model.zzjg;
|
||||
parameters[3].Value = model.zzjf;
|
||||
parameters[4].Value = model.xzjf;
|
||||
parameters[5].Value = model.addtime;
|
||||
parameters[6].Value = model.seef;
|
||||
parameters[7].Value = model.seeftime;
|
||||
parameters[8].Value = model.gtype;
|
||||
string obj = Mtxfw.Utility.SqlDbHelper_U.GetObject(strSql.ToString(), parameters).ToString();
|
||||
if (obj == "")
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToInt64(obj);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>˻<EFBFBD><CBBB><EFBFBD>ɾ<EFBFBD><C9BE>
|
||||
/// </summary>
|
||||
public int UpdateSeef(string Sel, int SelValue, string Sel2, DateTime dt, Int64 id)
|
||||
{
|
||||
String sql = "update user_zzjf_log set " + Sel + "=@SelValue," + Sel2 + "=@dt where id=@id";
|
||||
SqlParameter[] para = { new SqlParameter("@SelValue", SqlDbType.Int),
|
||||
new SqlParameter("@dt", SqlDbType.DateTime),
|
||||
new SqlParameter("@id", SqlDbType.BigInt) };
|
||||
para[0].Value = SelValue;
|
||||
para[1].Value = dt;
|
||||
para[2].Value = id;
|
||||
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>״̬
|
||||
/// </summary>
|
||||
public int UpdateSeef(int SelValue, Int64 id)
|
||||
{
|
||||
String sql = "update user_zzjf_log set seef=@SelValue where id=@id";
|
||||
SqlParameter[] para = { new SqlParameter("@SelValue", SqlDbType.Int),
|
||||
new SqlParameter("@id", SqlDbType.BigInt)};
|
||||
para[0].Value = SelValue;
|
||||
para[1].Value = id;
|
||||
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
/// </summary>
|
||||
public int UpdateSeef(DateTime dt, Int64 id)
|
||||
{
|
||||
String sql = "update user_zzjf_log set seeftime=@dt where id=@id";
|
||||
SqlParameter[] para = { new SqlParameter("@dt", SqlDbType.DateTime),
|
||||
new SqlParameter("@id", SqlDbType.BigInt)};
|
||||
para[0].Value = dt;
|
||||
para[1].Value = id;
|
||||
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ɾ<><C9BE>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public bool Delete(Int64 id)
|
||||
{
|
||||
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("delete from user_zzjf_log");
|
||||
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><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
/// </summary>
|
||||
public Mtxfw.Model.user_zzjf_log GetModel(Int64 id)
|
||||
{
|
||||
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("select top 1 * from user_zzjf_log");
|
||||
strSql.Append(" where id=@id");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@id", SqlDbType.BigInt)
|
||||
};
|
||||
parameters[0].Value = id;
|
||||
|
||||
Mtxfw.Model.user_zzjf_log model = new Mtxfw.Model.user_zzjf_log();
|
||||
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
model.id = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString());
|
||||
model.num = Convert.ToDecimal(ds.Tables[0].Rows[0]["num"].ToString());
|
||||
model.zznum = Convert.ToDecimal(ds.Tables[0].Rows[0]["zznum"].ToString());
|
||||
model.zzjg = Convert.ToDecimal(ds.Tables[0].Rows[0]["zzjg"].ToString());
|
||||
model.zzjf = Convert.ToDecimal(ds.Tables[0].Rows[0]["zzjf"].ToString());
|
||||
if (ds.Tables[0].Rows[0]["addtime"].ToString() != "")
|
||||
{
|
||||
model.addtime = DateTime.Parse(ds.Tables[0].Rows[0]["addtime"].ToString());
|
||||
}
|
||||
model.seef = int.Parse(ds.Tables[0].Rows[0]["seef"].ToString());
|
||||
if (ds.Tables[0].Rows[0]["seeftime"].ToString() != "")
|
||||
{
|
||||
model.seeftime = DateTime.Parse(ds.Tables[0].Rows[0]["seeftime"].ToString());
|
||||
}
|
||||
model.IFDelete = int.Parse(ds.Tables[0].Rows[0]["IFDelete"].ToString());
|
||||
if (ds.Tables[0].Rows[0]["IFDeleteTime"].ToString() != "")
|
||||
{
|
||||
model.IFDeleteTime = DateTime.Parse(ds.Tables[0].Rows[0]["IFDeleteTime"].ToString());
|
||||
}
|
||||
model.gtype = int.Parse(ds.Tables[0].Rows[0]["gtype"].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_zzjf_log ");
|
||||
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_zzjf_log ");
|
||||
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