public int Update(ref string errMessage, int id, int row, int col) { Database db = DatabaseFactory.CreateDatabase(); errMessage = ""; try { int iRtn = WindowCameraDataAccess.Update(db, id, row, col); return(iRtn); } catch (Exception ex) { errMessage = ex.Message + ex.StackTrace; logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace); return(-1); } }
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); } }