Пример #1
0
        public bool IsWindowCameraExisted(ref string errMessage, int row, int col)
        {
            bool     ret = true;
            Database db  = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(WindowCameraDataAccess.IsWindowCameraExisted(db, row, col));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(true);
            }
        }
Пример #2
0
        public int Insert(ref string errMessage, WindowCameraInfo windowCameraInfo)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(WindowCameraDataAccess.IsWindowCameraExisted(db, windowCameraInfo.Row, windowCameraInfo.Col)
                           ? WindowCameraDataAccess.Update(db, windowCameraInfo.Row, windowCameraInfo.Col,
                                                           windowCameraInfo.CameraId)
                           : WindowCameraDataAccess.Insert(db, windowCameraInfo));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }