Questions tagged as 'c#'

1
answer

How many classes can I put in the same code?

How many "classes" can I add to my code? Let's say I have the following existing command block: namespace _06_ByteBank { public class Cliente { private string _cpf; public string Nome { get; set; } public string CPF...
asked by 07.12.2018 / 15:28
2
answers

Bring three possible results with Lambda

I need in a single expression to bring three possible results. If date is up to 15dd, it returns 1, if it is between 15 and 45 dd returns 2 and if it is greater than 45 it returns 3. This is my lambda and the corresponding date field. var resu...
asked by 05.05.2014 / 20:52
3
answers

Bring a Max (Date) with LINQ

I have this Linq : var resultado = ( from pdv in db.T_PDV from tarefa in db.T_TarefaParceiro.Where(trf => trf.CNPJ == pdv.CNPJ).DefaultIfEmpty() from parceiro in db.T_OsParceiro.Where(prf => prf.IDTarefaParceiro == tarefa...
asked by 13.06.2014 / 22:33
2
answers

Pass parameters by jquery to controller

I have a method in the controller (void) that receives some parameters (3). I can not get into the method. Of the other times I did, passing to an object there, I have succeeded, with method returning a json. Well, this is a void method and I do...
asked by 18.06.2014 / 18:08
1
answer

Change Values in Modal - C # MVC JavaScript

I have the following javascript code in my project that takes attribute values when the user clicks the rename class button and calls a modal: <script type="text/javascript"> $('.rename').on('click', function () { var $this =...
asked by 05.04.2017 / 10:13
1
answer

C # String.Contains () does not work, not even string search derivatives [closed]

I have a method in my code that looks up a person's name inside a string but always returns false. Even when the name exists inside the string. Which is totally inexplicable. I tried using Contains ex: linha.Contains(nome); I tried to us...
asked by 28.03.2017 / 21:15
1
answer

Know the size of each element of a list

Assuming I have a List<byte[]> Imagens; and I want to know if any element in this list has more than 1 mega, I could do this via foreach , checking item by item: foreach (var item in Imagens) if (item.Leng...
asked by 15.09.2018 / 17:09
1
answer

How to do calculation with numbers in a String in C #

I have a string that Arduino sends to my application through the serial port with the following format:    variable = # ultrasound distance # # ultrasound distance # # (with 10 samples equal to this). I need to separate only the numbers o...
asked by 13.01.2016 / 16:45
3
answers

How to keep the default look of the TextBox changing the value of the ReadOnly property?

If the value of the ReadOnly property of a TextBox is false it means that I can change the content. However, when the value is true the content can no longer be changed, but when we change the value of ReadOnly...
asked by 14.02.2016 / 02:19
1
answer

How to get value from a json?

I use WebClient and DownloadString to retrieve json: using (WebClient wc = new WebClient()) { var teste = wc.DownloadString($"https://api.vagalume.com.br/search.php?musid=l3ade68b8g72d4ffa3&apikey=69d03116fe65f19839140520...
asked by 19.10.2017 / 01:37