TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

Atps ciencia de sistemas

Por:   •  4/5/2015  •  Exam  •  7.363 Palavras (30 Páginas)  •  194 Visualizações

Página 1 de 30

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using MySql.Data.MySqlClient;

namespace ProjetoSystem

{

public partial class frmVendas : Form

{

public MySqlConnection conn; //conexao mysql

private DataSet bdDataSet;

private MySqlDataAdapter da;

string sql;

int botao, vCodigo, cod, vCodcliente;

string vNome, vValorunitario, vCliente;

double valortotal, valorunitario, quantidade, lucro = 0, custo, venda;

public frmVendas()

{

InitializeComponent();

}

private void conectar()

{

bdDataSet = new DataSet();

conn = new MySqlConnection("server=127.0.0.1; user id=root; password=; database=system;port=3306");

try

{

conn.Open();

}

catch

{

MessageBox.Show("Não foi possível conectar estabelcer conexão");

}

}

public void sair()

{

DialogResult resp = MessageBox.Show("Deseja Sair de Vendas?",

"Atenção!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (resp == DialogResult.Yes)

Close();

}

public void limpar()

{

txtCodvenda.Text = "";

lblCodvenda.Text = "";

txtVendedor.Text = "";

txtCodcliente.Text = "";

txtNomecliente.Text = "";

txtCodproduto.Text = "";

txtNomeproduto.Text = "";

txtQuantidade.Text = "";

txtValorunitario.Text = "";

lblValortotal.Text = "0";

lblLucro.Text = "";

}

public void limparRetirar()

{

txtCodproduto.Text = "";

txtNomeproduto.Text = "";

txtQuantidade.Text = "";

txtValorunitario.Text = "";

}

public void desabilitacampos()

{

//textboxes

txtCodvenda.Enabled = false;

lblCodvenda.Enabled = false;

txtVendedor.Enabled = false;

txtCodcliente.Enabled = false;

txtNomecliente.Enabled = false;

txtCodproduto.Enabled = false;

txtNomeproduto.Enabled = false;

txtQuantidade.Enabled = false;

txtValorunitario.Enabled = false;

lblValortotal.Enabled = false;

btnRetirar.Enabled = false;

btnAdicionar.Enabled = false;

}

public void habilitabotoes()

{

//botões novo alterar excluir

btnSalvar.Visible = true;

btnCancelar.Visible = true;

btnNovo.Visible = false;

btnAlterar.Visible = false;

btnExcluir.Visible = false;

btnSair2.Visible = false;

}

public void habilitarcampos()

{

...

Baixar como (para membros premium)  txt (20.2 Kb)   pdf (70.1 Kb)   docx (23.2 Kb)  
Continuar por mais 29 páginas »
Disponível apenas no TrabalhosGratuitos.com