Posts by Victor Laio • 2,043 points
107 posts
-
0
votes0
answers8
viewsQ: Transform Image into Map to use with Pathfinder Algorithm
I want to develop a kind of AI that will go a shorter way (Walkable part is just where it is gray) on the map and for that I will use the Pathfinder algorithm. For this I am using the following…
-
0
votes1
answer31
viewsQ: Store information per logged-in user without using Session
I would like to know how I can store user information individually without using Constants and Session to be accessed by my data access project? It used constants but the application was transformed…
-
0
votes1
answer30
viewsQ: Applying Runtime Migrations . Net Core
The question is exactly as in the title of this topic, but all the help I found related to the subject is running the code on the application startup requiring arguments to be passed to the host. I…
-
11
votes1
answer3160
viewsQ: Except Print Screen C#
There is a game called Tibia (In same window mode) that when trying to take a print screen the game ends up obscuring the image leaving only the whole black game screen independent if the print…
-
0
votes1
answer67
viewsA: Problem when correctly rendering a select HTML
If you use JQuery can put the code on your page. <script> $(document).ready(function(){ $('#tipo').removeAttr('multiple'); }) </script>…
-
1
votes1
answer45
viewsA: Remove multiple rows from table when changing state
Do it this way to remove a specific item from a array: for( var i = 0; i < Ids.length; i++){ if(dadosajax.EstadoFinal != '2'){ Ids.splice($.inArray(Ids[i], Ids), 1); $('tr[id="'+ Ids[i]…
javascriptanswered Victor Laio 2,043 -
1
votes2
answers174
viewsA: Formatting values per Razor pages
To format Real values on Razor do it this way buddy: @{ var dblNumber = 9.5700; } @Html.Raw(dblNumber.ToString("C2")) Exit: R$ 9,57 Note: If your value is actually stored in a string, for this above…
-
0
votes3
answers137
viewsA: Help with Append()
Do so: $('button').on('click',function(){ $('<li> Teste </li>').appendTo('.card') })…
-
0
votes1
answer1223
viewsA: Uncaught Typeerror: Cannot read Property 'checked' of null
You just forgot to put the ids you are searching between quotes: function HabilitarUpload() { if (document.getElementById('declaracaoCuidador').checked) {…
-
0
votes2
answers84
viewsA: Keep in array the serialize
You can get the same result by storing it in the variable using the method serializeArray() const filtros = $('#filtros').serializeArray(); I use it this way and it works great for me. You can see…
-
0
votes2
answers87
viewsA: How to get a return from a Webapi Exception?
In fact it is simpler than I imagined, just try to convert the return and see if the conversion was a success: if (!resposta.IsSuccessStatusCode) { Exception ex = await…
-
2
votes1
answer58
viewsA: Reading text file in C#
This is happening because it is instantiating a new StreamWriter every time you spin a loop of your foreach. Just throw it out like this: class Program { static void Main(string[] args) { string[]…
c#answered Victor Laio 2,043 -
0
votes1
answer227
viewsA: Search the database and move to a listview c# Windows Forms
Just take the entered value and search the property Id taking into account that the name of your property in the template is even "Id": int Id; bool success = Int32.TryParse(txt_Busca.Text.Trim(),…
-
9
votes2
answers1119
viewsQ: Where is Session stored in ASP.NET Core and how best to use it?
Knowing that ASP.NET MVC when it comes to Session should be taken care not to abuse too much of such functionality due to its memory consumption by the server can "weigh" the application. Reading a…
-
1
votes2
answers87
viewsQ: How to get a return from a Webapi Exception?
I have the following method that makes a request for Delete to my WebApi: [HttpPost] public async Task<IActionResult> Delete(int id, IFormCollection frmCollection) { HttpClient httpClient =…
-
0
votes0
answers35
viewsQ: Table stylization problem using Bootgrid()
When I rethink that table within a Modal and use the function BootGrid(), it cannot load all the necessary styles, making the navigation buttons for example not properly stylized. Code of the table…
-
0
votes3
answers103
viewsA: Send error for duplicate login C#
Whenever you seek some user information and do not find it, would fall into the catch when trying to access "Admin", returning a NullPointer. Try it like this: public ActionResult Autenticar(string…
-
1
votes1
answer58
viewsQ: Correct way to bind a Datagridview
I’m bindando one DataGridView in a DataTable what a comeback from my comic book, but even with just 79 records in the DataTable my DataGridView is very slow to work and catching on the screen…
-
2
votes1
answer31
viewsA: Call action after a notification
You can call the direct url by passing the ID to be deleted in the link: function AlertaDelete(idReg) { $.Zebra_Dialog('<strong>Alerta: </strong> Deseja realmente excluir esta…
-
1
votes2
answers338
viewsA: How to put html id tag with variable name using Razor
It’s actually really quite simple: <td id='@string.Format("permiteCertificacao{0}", relatorioDTO.Identificador)'>@relatorioDTO.Nome</td>…
-
3
votes1
answer454
viewsQ: Questions about Sendmessage and Postmessage
I began to study the methods of SendMessage and PostMessage of User32.dll and I came up with some questions. I will put down the code I tested and soon after the questions, if anyone can help me.…
-
0
votes3
answers381
viewsQ: Difference between Jquery.Append() and Jquery.Html()
Today doing content manipulation of a modal came to mind two possibilities $('div').append('Olá mundo!'); Or else: $('div').html('Olá mundo!'); But I don’t know exactly what the ideal would be Even…
-
4
votes5
answers146
viewsA: Is there a disadvantage or is it harmful to use null types?
Complementing our friend’s response: If you work with database, it is recommended to use variables nullables according to the column type. Otherwise it will always take up space with unnecessary…
-
0
votes3
answers154
viewsA: How to "mount" a multiple variable?
I would recommend for this situation you use a string dictionary. Dictionary<string, string> dictionary = new Dictionary<string, string>(); dictionary.Add("teste0", "valor");…
-
1
votes1
answer230
viewsA: How to run an Alert only once in an Asp.net MVC View
1st Method - Session You can make this check using Session through codes Razor on your page, adding a simple condition: @if (Session["MostrouAlerta"] == null) { Session["MostrouAlerta"] = true;…
-
2
votes1
answer77
viewsA: convert nvarchar to bit C#
The data column of the type BIT in Sqlserver is usually used to store variables of type bool or booleano as they are known, although they do not store True or False and yes 0, 1 or null usually.…
-
1
votes2
answers99
viewsA: Sending a Data List by Email - ASP.NET MVC C#
The error is because you try to concatenate a variable of type List<> with a string. You must assemble a string containing the list information and then throw it into the friend string. string…
-
0
votes2
answers64
viewsA: Lower and higher value within Objects with the same date
You can catch the lowest and highest temperature by making the following query: var menorTemperatura = weather.list.OrderBy(c => c.main.MinimumTemperature).FirstOrDefault(); var maiorTemperatura…
-
1
votes1
answer119
viewsA: Add multiple items in a single Session
First is your method that you practically already use to add the Session, and then the method you will use to search for an item in the list stored in the Session. void AddItemSession() { var item =…
-
2
votes2
answers478
viewsQ: Styles of my Datatable does not load in modal
I am creating a modal and inside I will put a table with some information, however, the content of the modal is not being stylizable. I already use the same table in other views and works normally…
-
3
votes1
answer131
viewsA: How to place two Tables in a Datagridview?
Just do the Join with the desired player bringing the information connecting the tables: Select Jogador.Id_Jogador, Jogador.Nome, Jogador.Idade, Jogador.País, Jogador.id_equipa From Jogador Join…
-
0
votes0
answers28
viewsQ: Do not cache a View using Asp.NET
I have a popup that renders another View using the RenderPartial(). @Html.DevExpress().PopupControl( settings => { settings.Name = "pcModalMode"; settings.Width = 550; settings.Height = 420;…
-
0
votes1
answer75
viewsQ: Difference between "==" and "=="
I was developing a code javascript and I saw that the compiler accused error in the equality that I did at that time, but there was no error in the execution. I would like to know the difference of…
-
4
votes1
answer197
viewsQ: Structuring a Saas Database
Well, I’m studying a little bit about applications .NET as Service and not as a Product, so that a monthly subscription customer’s use of the application. As long as the database will be unique and…
-
1
votes1
answer63
viewsA: List only future items in C#
Well, apparently you want to bring from the bank all records where the event start date is higher than the correct current date? Just do this: if (evento.Dias == null) evento.Dias =…
-
0
votes1
answer47
viewsA: I cannot use the Firstordefault method on an Iwebelement type
This is because you are using the FindElement() in assigning the variable trs, where it only returns a single element, taking into account that the FirstOrDefault() is used to Enumerables.…
-
0
votes1
answer55
viewsA: Import codes for reuse in Asp.Net MVC
Okay, come on. First on Image 1, you created a PartialView, and what is a PartialView? A Partial View or Partial View translated into poor English, is a View where your code is reusable in several…
-
0
votes1
answer1082
viewsA: Syntax error (Unexpected Identifier)
You are using comments in javascript without defining that these lines are really a comment as for example: resText as decoded code, lastImageSrc as image source example: Try it like this:…
javascriptanswered Victor Laio 2,043 -
3
votes2
answers2049
viewsA: Visual Studio and Github - Which files to ignore (C#)
After the compilation process of a Visual Studio, files are usually created in folders /bin and /obj of your project, these being totally ignored in my gitignore's. Already on the internet you can…
-
0
votes4
answers761
viewsA: How to simulate onclick checkbox
You can use this way, automatically when marking your CheckBox, he seeks all others and marks the same value of his checkbox clicked: $("#marcar").click(function(){…
-
2
votes2
answers83
viewsA: Javascript function does not perform
The .ready(), will perform the action as soon as you finish loading the page, counting that you use JQuery for having codes .Net: <script type="text/javascript"> $(document).ready(function() {…
-
2
votes1
answer400
viewsA: Grab URL directly from an image of my ASP NET MVC application
I’d do it this way, buddy: string dominio = Path.Combine(Request.Url.Scheme, Request.Url.Authority); DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("~/Assets/img/icons/led"));…
-
1
votes0
answers25
viewsQ: Createinstance in Typed class
My intention is to recover mine Entity and the Repository by means of a string passed to the method. With that I’ll make sure he can execute the GetAll() of my generic repository independent of the…
c#asked Victor Laio 2,043 -
1
votes3
answers37
viewsA: Select entries between two dates
Type the command by passing the dates using the BETWEEN: select * from GP_Vw_Cons_Faltas where DataInicio BETWEEN '01/01/2015' AND '01/10/2016';…
-
0
votes4
answers2085
viewsA: Does the date conversion always remain in en-BR?
You can make explicit the date format you want on output using Parseexact(): public Static Datetime Parseexact (string s, string format, Iformatprovider Provider); More information:…
-
9
votes1
answer225
viewsA: Asynchronous programming C#
Answering your question, the application will wait for the return of its function without blocking the program flow. You use a await when in the declaration of your method has the keyword async…
-
0
votes3
answers561
viewsA: Validate if a CPF already exists in the List before inserting C#
I would recommend changing your code by doing a LINQ instead of a foreach(). This allows you to solve your problem and also simplifies the analysis of your code. Do it like this: private static…
-
2
votes1
answer72
viewsA: Javascript does not find element by id
Actually you are looking for a nonexistent id in your HTML looking for a string and not the variable received in the method. var obj=document.getElementById("menu"); Try it like this: function…
javascriptanswered Victor Laio 2,043 -
0
votes1
answer80
viewsA: I can’t make a Dropdown change event work - JS and Asp.Net
You can do the event assignment onChange() thus: $(document).ready(function(){ $('#btn-add-contato').on('change', function (e) { alert('Disparou o evento!'); }); })…
-
2
votes1
answer73
viewsA: difficulty making Foreach lambda in a query
In fact the correct syntax would be ForEach(): qry.ForEach(prd => { //DoSomething }); See if it fits your problem: var qry = _productRepository.Table.GroupJoin(_categoriesRepository.Table, p…