예제 #1
0
 private bool ValidaFoto(ListaPerguntasDTO lsPerguntas)
 {
     try
     {
         FaceDTO f = new FaceDTO();
         f.faceId = lsPerguntas.lsPerguntas[4].deResposta;
         WebClient client = new WebClient();
         client.Headers.Add("Ocp-Apim-Subscription-Key", "309977319b54467e9136592c7d4bca56");
         client.Headers.Add("ontent-Type", "application/json");
         // Optionally specify an encoding for uploading and downloading strings.
         client.Encoding = System.Text.Encoding.UTF8;
         // Upload the data.
         string reply = client.UploadString(@"https://westcentralus.api.cognitive.microsoft.com/face/v1.0/verify", JsonConvert.SerializeObject(f));
         // Disply the server's response.
         RespostaFaceDTO r = JsonConvert.DeserializeObject <RespostaFaceDTO>(reply);
         if (r.confidence > 0.5)
         {
             lsPerguntas.lsPerguntas[4].icValido = true;
             return(true);
         }
     }
     catch (Exception)
     {
         return(true);
     }
     return(true);
 }
예제 #2
0
        public DataTable Face_GetByMaChamCong(FaceDTO _faceDTO)
        {
            List <SqlParameter> sqlParams = new List <SqlParameter> {
                new SqlParameter("@MaChamCong", _faceDTO.MaChamCong)
            };

            return(base.executeNonQuerya("NHANVIEN_getFaceByMaChamCong", sqlParams));
        }
예제 #3
0
        public void Insert_Face(FaceDTO _faceDTO)
        {
            List <SqlParameter> sqlParams = new List <SqlParameter> {
                new SqlParameter("@MaChamCong", _faceDTO.MaChamCong),
                new SqlParameter("@FaceID", _faceDTO.FaceID),
                new SqlParameter("@FaceTemplate", _faceDTO.FaceTemplate),
                new SqlParameter("@ChieuDai", _faceDTO.ChieuDai)
            };

            base.Procedure("Face_add", sqlParams);
        }
예제 #4
0
 public void InsertFace(FaceDTO _faceDTO)
 {
     this._faceDAL.Insert_Face(_faceDTO);
 }
예제 #5
0
 public DataTable FaceGetByMaChamCong(FaceDTO _faceDTO)
 {
     return(this._faceDAL.Face_GetByMaChamCong(_faceDTO));
 }