Questions tagged as 'c#'

1
answer

How to transform a UNIX timestamp into DateTime?

I have a date field in the format UNIX timestamp , and I need to transform this field to a DateTime of C #. How to proceed?    Example input: 1514959643539       Output desired: DateTime with correct date / time in...
asked by 02.03.2018 / 10:35
1
answer

How to make a Custom Attribute in a webapi get the passed parameter via C #

I am creating a Custom Attribute in a webapi for validation of a value and would like to know if it can capture this value from a GET request. I wanted to do it this way: [Validacao] public Empresa consularEmpresa([FromUri]string codigo){}...
asked by 02.03.2018 / 15:19
1
answer

Post by postman is giving Object reference error not set to an instance of an object

I notice that FromBody is coming null and I do not know why. This is my payload on Postman { "ChannelCode" : "TS", "Name" : "Teste", "Celphone" : "(11)999999999", "Endpoint" : "www.teste.com.br", "TokenLogin" : "123456...
asked by 14.06.2018 / 16:15
1
answer

Python language format function in C #

int varvalor; int var01 = varvalor * 1; Console.Write("Digite um número para ser multiplicado: "); var01 = Convert.ToInt32 (Console.ReadLine()); Console.WriteLine(); I wanted to write in Console.WriteLine(); these lines of code that is...
asked by 13.02.2018 / 00:39
1
answer

Insert welcome screen into the project

How do I enter a welcome screen with a button to continue and open the system? In the initial form it looks like this: namespace App_Herois_da_Fe { public partial class Form1 : Form { public Form1() { InitializeComponent();...
asked by 09.02.2018 / 12:11
1
answer

SimpleInjector: The configuration is invalid. The type is directly or indirectly depending on itself

I have the following problem when applying the SimpleInjector container in a simple application: The configuration is invalid. The type BookAppService is directly or indirectly depending on itself. The cyclic graph contains the following typ...
asked by 31.03.2018 / 00:25
1
answer

Sql executes in Oracle SQL Developer, but does not run in the C #

vsql = @"INSERT INTO ALUNOS_ (UF, IDADE, TELEFONE, NOME_PAI, ENDERECO, EMAIL, NOME, CIDADE, NOME_MAE) values ('sp', 0,'','','','','','','');"; This SQL when executed in oracle does the insertion but in the...
asked by 31.01.2018 / 14:20
1
answer

Json Date / Date Return (1519339100637) /

Good evening, I'm working with Ajax to return a json that contains a data in Datetime format but I'm getting string /Date(1519339100637)/ . How can I convert to date and time format 23/02/2018 12:00:00: Ajax function: &...
asked by 24.02.2018 / 00:13
1
answer

Problems in declaring a structure

I am creating a simple Poker game, in this game I defined that the cards would be structs . According to my business rules, each card has a value , a name and a suit . The Valor property corresponds to the range of 2 to 14 (this...
asked by 25.02.2018 / 23:01
1
answer

Batch INSERT c #

I would like to know if it is possible and how to perform an INSERT in the database of 10 equal values and adding 1 more in a field .. ex: I have a patrimony system and I need to register 10 equal items. when marking a checkbox and adding the...
asked by 26.02.2018 / 01:38