public ResultInfo.Result Add(long deviceID, string value, deviceIOType ioType)
 {
     DeviceIO endIO = new DeviceIO();
     endIO.DeviceID = deviceID;
     endIO.Valu = value;
     endIO.IOTypeID = long.Parse(ioType.GetHashCode().ToString());
     endIO.TimeStamp = DateTime.Now;
     db.DeviceIOs.Add(endIO);
     db.SaveChanges();
     return ResultInfo.GenerateOKResult();
 }
Exemple #2
0
        public ResultInfo.Result Add(long deviceID, string value, deviceIOType ioType)
        {
            DeviceIO endIO = new DeviceIO();

            endIO.DeviceID  = deviceID;
            endIO.Valu      = value;
            endIO.IOTypeID  = long.Parse(ioType.GetHashCode().ToString());
            endIO.TimeStamp = DateTime.Now;
            db.DeviceIOs.Add(endIO);
            db.SaveChanges();
            return(ResultInfo.GenerateOKResult());
        }
Exemple #3
0
 public ResultInfo.Result Add(long deviceID, string value, deviceIOType ioType, DateTime executionTime)
 {
     try
     {
         DeviceIO endIO = new DeviceIO();
         endIO.DeviceID      = deviceID;
         endIO.Valu          = value;
         endIO.IOTypeID      = long.Parse(ioType.GetHashCode().ToString());
         endIO.TimeStamp     = DateTime.Now;
         endIO.ExecTimeStamp = executionTime;
         db.DeviceIOs.Add(endIO);
         db.SaveChanges();
         return(ResultInfo.GenerateOKResult("Saved", endIO.ID));
     }
     catch
     {
         return(ResultInfo.GetResultByID(1));
     }
 }
 public ResultInfo.Result Add(long deviceID, string value, deviceIOType ioType, DateTime executionTime)
 {
     try
     {
         DeviceIO endIO = new DeviceIO();
         endIO.DeviceID = deviceID;
         endIO.Valu = value;
         endIO.IOTypeID = long.Parse(ioType.GetHashCode().ToString());
         endIO.TimeStamp = DateTime.Now;
         endIO.ExecTimeStamp = executionTime;
         db.DeviceIOs.Add(endIO);
         db.SaveChanges();
         return ResultInfo.GenerateOKResult("Saved", endIO.ID);
     }
     catch
     {
         return ResultInfo.GetResultByID(1);
     }
 }