Example #1
0
        private void AlterarRegistroGeral()
        {
            if ((dataGridSearchModule.CurrentRow.Cells["IdEmpr"].Value != null) && (dataGridSearchModule.CurrentRow.Cells["IdRg"].Value != null))
            {
                UpdateFormRegistroGeral _UpdateFormRegistroGeral = new UpdateFormRegistroGeral();
                _UpdateFormRegistroGeral.ModificaRegistroGeralType = ModificaRegistroGeralType.RegistroGeralAlterar;
                _UpdateFormRegistroGeral.IdEmpr       = IdEmpresaFromDashboard;
                _UpdateFormRegistroGeral.IdRg         = IdRegGeralLogDashboard;
                _UpdateFormRegistroGeral.UsuarioLogin = UsuarioLoginDashboard;
                _UpdateFormRegistroGeral.TextoDoTilutoDoFormulario = UserInterfaceWin.CreateInstance.GetFormTitleText(FormsMessages.TituloProcessoRegGeral, FormsMessages.TituloProcessoAcaoRegGeralAlteracao);

                _IdEmpresa  = (int)dataGridSearchModule.CurrentRow.Cells["IdEmpr"].Value;
                _IdRegistro = (int)dataGridSearchModule.CurrentRow.Cells["IdRg"].Value;

                _UpdateFormRegistroGeral.IdEmpr = _IdEmpresa;
                _UpdateFormRegistroGeral.IdRg   = _IdRegistro;

                AtualizaMapaDadosProcessoRegistroGeral(_IdEmpresa, _IdRegistro);

                try
                {
                    _UpdateFormRegistroGeral.ShowDialog();
                }
                finally
                {
                    AppStateOverallRecord.IdEmpresa  = _UpdateFormRegistroGeral.IdEmpr;
                    AppStateOverallRecord.IdRegistro = _UpdateFormRegistroGeral.IdRg;

                    _UpdateFormRegistroGeral.Dispose();

                    if ((AppStateOverallRecord.IdEmpresa != 0) && (AppStateOverallRecord.IdRegistro != 0))
                    {
                        _StrFilter = string.Format(" WHERE RG.cod_empr = {0} AND RG.cod_rg = {1} ", AppStateOverallRecord.IdEmpresa, AppStateOverallRecord.IdRegistro);
                        _IsFilter  = 1;

                        dataGridSearchModule.DataSource = null;
                        FillDataGrid(OverallRecordProcess.CreateInstance.TaskGetCollectionRgRegGeral(_StrFilter, _IsFilter));
                    }
                }
            }
        }
Example #2
0
        private void AdicionarRegistroGeral()
        {
            UpdateFormRegistroGeral _UpdateFormRegistroGeral = new UpdateFormRegistroGeral();

            _UpdateFormRegistroGeral.ModificaRegistroGeralType = ModificaRegistroGeralType.RegistroGeralAdicionar;
            _UpdateFormRegistroGeral.IdEmpr       = IdEmpresaFromDashboard;
            _UpdateFormRegistroGeral.IdRg         = IdRegGeralLogDashboard;
            _UpdateFormRegistroGeral.UsuarioLogin = UsuarioLoginDashboard;
            _UpdateFormRegistroGeral.TextoDoTilutoDoFormulario = UserInterfaceWin.CreateInstance.GetFormTitleText(FormsMessages.TituloProcessoRegGeral, FormsMessages.TituloProcessoAcaoRegGeralInclusao);

            _IdEmpresa = IdEmpresaFromDashboard;
            _Usuario   = UsuarioLoginDashboard;

            _UpdateFormRegistroGeral.IdEmpr       = _IdEmpresa;
            _UpdateFormRegistroGeral.UsuarioLogin = _Usuario;

            AppStateOverallRecord.RgRegGeral        = new RgRegGeral();
            AppStateOverallRecord.RgEndereco        = new RgEndereco();
            AppStateOverallRecord.RgFisicasJuridica = new RgFisicaJuridica();

            try
            {
                _UpdateFormRegistroGeral.ShowDialog();
            }
            finally
            {
                AppStateOverallRecord.IdEmpresa  = _UpdateFormRegistroGeral.IdEmpr;
                AppStateOverallRecord.IdRegistro = _UpdateFormRegistroGeral.IdRg;

                _UpdateFormRegistroGeral.Dispose();

                if ((AppStateOverallRecord.IdEmpresa != 0) && (AppStateOverallRecord.IdRegistro != 0))
                {
                    _StrFilter = string.Format(" WHERE RG.cod_empr = {0} AND RG.cod_rg = {1} ", AppStateOverallRecord.IdEmpresa, AppStateOverallRecord.IdRegistro);
                    _IsFilter  = 1;

                    dataGridSearchModule.DataSource = null;
                    FillDataGrid(OverallRecordProcess.CreateInstance.TaskGetCollectionRgRegGeral(_StrFilter, _IsFilter));
                }
            }
        }