Exemple #1
0
        private void funcao(string funcao)
        {
            switch (funcao)
            {
            case "alterar":
                v_NovaDistribuicaoContrato v_AlterarDistribuicao = new v_NovaDistribuicaoContrato(_usuarioCad, true,
                                                                                                  (int)advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[0]),
                                                                                                  advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[3]).ToString(),
                                                                                                  advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[1]).ToString(),
                                                                                                  (int)advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[5]),
                                                                                                  (DateTime)advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[7]));
                v_AlterarDistribuicao.ShowDialog();
                break;

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

            case "status":
                var CodigoDistContrato            = (int)advBandedGridView1.GetRowCellValue(advBandedGridView1.GetSelectedRows()[0], advBandedGridView1.Columns[0]);
                v_StatusContrato v_statusContrato = new v_StatusContrato(_usuarioCad, CodigoDistContrato);
                v_statusContrato.ShowDialog();
                break;

            default:
                break;
            }
        }
Exemple #2
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            v_NovaDistribuicaoContrato v_novaDist = new v_NovaDistribuicaoContrato(_usuarioCad);

            v_novaDist.ShowDialog();
        }