Posts by Felippe Tadeu • 519 points
26 posts
-
1
votes1
answer196
viewsA: How to pass a variable as a parameter to "getElementById"
You can place the association within an array of objects, for example: var arrayCores = [ {"nome_elemento": "a1", "cor": "#FFFFFF"}, {"nome_elemento": "a2", "cor": "#AB31AA"} ]; for (var i in…
-
2
votes2
answers134
viewsA: Deserialize array of C#objects
To facilitate code maintenance, I recommend making two changes, one in the controller and one in the view. In the view, instead of serializing in array format put into an object, create a model in…
-
0
votes1
answer52
viewsA: Add message in Oauth reply
To make the change you need it is necessary to be using the method TokenEndpointResponse next to context.AdditionalResponseParameters.Add as in the example below: public override Task…
-
0
votes3
answers51
viewsA: Modal’s button doesn’t work!
Good morning. This answer is being given in a context where it is not known if there are more buttons on the screen, but this situation will be considered. A possible way to solve your problem would…
-
1
votes1
answer176
viewsA: API with JWT authentication
Good morning. You should first add 4 references to the project: Microsoft.AspNet.Webapi.Owin Microsoft.Owin.Host.System.Web Microsoft.Owin.Security.Oauth Microsoft.Owin.Cors Once this is done you…
-
2
votes1
answer118
viewsA: return to a specific Nav tab
This will require checking the presence of a # in the url. function afterLoad(){ var url = location.href; var splittedUrl = url.split("#"); if (splittedUrl.length >= 2) { var goToTabAriaControls…
-
0
votes1
answer45
viewsA: How to sum the first 2 occurrences of a column using a key as reference in Sqlserver
Good morning. The solution to your case would be to use a common-table-Expression. In the given example there is an inconsistency in writing, would you like the most recent or the oldest? Given the…
-
0
votes2
answers153
viewsA: Assign returned Success value to a variable
In the form in which the reply was written, before any change is made, it is sufficient to carry out as follows: function novasMensagens(Alerta){ var retorno = Alerta > 0 ? Alerta : ""; $.ajax({…
ajaxanswered Felippe Tadeu 519 -
2
votes1
answer141
viewsA: Error deserializing json
In the code posted, the object definition in the method FindAll is different from the object FormaPagamentoFinModel. An example would be to change Fpg_codigofor Fpf_codigo as well as other…
-
0
votes1
answer303
viewsA: How to do a search with Join using Entity framework Lambda and Linq
Good afternoon. To perform the search as per the comment placed, the search would be as follows: public Tipo BuscarPorBarco(int idBarco){ return Buscar(t => t.Barco.IdBarco ==…
-
3
votes1
answer230
viewsA: How to implement password encryption?
Good afternoon. Use this method before carrying out the persistence of that model in the bank. For example: public void SalvarUsuario(Usuario model){ using (var db = new objetoConexaoBanco()){…
-
3
votes1
answer55
viewsA: Rollback Sqlserver recording two separate tables
Good morning, in case you must be instantiating the connection at some point, either within the method or in the construction of the class, in this connection, I suggest that you use the transaction…
-
0
votes1
answer98
viewsA: set $Scope inside angular callback
Good afternoon. When a requisition is made be it $http or $resource in Angularjs in the function of callback the scope is different. What I recommend is to store the scope in a variable before the…
-
0
votes2
answers600
viewsA: Open iframe link after post PHP + JS
Use the tag targert to identify that you want to open inside the iframe, if you want to do some other validation create a function in the onsubmit
-
4
votes1
answer785
viewsA: Replicate information by JS Angular table columns
To do it the way you need it I recommend that you build the object already the way you need it on the server, since it will be data that will practically be fixed, id=1 and id=2 and id=2 should be…
-
2
votes1
answer98
viewsA: Problem with ui-sref
Please try it this way: <tr ng-repeat="hw in ctrl.search.results" ui-sref="highways.id({id: hw})">
-
0
votes2
answers44
viewsA: build a conditional using object
That would be an alternative divShowOrHide({ //valorEscolhido: valor, condicional: "'"+valor+"'"+" === 'SIM'", hideDiv: "#esconde" }); function divShowOrHide(obj){ //alert(obj.condicional);…
-
0
votes1
answer188
viewsA: Problem with checkbox in selection
You could change your logic to this: HTML: <tr data-ng-repeat="obj in vm.listaObj"> <td> <input type="checkbox" name="cbRow" data-ng-model = "obj.selecionado"…
-
1
votes3
answers913
viewsA: Checkbox Fields From Database
You can use this single select that will return both the accessories in a particular car and the ones that are not. SELECT A.ACESSORIO_ID, A.ACESSORIO_NOME, "TRUE" CHECKED FROM ACESSORIOS A JOIN…
-
3
votes3
answers20769
viewsA: javascript check if the attribute of an object exists
You can do it this way: if ((json.hasOwnProperty("aviso")) && (!!json.aviso)) This way it will first check whether the object whose name is json exists the property aviso and finally will…
javascriptanswered Felippe Tadeu 519 -
3
votes4
answers9200
viewsA: Query using like operator
1)Check whether variables have value or not before executing the query. 2)If the check cannot be performed do the following sql select * from despesas where (palavraChava like "%escola%" and…
sqlanswered Felippe Tadeu 519 -
0
votes3
answers785
viewsA: How can I make a query with LIKE or REGEXP ignoring table words?
I didn’t understand it very well, but you could do a like after % after typing the last character. Select nome From usuarios Where nome Like 'Wallace%' or for each space you replace it with the "%"…
mysqlanswered Felippe Tadeu 519 -
0
votes4
answers120
viewsA: Error using variables in a query
Good morning. As already mentioned in the comments, use PDO for greater security in the execution of queries. About the error, in your case use the following querie: INSERT INTO TABELA (NOME, DESC)…
-
1
votes2
answers100
viewsA: Dynamic TSQL for multiple returns
You could do it this way: Insert Into Nome_Da_Tabela (campo1, campo2, campo3) Select Nome_Da_Tabela2.campo1, Nome_Da_Tabela2.campo2, Nome_Da_Tabela2.campo3 From Nome_Da_Tabela2 Or: Select…
-
2
votes1
answer68
viewsQ: Option value change of the select element
I’m trying to add an option to a select: function add(){ var opt = document.createElement("option"); opt.value = "0101"; opt.text = "foo"; } That code works. My question is why when I remove double…
-
1
votes1
answer896
viewsA: Angular Directives with object-constructing methods
You could put more variables in the Cope and be passing them the placeholder, for example. You would also have to modify your template to accept this placeholder. You could put for example all…