Exemple #1
0
 public static List <T_PathIdentifyEquip> GetAllPathIdEquip()
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         return(db.T_PathIdentifyEquip.ToList());
     }
 }
 public static T_ReceiveData[] GetAllDatas()
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         return db.T_ReceiveData.ToArray();
     }
 }
 public static List<T_PathIdentifyEquip> GetAllPathIdEquip()
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         return db.T_PathIdentifyEquip.ToList();
     }
 }
 public static List<T_DataDict> GetAllDataDict()
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         return db.T_DataDict.ToList();
     }
 }
 public static List <T_DataDict> GetAllDataDict()
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         return(db.T_DataDict.ToList());
     }
 }
Exemple #6
0
 public static T_ReceiveData[] GetAllDatas()
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         return(db.T_ReceiveData.ToArray());
     }
 }
 /// <summary>
 /// 保存接收到的车辆通行数据
 /// </summary>
 /// <param name="data"></param>
 public static void SaveReceiveData(T_ReceiveData data)
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         db.T_ReceiveData.Attach(data);
         db.Entry(data).State = EntityState.Added;
         db.SaveChanges();
     }
 }
Exemple #8
0
 public static void DelEquip(T_PathIdentifyEquip equip)
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         db.T_PathIdentifyEquip.Attach(equip);
         db.Entry(equip).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
 public static void DelEquip(T_PathIdentifyEquip equip)
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         db.T_PathIdentifyEquip.Attach(equip);
         db.Entry(equip).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
 /// <summary>
 /// 保存设备状态数据
 /// </summary>
 /// <param name="status"></param>
 public static void SaveDeviceStatus(T_DeviceStatusLog status)
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         db.T_DeviceStatusLog.Attach(status);
         db.Entry(status).State = EntityState.Added;
         db.SaveChanges();
     }
 }
 /// <summary>
 /// 保存设备状态数据
 /// </summary>
 /// <param name="status"></param>
 public static void SaveDeviceStatus(T_DeviceStatusLog status)
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         db.T_DeviceStatusLog.Attach(status);
         db.Entry(status).State = EntityState.Added;
         db.SaveChanges();
     }
 }
Exemple #12
0
 /// <summary>
 /// 保存接收到的车辆通行数据
 /// </summary>
 /// <param name="data"></param>
 public static void SaveReceiveData(T_ReceiveData data)
 {
     using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
     {
         db.T_ReceiveData.Attach(data);
         db.Entry(data).State = EntityState.Added;
         db.SaveChanges();
     }
 }
Exemple #13
0
        public static void SaveOrModifyEquip(T_PathIdentifyEquip equip)
        {
            using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
            {
                //if (equip.CreateTime == null)
                //    equip.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day
                //        , DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
                db.T_PathIdentifyEquip.Attach(equip);
                if (equip.Id <= 0)
                {
                    db.Entry(equip).State = EntityState.Added;
                }
                else
                {
                    db.Entry(equip).State = EntityState.Modified;
                }

                db.SaveChanges();
            }
        }
        public static void SaveOrModifyEquip(T_PathIdentifyEquip equip)
        {
            using (PathIdentifyEquipDemoDBEntities db = new PathIdentifyEquipDemoDBEntities())
            {
                //if (equip.CreateTime == null)
                //    equip.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day
                //        , DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
                db.T_PathIdentifyEquip.Attach(equip);
                if (equip.Id <= 0)
                {
                    db.Entry(equip).State = EntityState.Added;
                }
                else
                {
                    db.Entry(equip).State = EntityState.Modified;
                }

                db.SaveChanges();
            }
        }