12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using MySystem.Models.Main;
- namespace MySystem
- {
- public class MachineForQrCodeDbconn
- {
- public readonly static MachineForQrCodeDbconn Instance = new MachineForQrCodeDbconn();
- #region 获取单个字段
- public MachineForQrCode Get(string DataId)
- {
- WebCMSEntities db = new WebCMSEntities();
- MachineForQrCode order = db.MachineForQrCode.FirstOrDefault(m => m.DataId == DataId);
- if (order != null)
- {
- }
- return order;
- }
- #endregion
- #region 获取列表
- public List<MachineForQrCode> GetList(int MerchantId, int pageNum = 1, int pageSize = 10)
- {
-
-
-
-
-
-
-
-
-
-
- WebCMSEntities db = new WebCMSEntities();
- List<MachineForQrCode> newlist = new List<MachineForQrCode>();
- var mysqllist = db.MachineForQrCode.Where(m => m.MerchantId == MerchantId && m.SnNo != m.MachineSnNo).ToList();
- if (mysqllist.Count > 0)
- {
- foreach (MachineForQrCode sub in mysqllist)
- {
- newlist.Add(sub);
- }
-
-
-
-
-
-
- }
- db.Dispose();
- return newlist;
- }
- #endregion
- }
- }
|