Posts by Roberto Braga • 182 points
22 posts
-
1
votes2
answers75
viewsA: Doubts on how to select a week using jquery
Use the method getDate of datepicker to pass the date correctly to the Moment and use the method weekday. Follow example of code: $(document).ready(function(){ $("#weeklyDatePicker").datepicker({…
-
1
votes1
answer168
viewsA: Change View of Table
Implement your table using the project Datatables. It has several options and ways to use, from simple and complex Tables with loads with Json, paging resources, responsiveness, etc... and is widely…
-
0
votes2
answers147
viewsA: Get modal element value attribute
The jquery .val('value') does not update the DOM, if you really want to update it use the jquery .attr. Example: $('#txt-descricao').val('novo valor'); //after jQuery 1.5.2…
-
0
votes2
answers856
viewsA: How to make a button filter results in a datatable?
Follow the example: $(document).ready(function() { var table = $('#example3').DataTable( { dom: 'Bfrtip', buttons: [ { text: 'Todos', action: function ( e, dt, node, config ) { table .search('')…
-
1
votes1
answer385
viewsA: Webservice does not accept xml file
You are doing too complicated to use this service. If you allow me, check out the documentation on: https://e-gov.betha.com.br/e-nota-test/ambienteteste.faces. There are the manuals and examples of…
c#answered Roberto Braga 182 -
1
votes5
answers459
viewsA: Concatenate id by description into an array in javascript
Among so many answers, follow one more option: var lista = [{id: 1, descrição: 'Brasil'}, {id: 2, descrição: 'Brasil'}, {id: 3, descrição: 'Chile'}, {id: 4, descrição: 'Chile'}, {id: 5, descrição:…
-
0
votes1
answer61
viewsA: Read a txt file (Ping Application)
Below is an example to test the ips (with server names) on each line of the file, as you specified: using System; using System.Linq; using System.Net.NetworkInformation; namespace ConsoleTestePing {…
-
4
votes2
answers212
viewsA: Decrease javascript dates
From what I understand, you want to calculate the difference in days between two dates, right? Below is the change in the code quoted in the question: var dtconclusao =…
-
2
votes2
answers228
viewsA: Json Web Token - How to create a token that accesses only a particular Controller or Action?
What you want to do can be done with Roles and Claims. For example, during Voce authentication you can add a Role in "Shopping" or "Sales" token". In token: "roles": ["Compras", "Vendas"] //Add…
-
-2
votes3
answers299
viewsA: How to get the amount of "true"?
Follows code: int total_true = ctx .MinhaTabela .Where(x => x.id == 5) .Select(x => new { x.Campo1, //true x.Campo2, //false x.Campo3, //true x.Campo4 //true }) .ToArray() .Count(x =>…
-
1
votes1
answer776
viewsA: How to simulate SSL on ASP.NET localhost?
Open the Solution Explorer and select the web project Press the button F4. Change the property SSL Enabled for true. A URL will be created in the property SSL URL that will be the URL for use. Obs.:…
c#answered Roberto Braga 182 -
0
votes2
answers470
viewsA: C# MVC solution does not run Javascript on IIS
Change the script call to: <script type="text/javascript"> function PesquisaProduto(codigoProdutoId) { var url = "@Url.Action("DadosProdutos")/" + codigoProdutoId; $.get(url, null, function…
-
1
votes1
answer939
viewsA: Bootstrap datepicker 1.6.4
Change the property startDate of: startDate: "date", for: startDate: '+1d', Below is a functional example: $('.datepicker').datepicker({ format: "dd/mm/yyyy", language: "pt-BR", minViewMode: 0,…
-
0
votes1
answer48
viewsA: Java Script Date Comparison Help
Working with javascript dates is easier using Moment.js. The moment it’s okay documented and has several examples of use. Below is an example of the comparison of the current date with…
-
0
votes1
answer244
viewsA: Ajax POST does not execute the ASP.NET MVC action
You are not posting the file in the ajax request, do so: var form = $("#ID_DO_SEU_FORM"); dataForm = new FormData(form[0]);//IE10+ When creating your url Action, do so: @Url.Action("NOME_DA_ACTION",…
-
0
votes1
answer140
viewsA: httppostedfilebase always empty when passing csv to controller
Take the form data: var formData = new FormData($('#formUpload')[0]); Set the Ajax function Date property to look like this: data: formData Below is an example of file posting with Ajax and…
-
0
votes2
answers31
viewsA: Jsonresult values are received by javascript but fields do not receive value
Change the code: $.each(data, function (i, data) { $("#SequenciaInicial").append(data.SequenciaInicial); $("#SequenciaFinal").append(data.SequenciaFinal); }); for: $(data).each(function (idx, elem)…
-
0
votes1
answer36
viewsA: Remove space in the name of an input
You need to use keys () by the arroba @. @{ int count = 1; foreach (var item in Model}) { <input name="itemId@(count)" value="@item.ProdutoId" type="hidden"> count++; } }…
-
0
votes2
answers49
viewsA: Filter elements by the highest attribute
Follow a way of doing: function removeDuplicates(myArr, prop) { return myArr.filter((obj, pos, arr) => { return arr.map(mapObj => mapObj[prop]).indexOf(obj[prop]) === pos; }); }; var lista = […
javascriptanswered Roberto Braga 182 -
0
votes1
answer664
viewsA: Get return from url c#
To get the total of items: int? total = Request.QueryString.GetValues("itensContrato")?.Count(); Follow example to catch the array of values and travel them. string[] array =…
-
1
votes2
answers1139
viewsA: Get Solution Folder C#
Very complicated to keep it that way. Add the class library file ApiUtils as a reference in the web project. So you can use it as follows: Streamreader Reader = new Streamreader(directory + @"/Body…
-
1
votes1
answer122
viewsA: Good Practices for Moving JSON Object
I see no problem in redoing the query and generating the CSV file. It’s a lot of record to put in Session, with multiple accesses from different users, can easily overload the server memory. I…