示例#1
0
        private void guardarNuevoRegistro()
        {
            if (DMS.UtilidadesDesktop.TextboxProcess.validarRequeridos(txtNombreColumna, txtNombreTecnicoColumna) &&
                UtilidadesDesktop.ComboboxUtilities.selectedTextValidate(cmbTipoDato))
            {
                DMS.Modelos.CamposCatalogo campos = new Modelos.CamposCatalogo();

                campos.Catalogo           = catalogoPadre;
                campos.NombreCampo        = txtNombreColumna.Text;
                campos.DescripcionCampo   = txtDescripcionColumna.Text;
                campos.NombreTecnicoCampo = txtNombreTecnicoColumna.Text;
                campos.TipoDatoCampo      = cmbTipoDato.Text;
                campos.Tamanio            = (int)numTamanio.Value;
                campos.Presicion          = (int)numPresicion.Value;
                campos.ConReferencia      = false;
                campos.Requerido          = chkRequerido.Checked;
                campos.LlavePrimaria      = false;
                campos.Orden  = Convert.ToInt16(txtOrden.Text);
                campos.Activo = true;

                try
                {
                    (new DMS.Servicio.ColumnasTablaServiceImpl()).nuevo(campos);
                    this.Close();
                }
                catch (Exception ex)
                {
                    DMS.UtilidadesDesktop.MessageBoxUtilities.errorAlmacenarRegistros(ex);
                }
            }
            else
            {
                string mensaje = "\n" + DMS.UtilidadesDesktop.TextboxProcess.tagsTextBoxString(txtNombreColumna, txtNombreTecnicoColumna);
                if (mensaje.Length > 0)
                {
                    mensaje = mensaje + ",";
                }
                mensaje = mensaje + UtilidadesDesktop.ComboboxUtilities.tagsComboboxString(cmbTipoDato);
                UtilidadesDesktop.MessageBoxUtilities.camposIncompletos(mensaje);
            }
        }
示例#2
0
        private void DtgDetalleColumnas_DoubleClick(object sender, EventArgs e)
        {
            var dato = new Modelos.CamposCatalogo();

            dato.CodigoCampoCatalogo = Convert.ToInt16(DMS.UtilidadesDesktop.DatagridViewUtilities.ObtenerValorCeldaActual(dtgDetalleColumnas, "CatalogoCampoId").ToString());
            var campo = (new Servicio.ColumnasTablaServiceImpl()).obtenePorId(dato);

            CreacionEstructura.CamposCatalogo campos = new CreacionEstructura.CamposCatalogo(catalogoGeneral, campo);
            campos.ShowDialog();
            btnActualizarCampos.PerformClick();

            try
            {
                dataGridView2.Visible    = true;
                dataGridView2.DataSource = (new Servicio.CatalogoServiceImpl()).executeQuery(StringUtilities.getSqlQuery("[" + catalogoGeneral.TipoCategoria.EsquemaFisico + "].[" + txtNombreFisicoCatalogo.Text + "]", dtgDetalleColumnas, numericUpDown1.Value));
            }
            catch (Exception ex)
            {
                dataGridView2.Visible = false;
            }
        }
示例#3
0
        private void BtnSeleccionar_Click(object sender, EventArgs e)
        {
            if (lstCampoHacerReferencia.Items.Count > 0)
            {
                var  selectedItem    = lstCampoHacerReferencia.SelectedItem;
                long CatalogoCampoId = (long)UtilidadesDesktop.StringUtilities.getValueOfObject(selectedItem, "CatalogoCampoId");

                Modelos.CamposCatalogo cat = new Modelos.CamposCatalogo();
                cat.CodigoCampoCatalogo = CatalogoCampoId;
                var valor = (new Servicio.ColumnasTablaServiceImpl()).obtenePorId(cat);

                valor.Catalogo = CatalogoBase;
                try
                {
                    (new Servicio.ColumnasTablaServiceImpl()).nuevo(valor);
                    this.Close();
                }
                catch (Exception ex)
                {
                }
            }
        }