1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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_ShortMessageConfig : BaseDataOperate
- {
- #region 属性和字段
- string _tableName = "tb_ShortMessageConfig";
- /// <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_ShortMessageConfig CurrentModel
- {
- get { return new Model.Model_ShortMessageConfig(); }
- }
- string _tableFieldNameString = "";
- /// <summary>
- /// 数据表字段名数组
- /// </summary>
- public override string TableFieldNameString
- {
- get { return this._tableFieldNameString; }
- set { this._tableFieldNameString = value; }
- }
- #endregion
- public DataTable GetShortMessageConfigList(int pageIndex, int pageSize)
- {
- string sql = " select top " + (pageIndex * pageSize)
- + " CompanyName , tb_ShortMessageConfig.* from tb_ShortMessageConfig left join tb_CustomerInterfaces on Token=smc_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 GetShortMessageConfigCount()
- {
- string sql = " select count(*) from tb_ShortMessageConfig left join tb_CustomerInterfaces on Token=smc_EntID ";
- DataSet ds = this.QuaryDataSet(sql);
- return Convert.ToInt32(ds.Tables[0].Rows[0][0]);
- }
- public Model.Model_ShortMessageConfig GetModel(string strWhere)
- {
- return (Model.Model_ShortMessageConfig)DataRowToModel(GetDataRow(strWhere), new Model_ShortMessageConfig());
- }
- }
- }
|