public static void ExcluirCorretora(CorretoraVO corretora)
        {
            SqlParameter spId = new SqlParameter("@id", SqlDbType.Int)
            {
                Value = corretora.Id
            };

            using (BancoDados bd = new BancoDados())
            {
                bd.NonQuery("SP_EXCLUIR_CORRETORA", CommandType.StoredProcedure, spId);
            }
        }
        public static void InserirCorretora(CorretoraVO corretora)
        {
            SqlParameter spNome = new SqlParameter("@nome", SqlDbType.VarChar, 100)
            {
                Value = corretora.Nome
            };
            SqlParameter spPercentual = new SqlParameter("@perc", SqlDbType.Float)
            {
                Value = corretora.Percentual
            };

            using (BancoDados bd = new BancoDados())
            {
                bd.NonQuery("SP_INCLUSAO_CORRETORA", CommandType.StoredProcedure, spNome, spPercentual);
            }
        }
        public void CarregarComboCorretora()
        {
            IList <CorretoraVO> listaCorretoras = new List <CorretoraVO>();

            var lista = cad.ListarCorretora();

            foreach (var item in lista)
            {
                var corretora = new CorretoraVO();
                corretora.Nome = item.Nome;
                corretora.Id   = item.Id;
                listaCorretoras.Add(corretora);
            }

            cbCorretora.DropDownStyle = ComboBoxStyle.DropDownList;
            cbCorretora.ValueMember   = "Id";
            cbCorretora.DisplayMember = "Nome";
            cbCorretora.DataSource    = listaCorretoras;
            cbCorretora.Update();
        }
Esempio n. 4
0
        public void CarregarGridCorretora()
        {
            IList <CorretoraVO> listaCorretoras = new List <CorretoraVO>();

            var lista = cad.ListarCorretora();

            foreach (var item in lista)
            {
                var corretora = new CorretoraVO();
                corretora.Nome       = item.Nome;
                corretora.Percentual = item.Percentual;
                corretora.Id         = item.Id;
                listaCorretoras.Add(corretora);
            }

            BindingSource banco = new BindingSource();

            banco.DataSource               = listaCorretoras;
            dtCorretora.DataSource         = banco;
            dtCorretora.Columns[0].Visible = true;
        }
Esempio n. 5
0
 public void ExcluirCorretora(CorretoraVO corretora)
 {
     CorretoraRepositorio.ExcluirCorretora(corretora);
 }
Esempio n. 6
0
 public void AlterarCorretora(CorretoraVO corretora)
 {
     CorretoraRepositorio.AlterarCorretora(corretora);
 }
Esempio n. 7
0
 public void InserirCorretora(CorretoraVO corretora)
 {
     CorretoraRepositorio.InserirCorretora(corretora);
 }