Exemple #1
0
        public frmUpdateConexoes(Form frm, Enumeradores.TipoOperacao tpo, BindingSource bnd)
        {
            InitializeComponent();

            try
            {
                frmGrid        = frm;
                tpOperacao     = tpo;
                bndConexaoGrid = bnd;

                MdiParent = frmGrid.MdiParent;

                if (tpOperacao.Equals(Enumeradores.TipoOperacao.Insert))
                {
                    ConexaoDTOBindingSource.AddNew();
                }
                else
                {
                    conexaoDTO = (ConexoesDTO)bndConexaoGrid.Current;
                    ConexaoDTOBindingSource.DataSource = conexaoDTO;
                    conexaoDTOVersaoOriginal           = new ConexoesDTO(conexaoDTO);
                }

                conexaoDTO = (ConexoesDTO)ConexaoDTOBindingSource.Current;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Não foi possível efetuar a operação.\n\n" +
                                "Motivo: " + ex.Message, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemple #2
0
        public frmUpdateConexoes()
        {
            InitializeComponent();
            isSerializable = true;

            try
            {
                tpOperacao = Enumeradores.TipoOperacao.Insert;
                ConexaoDTOBindingSource.AddNew();
                conexaoDTO = (ConexoesDTO)ConexaoDTOBindingSource.Current;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Não foi possível efetuar a operação.\n\n" +
                                "Motivo: " + ex.Message, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }