Posts by Albertt Santos • 1,101 points
22 posts
-
0
votes4
answers60
viewsA: Remove null fields from a model that receives a list
Try as follows, make sure your lista headphones have some value, and then run logic. if(model.Phones.Count > 0) //coloque aqui sua logica You can check if your phones are filled in too, before…
-
2
votes1
answer270
viewsA: How to adjust the width in the background-color in ccs
Try to use the vh, may be that you are setting a value in px or % of height but he’s applying on his elemento pai, for this reason does not apply the expected height for you. The measure vh is equal…
-
5
votes2
answers113
viewsA: Nullreferenceexception
You can replace this code: if (ambienteViewModel.EstExt_senha == null) ambienteModel2.EstExt_senha = ""; For that: ambienteModel2?.EstExt_senha ?? ""; Adding the ? before the . is verified whether…
c#answered Albertt Santos 1,101 -
10
votes2
answers163
viewsA: What do these question marks mean?
The question mark here int? means that its variable of the integer type accepts null values, while the ?? means that the return of (this.parameters["Loading"] as int?) be null, set the same with 1,…
-
0
votes3
answers179
viewsA: Value of a variable becomes the id value
You can do it this way, but if you have more divs on the screen need to identify her somehow, because only informing the div he will add the id for all the divs of the document. var x= 3;…
-
2
votes3
answers103
viewsA: Nullable property in C#
Basically the public Nullable<int> Id {get; set;} is a property of the type int which can receive the null value, you can also represent in this way public int? Id { get; set; }.…
-
17
votes3
answers1899
viewsA: Repetition of if/Else how to reduce and improve code?
You can add your results into a lista type of your result (string, int, etc...), then make a foreach to go through your list by checking whether the field is true or not: var resultados = new…
c#answered Albertt Santos 1,101 -
2
votes3
answers72
viewsA: Add class and remove
You can try it this way: $('.suite-internal-item').on('click',function(e){ e.preventDefault() $('.suite-internal-item').removeClass('active') $(this).addClass('active') }) .suite-internal-item{…
jqueryanswered Albertt Santos 1,101 -
3
votes1
answer1118
viewsQ: What is the difference between VO (Value Object) and DTO (Data Transfer Object)
What is the difference between a VO and a DTO, and how to identify when to use each one?
-
4
votes3
answers297
viewsA: What is Appsettings for?
The tag <appSettings/> serves as a container for the specific settings of your application, in which case the settings the developer wants to store. Example: <appSettings> <add…
-
4
votes2
answers95
viewsA: Problem in SELECT INNER JOIN. Appearing ID instead of name
Try to do this way, I gave an organized in consultation for better understanding, I recommend you use Aliases to make the consultation clearer and easier to understand. SELECT A.nome, A.descricao,…
-
3
votes2
answers351
viewsA: Angular error when returning function string in service: Type '() => string' is not Assignable to type 'string'
In the builder you call your service TesteService with the following name testeService, but to call the service you put in the code this.service, that is, to work you must put this.testeService, as…
-
8
votes1
answer1023
viewsA: How to create a . bat file directly from C#?
Try this way, you just need to put the extension .bat in the file, set the location where you want to create it and insert the code inside it: int teste = 1; StreamWriter EscreverTXT = new…
-
2
votes4
answers110
viewsA: Maintain select element value when cloning with jQuery and deleting Labels
Try to accomplish it this way: function addReg(){ var ultimo = $('#formX > div').last(); var novo = ultimo.clone(); //Seleciona os valores do ultimo clone e seta no novo clone…
-
2
votes4
answers300
viewsA: Doubt about denial operator
The guy String in Java is a objeto, then he tries to deny an object generating error, but javascript is not strongly typed and it is possible to interpret a string, if the string is empty for…
-
1
votes1
answer2127
viewsA: How to add Microsoft.ACE.OLEDB.12. 0 to my app’s installer . NET?
To try to access a database Access or a spreadsheet from Excel using the Visual Studio you need to install the following software: Microsoft Access Database Engine 2010 Redistributable 2007 Office…
-
1
votes3
answers85
viewsA: Are the variables of a function automatically deleted after its termination?
The behavior of unset() may vary within a function depending on the type of variable you are trying to destroy. If you use unset() in a global variable within a function, only the local variable…
-
4
votes1
answer630
viewsQ: Difference from Angular Production and Development Build
I would like to know the differences between the build of production and the build development in Angular?
-
8
votes1
answer2652
viewsQ: Command "TRIM" SQL Server
I’m working with Sql Server, and I need to make a trim as a result of a consultation. I did it this way: select TRIM(NUMERO) from ENDERECO In the Sql Server Management the command is "recognized",…
-
2
votes1
answer257
viewsA: Typescript+Angular: Property is Missing in type [2322]
Typescript is Javascript only typed, when you create a user-type array, you need to fill in user-type objects. Follows excerpt from the code below: export class Usuario{ private _nome: string;…
-
1
votes1
answer500
viewsA: Change the value of the checked attribute of an input type='radio'
This is an example of the code for you to notice the return according to the click on the inputs elements $(function(){ $('input').on("click", function(){ alert($("#tab-1").is(":checked")); }); });…
-
1
votes2
answers48
viewsA: I’m having trouble creating a database and relating 3 tables
Try it this way, pay attention to select because the names of the tables in it were incorrectly written. SELECT Clientes.Nome, Clientes.Sobrenome, Clientes.Bairro, Movimentos.Data, Movimentos.Valor…