Posts by Daniel Ferreira • 330 points
9 posts
-
0
votes3
answers527
viewsA: Do I need to use "Convert.Toint32()" for text?
Friend, first of all: C# is case sensitive. That is, it differentiates capital letters from minuscules. I don’t know if it was time to pass your code here but you’re calling Convert instead of…
-
1
votes1
answer265
viewsA: Pass ID to Controller
You need to set the name of your select to the same name as the property for bind to occur. In this case, Cityid instead of City <select class="form-control" id="CityID"…
-
3
votes1
answer553
viewsA: Java - academic system
Normal. The problem is that nextInt(), used in option selection, only consumes the integer number and not the newline (\n). The next nextLine() ends up consuming this newline. A functional…
javaanswered Daniel Ferreira 330 -
2
votes1
answer38
viewsA: Dialog inside php/ajax/js form
I’m not sure I was clear in my answer. Just to illustrate in a very improvised way: <form method="post" action="trata_form.php"> <input id="nova-cor" type="text" placeholder="Insira sua…
-
0
votes1
answer184
viewsA: Search PHP + SQL does not find results without typing the "-" hyphen
As William Lautert said, you must submit the query to the same format. A more practical way (perhaps not the most performatic) that would suit you would be to clear the field to be compared in both…
-
2
votes1
answer59
viewsA: Calculation of string occurrence
I believe that’s what you’re looking for: SELECT TOP 1 name, SUM(CASE WHEN vote = 'yes' THEN 1 ELSE -1 END) AS Total FROM table1 GROUP BY Name ORDER BY Total desc EDIT2: I didn’t notice your Edit,…
-
0
votes2
answers131
viewsA: API does not receive list post
In the date parameter of your ajax try the following: "data": { contratos: that.Contratos() }, And in the corresponding method: public async Task<JsonResult>…
-
2
votes1
answer174
viewsA: Null value is going to the ajax error function - ASP.NET MVC
Do not return the direct value, add to a variable before: Json(new { endereco = repositorio.PesquisarCEP(cep)}, JsonRequestBehavior.AllowGet) After you check if the same is null in the client: ...…
-
2
votes1
answer48
viewsA: Html.Editorfor losing value when rebooting the page
There are many ways to achieve this. Perhaps the simplest is: @Html.EditorFor(m => m.Preco, new { htmlAttributes = new { Value = Model != null? Model.Preco.ToString("0.00") : "0.00" }})…