Beispiel #1
0
        private void chkAcumulador_CheckStateChanged(object sender, EventArgs e)
        {
            if ((bool)this.chkAcumulador.EditValue == true)
            {
                //this.slkupCentroAcumulador.Enabled = false;
                if (this.slkupGrupoAcumulador.EditValue == null || this.slkupGrupoAcumulador.EditValue.ToString() == "")
                {
                    DataView dv = new DataView();
                    dv.Table     = _dtGrupo;
                    dv.RowFilter = string.Format("IDGrupo='{0}' ", 0);
                    DataTable dt = dv.ToTable();

                    bool EsAcumulador = Convert.ToBoolean((this.chkAcumulador.EditValue == null) ? false : this.chkAcumulador.EditValue);


                    int iProximoConsecutivo = GrupoEstadosFinancierosDAC.GetNextConsecutivo(-1, 0, 0, GetTipoGrupo());
                    //iProximoConsecutivo++;

                    this.txtNivel3.Text = "0";
                    this.txtNivel2.Text = "0";
                    this.txtNivel1.Text = iProximoConsecutivo.ToString();



                    //this.txtDescripcion.Text = "";
                }
            }
            //else
            //{
            //    this.slkupCentroAcumulador.Enabled = true;

            //}
        }
Beispiel #2
0
        private void btnAgregar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            isEdition = true;
            HabilitarControles(true);
            ClearControls();
            currentRow = null;

            //Agregar  los consecutivos

            int iProximoConsecutivo = GrupoEstadosFinancierosDAC.GetNextConsecutivo(-1, 0, 0, GetTipoGrupo());

            //iProximoConsecutivo++;

            this.txtNivel3.Text = "0";
            this.txtNivel2.Text = "0";
            this.txtNivel1.Text = iProximoConsecutivo.ToString();

            this.slkpTipoDeGrupo.Enabled = true;

            this.chkAcumulador.Enabled = true;
            this.txtDescripcion.Focus();
        }
Beispiel #3
0
        void slkupGrupoAcumulador_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (!isEdition)
                {
                    return;
                }
                if (this.slkupGrupoAcumulador.EditValue != null && this.slkupGrupoAcumulador.EditValue.ToString() != "")
                {
                    DataView dv = new DataView();
                    dv.Table     = _dtGrupo;
                    dv.RowFilter = string.Format("IDGrupo='{0}' ", this.slkupGrupoAcumulador.EditValue);
                    DataTable dt = dv.ToTable();

                    bool EsAcumulador = Convert.ToBoolean((this.chkAcumulador.EditValue == null) ? false : this.chkAcumulador.EditValue);

                    if (dt.Rows[0]["Nivel2"].ToString() != "0")
                    {
                        int iProximoConsecutivo = GrupoEstadosFinancierosDAC.GetNextConsecutivo(Convert.ToInt32(dt.Rows[0]["Nivel1"]), Convert.ToInt32(dt.Rows[0]["Nivel2"]), -1, GetTipoGrupo());

                        //iProximoConsecutivo++;

                        this.txtNivel3.Text = iProximoConsecutivo.ToString();
                        this.txtNivel2.Text = dt.Rows[0]["Nivel2"].ToString();
                        this.txtNivel1.Text = dt.Rows[0]["Nivel1"].ToString();
                    }
                    else if (dt.Rows[0]["Nivel1"].ToString() != "0")
                    {
                        int iProximoConsecutivo = GrupoEstadosFinancierosDAC.GetNextConsecutivo(Convert.ToInt32(dt.Rows[0]["Nivel1"]), -1, 0, GetTipoGrupo());
                        //iProximoConsecutivo++;

                        this.txtNivel3.Text = "0";
                        this.txtNivel2.Text = iProximoConsecutivo.ToString();
                        this.txtNivel1.Text = dt.Rows[0]["Nivel1"].ToString();
                    }

                    //Inactivar  los acumuladores
                    if (this.txtNivel3.Text != "0")
                    {
                        this.chkAcumulador.Enabled = false;
                    }
                    else
                    {
                        this.chkAcumulador.Enabled = true;
                    }

                    this.slkpTipoDeGrupo.EditValue = dt.Rows[0]["IDGrupoCuenta"];
                    if (this.cmbTipoGrupo.SelectedIndex == 0)
                    {
                        this.slkpTipoDeGrupo.Enabled = true;
                    }
                    else
                    {
                        this.slkpTipoDeGrupo.Enabled = false;
                    }
                    this.txtDescripcion.Text = "";
                    this.txtDescripcion.Focus();
                }
            }
            catch (Exception ex)
            {
            }
        }