using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace LYFZ.WeixinServiceDate.DAL
{
public class DAL_DZKJ_CustomerAccount : BaseDataOperate
{
public DAL_DZKJ_CustomerAccount() {
this.TableFieldNameString = "";
}
#region 属性和字段
string _tableName = "tb_DZKJ_CustomerAccount";
///
/// 获取数据表名
///
public override string TableName
{
get { return _tableName; } set { this._tableName = value; }
}
///
/// 获取当前新的数据表模型对象
///
public override object ObjModel
{
get
{
return this.CurrentModel;
}
}
///
/// 获取当前新的MOdel
///
public Model.Model_DZKJ_CustomerAccount CurrentModel
{
get { return new Model.Model_DZKJ_CustomerAccount(); }
}
string _tableFieldNameString = "";
///
/// 数据表字段名数组
///
public override string TableFieldNameString
{
get { return this._tableFieldNameString; }
set { this._tableFieldNameString = value; }
}
#endregion
#region 检查记录
//基类已经实现
#endregion
#region 增加数据
///
/// 增加一条数据
///
/// Model对象
///
public bool Add(Model.Model_DZKJ_CustomerAccount model)
{
return base.Add(model);
}
///
/// 增加一条数据
///
/// Model对象
/// 忽略字段名列表 字段名之间用“,”号分隔
///
public bool Add(Model.Model_DZKJ_CustomerAccount model, string overlookFieldList = "ID")
{
return base.Add(model, overlookFieldList);
}
#endregion
#region 删除数据
///
/// 删除数据
///
///
///
public bool Delete(Model.Model_DZKJ_CustomerAccount model)
{
return base.Delete(model.ID);
}
#endregion
#region 更新数据
///
/// 更新一条数据
///
public bool Update(Model.Model_DZKJ_CustomerAccount model)
{
return base.Update(model);
}
///
/// 根据筛选字段和SQL筛选运算符号更新数据
///
/// Model对象
/// 筛选字段名称
/// SQL筛选运算符号
/// 忽略字段名列表 字段名之间用“,”号分隔
///
public bool Update(Model.Model_DZKJ_CustomerAccount model, string filterFieldName = "ID", string operators = "=", string overlookFieldList = "ID")
{
return base.Update(model, filterFieldName, operators, overlookFieldList);
}
#endregion
#region 查询数据
///
/// 得到一个对象实体
///
public Model.Model_DZKJ_CustomerAccount GetModel(long ID)
{
return DataRowToModel(GetDataRow(ID));
}
///
/// 得到一个对象实体
///
///
///
public Model.Model_DZKJ_CustomerAccount DataRowToModel(DataRow row)
{
return DataRowToModelObject(row) as Model.Model_DZKJ_CustomerAccount;
}
public bool UpdateLatestLoginTime(string Account, string ip, string LatestLoginTime,string v)
{
string updateSql = "update [tb_DZKJ_CustomerAccount] set ip='" + ip + "',LatestLoginTime='" + LatestLoginTime + "',ManagerProgramVersion='"+v+"' where Account='" + Account + "'";
if (LYFZ.Helper.SQLHelper.ExecuteSql(updateSql) > 0)
{
return true;
}
else {
return false;
}
}
public bool UpdateSmallEifVersion(string Account, string v)
{
string updateSql = "update [tb_DZKJ_CustomerAccount] set SmallEifVersion='" + v + "' where Account='" + Account + "'";
if (LYFZ.Helper.SQLHelper.ExecuteSql(updateSql) > 0)
{
return true;
}
else
{
return false;
}
}
#endregion
#region 数据分页
//基类已实现相关方法
#endregion
public int GetUsed(int DistAccountId)
{
return this.GetRecordCount("DistributorID=" + DistAccountId);
}
}
}