0
I think because my computer is from the USA it always saves the dates in American format, anyway, I have a Date Time Picker that on the client’s computer is in Brazilian format, but when he saves this data C# changes the days for the months.
Ex: If the customer wants to save the date 09/03/2020 the saved date is 03/09/2020
Classes.VendasServicos vs = new Classes.VendasServicos();
Venda venda = new Venda();
venda.idCliente = int.Parse(cmbCliente.SelectedValue.ToString());
venda.carro = txtCarro.Text;
venda.placa = txtPlaca.Text;
venda.data = DtVenda.Value;
Conexao conexao = new Conexao();
conexao.conectar();
var escolha = MessageBox.Show("O cliente efetuou o pagamento de R$" + preco + ",00 ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (escolha == DialogResult.Yes)
{
int linhas = conexao.executar($"INSERT INTO Vendas(data, carro, placa, idCliente, pago) VALUES('{venda.data.ToShortDateString()}','{venda.carro}','{venda.placa}','{venda.idCliente}', 1) ");
}
else
{
int linhas = conexao.executar($"INSERT INTO Vendas(data, carro, placa, idCliente, pago) VALUES('{venda.data.ToShortDateString()}','{venda.carro}','{venda.placa}','{venda.idCliente}', 0) ");
}