Beispiel #1
0
        public Dictionary <int, Face> GetFaceCustom(ref string errMessage, string str)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            Dictionary <int, Face> list = new Dictionary <int, Face>();

            try
            {
                DataSet ds = AnalysisXMLDataAccess.GetFaceCustom(db, str);
                Face    face;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    face = new Face(ds.Tables[0].Rows[i]);
                    list.Add(face.FaceID, face);
                }
                return(list);
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(null);
            }
        }
Beispiel #2
0
        public int InsertTrack(ref string errMessage, Track oTrack)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(AnalysisXMLDataAccess.InsertTrack(db, oTrack));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
Beispiel #3
0
        public Face GetFace(ref string errMessage, int cameraId, DateTime captureDataTime)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            Face face = null;

            try
            {
                DataSet ds = AnalysisXMLDataAccess.GetFaceCustom(db, string.Format(" and CapturePicture.CameraId={0} and  CapturePicture.DateTime='{1}'", cameraId, captureDataTime));
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    face = new Face(ds.Tables[0].Rows[i]);
                    break;
                }
                return(face);
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(null);
            }
        }