Esempio n. 1
0
        public IHttpActionResult GetIdentificationClient(string idNumberClient, string documentType)
        {
            if (String.IsNullOrWhiteSpace(idNumberClient) ||
                String.IsNullOrWhiteSpace(documentType))
            {
                return(BadRequest());
            }
            var documentClient = _dao.GetList <DocumentService.document>("SELECT * FROM Document WHERE idNumberClient = @IdNumberClient AND Name LIKE CONCAT('%',@DocumentType,'%')", new
            {
                IdNumberClient = idNumberClient,
                DocumentType   = documentType
            }).FirstOrDefault();

            if (documentClient == null)
            {
                return(Ok(documentClient));
            }
            return(Ok(new
            {
                fullPath = documentClient.fullPath,
                idNumberClient = documentClient.idNumberClient,
                modifiedDate = documentClient.modifiedDate,
                name = documentClient.name,
            }));
        }
Esempio n. 2
0
        public ActionResult ValidateDocuments(string idNumberDocument)
        {
            var documents = new List <DocumentService.document>();

            if (!String.IsNullOrWhiteSpace(idNumberDocument))
            {
                documents = _dao.GetList <DocumentService.document>("SELECT * FROM Document WHERE idNumberClient = @IdNumberClient", new
                {
                    IdNumberClient = idNumberDocument
                }).ToList();
            }
            return(View(documents.Select(x => new DocumentService.document {
                fullPath = Server.UrlEncode(x.fullPath), name = x.name, modifiedDate = x.modifiedDate
            })));
        }