public List <pFornecedor> SelFornecedor(string Cnpj) { Dao D = new Dao(); DataTable DT = D.SelFornecedor(Cnpj); List <pFornecedor> LC = new List <pFornecedor>(); for (int i = 0; i < DT.Rows.Count; i++) { pFornecedor P = new pFornecedor(); P.Cod_Fornecedor = Convert.ToInt32(DT.Rows[i]["Cod_Fornecedor"]); P.Razao_Social = DT.Rows[i]["Razao_Social"].ToString(); P.Cnpj = DT.Rows[i]["Cnpj"].ToString(); P.Telefone = DT.Rows[i]["Telefone"].ToString(); P.Email = DT.Rows[i]["Email"].ToString(); P.Tipo_Peca = (DT.Rows[i]["Tipo_Peca"]).ToString(); P.Estado = DT.Rows[i]["Estado"].ToString(); P.Uf = DT.Rows[i]["Uf"].ToString(); P.Lougradouro = DT.Rows[i]["Lougradouro"].ToString(); P.Complemento = DT.Rows[i]["Complemento"].ToString(); P.Bairro = DT.Rows[i]["Bairro"].ToString(); P.Cep = DT.Rows[i]["Cep"].ToString(); LC.Add(P); } return(LC); }
public List <pFornecedor> SelFornecedor() { Dao D = new Dao(); DataTable DT = D.SelFornecedor(); List <pFornecedor> LC = new List <pFornecedor>(); for (int i = 0; i < DT.Rows.Count; i++) { pFornecedor P = new pFornecedor(); P.Cod_Fornecedor = Convert.ToInt32(DT.Rows[i]["Cod_Fornecedor"]); P.Razao_Social = DT.Rows[i]["Razao_Social"].ToString(); P.Tipo_Peca = (DT.Rows[i]["Tipo_Peca"]).ToString(); LC.Add(P); } return(LC); }
protected void btnAlterar_Click(object sender, EventArgs e) { Msg("Alterado com sucesso!"); string Cnpj = txtBuscaCnpj.Text; pFornecedor P = new pFornecedor(); P.Razao_Social = txtRazaoSocial.Text; P.Cnpj = txtCnpj.Text; P.Telefone = txtTelefone.Text; P.Email = txtEmail.Text; P.Tipo_Peca = txtTipoPeca.Text; P.Estado = txtEstado.Text; P.Uf = txtUf.Text; P.Lougradouro = txtLougradouro.Text; P.Complemento = txtComplemento.Text; P.Bairro = txtBairro.Text; P.Cep = txtCep.Text; mFornecedor M = new mFornecedor(); M.AtuFornecedor(P); LimparContatos(); }
protected void btnEnviar_Click(object sender, EventArgs e) { if (txtRazaoSocial.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtRazaoSocial.Focus(); return; } else if (txtCnpj.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtCnpj.Focus(); return; } else if (txtTelefone.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtTelefone.Focus(); return; } else if (txtEmail.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtEmail.Focus(); return; } else if (txtTipoPeca.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtTipoPeca.Focus(); return; } else if (txtEstado.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtEstado.Focus(); return; } else if (txtUf.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtUf.Focus(); return; } else if (txtLougradouro.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtLougradouro.Focus(); return; } else if (txtComplemento.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtComplemento.Focus(); return; } else if (txtBairro.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtBairro.Focus(); return; } else if (txtCep.Text == string.Empty) { Msg("Campo obrigatório em branco!"); txtCep.Focus(); return; } else if (ValidaCNPJ.IsCnpj(txtCnpj.Text)) { Msg("Cadastrado Com Sucesso!"); pFornecedor P = new pFornecedor(); P.Razao_Social = txtRazaoSocial.Text; P.Cnpj = txtCnpj.Text; P.Telefone = txtTelefone.Text; P.Email = txtEmail.Text; P.Tipo_Peca = txtTipoPeca.Text; P.Estado = txtEstado.Text; P.Uf = txtUf.Text; P.Lougradouro = txtLougradouro.Text; P.Complemento = txtComplemento.Text; P.Bairro = txtBairro.Text; P.Cep = txtCep.Text; mFornecedor M = new mFornecedor(); M.InsFornecedor(P); LimparContato(); } else { Msg("O número é um CNPJ Inválido !"); } }
public List<pFornecedor> SelFornecedor(string Cnpj) { Dao D = new Dao(); DataTable DT = D.SelFornecedor(Cnpj); List<pFornecedor> LC = new List<pFornecedor>(); for (int i = 0; i < DT.Rows.Count; i++) { pFornecedor P = new pFornecedor(); P.Cod_Fornecedor = Convert.ToInt32(DT.Rows[i]["Cod_Fornecedor"]); P.Razao_Social = DT.Rows[i]["Razao_Social"].ToString(); P.Cnpj = DT.Rows[i]["Cnpj"].ToString(); P.Telefone = DT.Rows[i]["Telefone"].ToString(); P.Email = DT.Rows[i]["Email"].ToString(); P.Tipo_Peca = (DT.Rows[i]["Tipo_Peca"]).ToString(); P.Estado = DT.Rows[i]["Estado"].ToString(); P.Uf = DT.Rows[i]["Uf"].ToString(); P.Lougradouro = DT.Rows[i]["Lougradouro"].ToString(); P.Complemento = DT.Rows[i]["Complemento"].ToString(); P.Bairro = DT.Rows[i]["Bairro"].ToString(); P.Cep = DT.Rows[i]["Cep"].ToString(); LC.Add(P); } return LC; }
public void InsFornecedor(pFornecedor P) { Dao D = new Dao(); D.InsFornecedor(P.Razao_Social, P.Cnpj, P.Telefone, P.Email, P.Tipo_Peca, P.Estado, P.Uf, P.Lougradouro, P.Complemento, P.Bairro, P.Cep); }
public List<pFornecedor> SelFornecedor() { Dao D = new Dao(); DataTable DT = D.SelFornecedor(); List<pFornecedor> LC = new List<pFornecedor>(); for (int i = 0; i < DT.Rows.Count; i++) { pFornecedor P = new pFornecedor(); P.Cod_Fornecedor = Convert.ToInt32(DT.Rows[i]["Cod_Fornecedor"]); P.Razao_Social = DT.Rows[i]["Razao_Social"].ToString(); P.Tipo_Peca = (DT.Rows[i]["Tipo_Peca"]).ToString(); LC.Add(P); } return LC; }
public void AtuFornecedor(pFornecedor P) { Dao D = new Dao(); D.AtuFornecedor(P.Razao_Social, P.Cnpj, P.Telefone, P.Email, P.Tipo_Peca, P.Estado, P.Uf, P.Lougradouro, P.Complemento, P.Bairro, P.Cep); }