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); }
public DataTable Face_GetByMaChamCong(FaceDTO _faceDTO) { List <SqlParameter> sqlParams = new List <SqlParameter> { new SqlParameter("@MaChamCong", _faceDTO.MaChamCong) }; return(base.executeNonQuerya("NHANVIEN_getFaceByMaChamCong", sqlParams)); }
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); }
public void InsertFace(FaceDTO _faceDTO) { this._faceDAL.Insert_Face(_faceDTO); }
public DataTable FaceGetByMaChamCong(FaceDTO _faceDTO) { return(this._faceDAL.Face_GetByMaChamCong(_faceDTO)); }