Exemplo n.º 1
0
        private void funcao(string funcao)
        {
            switch (funcao)
            {
            case "alterar":
                v_NovaDistribuicaoFolhaAvulso v_AltearDist = new v_NovaDistribuicaoFolhaAvulso(
                    Convert.ToInt32(advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[0])),
                    Convert.ToInt32(advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[9])),
                    Convert.ToInt32(advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[11])),
                    Convert.ToDateTime(advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[3])),
                    advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[1]).ToString(),
                    Convert.ToDecimal(advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[7])),
                    advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[6]).ToString(),
                    advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[8]).ToString(),
                    true);
                v_AltearDist.ShowDialog();
                break;

            case "excluir":
                m_distFolhasAvulsas.iddistribuicaofolhasavulsas = (int)advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[0]);
                c_distFolhasAvulsas.ExcluirDistribuicao(m_distFolhasAvulsas);
                MessageBox.Show("Excluido com sucesso!", "SGS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CarregarGrid();
                break;

            case "status":
                var CodigoDistFolha = (int)advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[0]);
                v_StatusFolhaAvulso v_statusFolha = new v_StatusFolhaAvulso(CodigoDistFolha, _UsuarioCad);
                v_statusFolha.ShowDialog();
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            v_NovaDistribuicaoFolhaAvulso v_novaDist = new v_NovaDistribuicaoFolhaAvulso(_UsuarioCad);

            v_novaDist.ShowDialog();
        }