1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using LYFZ.WeixinServiceDate.Model;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- namespace LYFZ.WeixinServiceDate.DAL
- {
- public class DAL_ShortMessageTemple : BaseDataOperate
- {
- #region 属性和字段
- string _tableName = "tb_ShortMessageTemple";
- /// <summary>
- /// 获取数据表名
- /// </summary>
- public override string TableName
- {
- get { return _tableName; }
- set { this._tableName = value; }
- }
- /// <summary>
- /// 获取当前新的数据表模型对象
- /// </summary>
- public override object ObjModel
- {
- get
- {
- return this.CurrentModel;
- }
- }
- /// <summary>
- /// 获取当前新的MOdel
- /// </summary>
- public Model.Model_ShortMessageTemple CurrentModel
- {
- get { return new Model.Model_ShortMessageTemple(); }
- }
- string _tableFieldNameString = "";
- /// <summary>
- /// 数据表字段名数组
- /// </summary>
- public override string TableFieldNameString
- {
- get { return this._tableFieldNameString; }
- set { this._tableFieldNameString = value; }
- }
- #endregion
- public DataTable GetShortMessageTempleList(int pageIndex, int pageSize)
- {
- string sql = " select top " + (pageIndex * pageSize)
- + " CompanyName, tb_ShortMessageTemple.* from tb_ShortMessageTemple left join tb_CustomerInterfaces on Token=smt_EntID ";
- DataSet ds = this.QuaryDataSet(sql);
- if (ds.Tables[0].Rows.Count == 0)
- {
- return new DataTable();
- }
- DataTable jsonDt = ds.Tables[0].AsEnumerable().Skip((pageIndex - 1) * pageSize).Take(pageSize).CopyToDataTable();
- return jsonDt;
- }
- public int GetShortMessageTempleCount()
- {
- string sql = " select count(*) from tb_ShortMessageTemple left join tb_CustomerInterfaces on Token=smt_EntID ";
- DataSet ds = this.QuaryDataSet(sql);
- return Convert.ToInt32(ds.Tables[0].Rows[0][0]);
- }
- public Model.Model_ShortMessageTemple GetModel(string strWhere)
- {
- return (Model.Model_ShortMessageTemple)DataRowToModel(GetDataRow(strWhere), new Model_ShortMessageTemple());
- }
- }
- }
|