1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using MySystem.MainModels;
- namespace MySystem
- {
- public class PosMachinesTwoDbconn
- {
- public readonly static PosMachinesTwoDbconn Instance = new PosMachinesTwoDbconn();
- #region 获取单个字段
- public PosMachinesTwo Get(int Id)
- {
- WebCMSEntities db = new WebCMSEntities();
- PosMachinesTwo order = db.PosMachinesTwo.FirstOrDefault(m => m.Id == Id);
- if (order != null)
- {
- // RedisDbconn.Instance.Set(key, order);
- // RedisDbconn.Instance.SetExpire(key, Library.function.get_Random(1800, 5400));
- }
- db.Dispose();
- return order;
- }
- public PosMachinesTwo Get(string PosSn)
- {
- WebCMSEntities db = new WebCMSEntities();
- MachineForSnNo machineFor = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
- PosMachinesTwo order = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineFor.SnId);
- if (order != null)
- {
- }
- return order;
- }
-
- #endregion
- }
- }
|