private void dgvDescuentoGrupal_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string colName = this.dgvDescuentoGrupal.Columns[e.ColumnIndex].Name;

            if (colName == "DSC_fecha_vencimiento")
            {
                Point punto           = Cursor.Position;
                frm_EstablecerFecha o = new frm_EstablecerFecha(punto, "descuento");

                DialogResult respuesta = o.ShowDialog();
                if (respuesta == DialogResult.OK)
                {
                    this.dgvDescuentoGrupal["DSC_fecha_vencimiento", e.RowIndex].Value = o.pk;
                    this.dgvDescuentoGrupal.RefreshEdit();
                }
            }
        }
Beispiel #2
0
        private void dgvDetalle_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex >= 0)
            {
                if (e.RowIndex >= 0 && this.dgvDetalle.Columns[e.ColumnIndex].Name == "PRO_codigo" && this.txtCodigoSocio.Text.Length > 0)
                {
                    int IndiceFila = this.dgvDetalle.CurrentRow.Index;
                    autocompletarCeldasGrilla(IndiceFila);
                }
            }

            string colName = this.dgvDetalle.Columns[e.ColumnIndex].Name;

            if (colName == "Fecha_produccion")
            {
                Point punto           = Cursor.Position;
                frm_EstablecerFecha o = new frm_EstablecerFecha(punto, "compra");

                DialogResult respuesta = o.ShowDialog();
                if (respuesta == DialogResult.OK)
                {
                    this.dgvDetalle["Fecha_produccion", e.RowIndex].Value = Convert.ToDateTime(o.pk).ToShortDateString();
                    this.dgvDetalle.RefreshEdit();
                }
            }
            if (colName == "Fecha_vencimiento")
            {
                Point punto           = Cursor.Position;
                frm_EstablecerFecha o = new frm_EstablecerFecha(punto, "compra");

                DialogResult respuesta = o.ShowDialog();
                if (respuesta == DialogResult.OK)
                {
                    this.dgvDetalle["Fecha_vencimiento", e.RowIndex].Value = Convert.ToDateTime(o.pk).ToShortDateString();
                    this.dgvDetalle.RefreshEdit();
                }
            }
        }
        private void dgvListado_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int IndiceFila = this.dgvListado.CurrentRow.Index;

            int    indiceColumna = this.dgvListado.CurrentCell.ColumnIndex;
            string nombreColumna = this.dgvListado.Columns[indiceColumna].Name;

            InsertarFilaGrilla(IndiceFila, nombreColumna);

            string colName = this.dgvListado.Columns[e.ColumnIndex].Name;

            if (colName == "BON_fecha_vencimiento")
            {
                Point punto           = Cursor.Position;
                frm_EstablecerFecha o = new frm_EstablecerFecha(punto, "bonificaciones");

                DialogResult respuesta = o.ShowDialog();
                if (respuesta == DialogResult.OK)
                {
                    this.dgvListado["BON_fecha_vencimiento", e.RowIndex].Value = o.pk;
                    this.dgvListado.RefreshEdit();
                }
            }
        }