Exemplo n.º 1
0
        private void Fornecedores()
        {
            dgvRegistros.DataSource            = BusinesFornecedor.Fornecedor_Lista();
            dgvRegistros.Columns["id"].Visible = false;
            dgvRegistros.Columns["nome_fantasia"].HeaderText = "Nome Fantasia";
            dgvRegistros.Columns["cnpj"].HeaderText          = "CNPJ";
            dgvRegistros.Columns["email"].HeaderText         = "E-mail";
            dgvRegistros.Columns["fone"].HeaderText          = "Telefone";
            dgvRegistros.Columns["uf"].HeaderText            = "UF";
            dgvRegistros.Columns["cidade"].HeaderText        = "Cidade";
            dgvRegistros.Columns["delete"].DisplayIndex      = 7;


            //
            //DataGridViewCellStyle style = dgvRegistros.ColumnHeadersDefaultCellStyle;
            //style.BackColor = Color.WhiteSmoke;
            //style.ForeColor = Color.Black;
            //style.Font = new Font("Open Sans", 8, FontStyle.Bold);
            //style.SelectionBackColor = Color.WhiteSmoke;

            ////
            //dgvRegistros.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            //dgvRegistros.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            //dgvRegistros.ColumnHeadersHeight = 50;
            //dgvRegistros.ColumnHeadersVisible = true;
            ////
            //dgvRegistros.RowTemplate.Height = 50;
            ////
            //dgvRegistros.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None;
            //dgvRegistros.ColumnHeadersHeight = 30;
            //dgvRegistros.ColumnHeadersDefaultCellStyle.BackColor = Color.Black;
        }
 private void btnSalvar_Click(object sender, EventArgs e)
 {
     try
     {
         string rpta = "";
         if (IsNew == true)
         {
             rpta = BusinesFornecedor.Fornecedor_Cadastro
                    (
                 txtCnpj.Text.Trim().ToUpper(),
                 txtNomeFantasia.Text.Trim().ToUpper(),
                 txtRazaoSocial.Text.Trim().ToUpper(),
                 txtIE.Text.Trim().ToUpper(),
                 txtEmail.Text.Trim().ToLower(),
                 txtFone.Text.Trim(),
                 txtWhats.Text.Trim(),
                 txtPais.Text.Trim().ToUpper(),
                 txtUf.Text.Trim().ToUpper(),
                 txtCidade.Text.Trim().ToUpper(),
                 txtBairro.Text.Trim().ToUpper(),
                 txtRua.Text.Trim().ToUpper(),
                 txtNumero.Text.Trim().ToUpper(),
                 txtComplemento.Text.Trim().ToUpper(),
                 txtCep.Text.Trim().ToUpper(),
                 txtContato.Text.Trim().ToUpper()
                    );
         }
         if (rpta.Equals("OK"))
         {
             msgSuccess("Cadastro realizado com sucesso");
         }
         else
         {
             msgError(rpta);
         }
     }
     catch (Exception ex)
     {
         msgError(ex.Message + ex.StackTrace);
     }
 }
Exemplo n.º 3
0
 private void Fornecedores()
 {
     cbFornecedor.DataSource    = BusinesFornecedor.Fornecedor_Lista();
     cbFornecedor.DisplayMember = "nome_fantasia";
     cbFornecedor.ValueMember   = "id";
 }