public int Update(ref string errMessage, DeviceInfo oDeviceInfo)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(DeviceDataAccess.Update(db, oDeviceInfo));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
        public int Update(ref string errMessage, List <CameraInfo> listCam, DeviceInfo oDeviceInfo)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            int iRtn = -1;

            try
            {
                CameraDataAccess.DeleteByDeviceId(db, oDeviceInfo.DeviceId);
                foreach (CameraInfo item in listCam)
                {
                    CameraDataAccess.Insert(db, item);
                }
                iRtn = DeviceDataAccess.Update(db, oDeviceInfo);
                return(iRtn);
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }