示例#1
0
        private void btnGerenciarEmpresas_Click(object sender, EventArgs e)
        {
            var cadastro = new CadastroGenerico("Empresa");

            cadastro.ShowDialog(this);
            refreshEmpresas();
        }
示例#2
0
        private void btnGerenciarProdutos_Click(object sender, EventArgs e)
        {
            var cadastro = new CadastroGenerico("Produto");

            cadastro.ShowDialog(this);
            refreshProdutos();
        }
示例#3
0
        private void btnGerenciarUnidades_Click(object sender, EventArgs e)
        {
            var cadastro = new CadastroGenerico("Unidade");

            cadastro.ShowDialog(this);
            refreshUnidades();
        }
示例#4
0
        private void ComboSelectionChanged(object sender, EventArgs e)
        {
            var currentCol = dtgProdutos.CurrentCell.ColumnIndex;

            if (currentCol == colProduto.Index)
            {
                var produto =
                    (dtgProdutos.Rows[dtgProdutos.CurrentRow.Index].Cells[colProduto.Index] as DataGridViewComboBoxCell)
                    .EditedFormattedValue.ToString();
                if (produto == "Gerenciar Produtos")
                {
                    var cadastro = new CadastroGenerico("Produto");
                    cadastro.ShowDialog(this);
                    refreshProdutos();
                }
            }
            else if (currentCol == colUnidade.Index)
            {
                var unidade = (dtgProdutos.Rows[dtgProdutos.CurrentRow.Index].Cells[colUnidade.Index] as DataGridViewComboBoxCell)
                              .EditedFormattedValue.ToString();
                if (unidade == "Gerenciar Unidades")
                {
                    var cadastro = new CadastroGenerico("Unidade");
                    cadastro.ShowDialog(this);
                    refreshUnidades();
                }
            }
            else if (currentCol == colEmpresa.Index)
            {
                var empresa = (dtgProdutos.Rows[dtgProdutos.CurrentRow.Index].Cells[colEmpresa.Index] as DataGridViewComboBoxCell)
                              .EditedFormattedValue.ToString();
                if (empresa == "Gerenciar Empresas")
                {
                    var cadastro = new CadastroGenerico("Empresa");
                    cadastro.ShowDialog(this);
                    refreshEmpresas();
                }
            }
        }