Exemple #1
0
        private void FrmConsultaSaldoCuenta_Load(object sender, EventArgs e)
        {
            try
            {
                DateTime fechatemp = DateTime.Today;

                this.dtDesde.EditValue = new DateTime(fechatemp.Year, fechatemp.Month, 1);
                if (fechatemp.Month + 1 < 13)
                {
                    this.dtHasta.EditValue = new DateTime(fechatemp.Year, fechatemp.Month + 1, 1).AddDays(-1);
                }
                else
                {
                    this.dtHasta.EditValue = new DateTime(Convert.ToInt32(fechatemp.Year) + 1, 1, 1).AddDays(-1);
                }



                _dtCentroCosto = CentroCostoDAC.GetData(-1, "*", "*", "*", "*", 0).Tables[0]; //No estamos tomando los acumuladores

                Util.Util.ConfigLookupEdit(this.slkupCentroCosto, _dtCentroCosto, "Descr", "IDCentro");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCentroCosto, "[{'ColumnCaption':'Centro','ColumnField':'Centro','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");
                this.slkupCentroCosto.Properties.ShowClearButton = true;
                this.slkupCentroCosto.Properties.PopupFormSize   = new Size(400, 300);
                this.slkupCentroCosto.Properties.BestFitMode     = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            }
            catch (Exception ex) {
                MessageBox.Show("Han ocurrido los siguientes errores : " + ex.Message);
            }
        }
Exemple #2
0
        private void chkAcumulador_CheckStateChanged(object sender, EventArgs e)
        {
            if ((bool)this.chkAcumulador.EditValue == true)
            {
                //this.slkupCentroAcumulador.Enabled = false;
                if (this.slkupCentroAcumulador.EditValue == null || this.slkupCentroAcumulador.EditValue.ToString() == "")
                {
                    DataView dv = new DataView()
                    {
                        Table = _dtCentro, RowFilter = string.Format("IDCentro='{0}' ", 0)
                    };
                    DataTable dt = dv.ToTable();

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


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

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



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

            //}
        }
Exemple #3
0
        private void frmBalanceGeneral_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.StartPosition   = FormStartPosition.CenterScreen;

            DateTime fechatemp = DateTime.Today;

            this.dtpFechaInicial.EditValue = new DateTime(fechatemp.Year, fechatemp.Month, 1);
            if (fechatemp.Month + 1 < 13)
            {
                this.dtpFechaFinal.EditValue = new DateTime(fechatemp.Year, fechatemp.Month + 1, 1).AddDays(-1);
            }
            else
            {
                this.dtpFechaFinal.EditValue = new DateTime(fechatemp.Year + 1, 1, 1).AddDays(-1);
            }


            _dtCentroCosto = CentroCostoDAC.GetData(-1, "*", "*", "*", "*", 0).Tables[0]; //No estamos tomando los acumuladores

            Util.Util.ConfigLookupEdit(this.slkupCentroCostoDesde, _dtCentroCosto, "Descr", "IDCentro");
            Util.Util.ConfigLookupEditSetViewColumns(this.slkupCentroCostoDesde, "[{'ColumnCaption':'Centro','ColumnField':'Centro','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");
            //this.chkTotalizarporSecciones.Checked = true;
            this.chkCalcularUtilidad.Checked = true;
        }
Exemple #4
0
        //private void slkupCentroAnterior_EditValueChanged(object sender, EventArgs e)
        //{

        //    try
        //    {
        //        if (!isEdition)
        //            return;

        //        if (this.slkupCentroAnterior.EditValue != null && this.slkupCentroAnterior.EditValue.ToString() != "")
        //        {
        //            DataView dv = new DataView();
        //            dv.Table = _dtCentro;
        //            dv.RowFilter = "IDCentro='" + this.slkupCentroAnterior.EditValue.ToString() + "'";
        //            this.txtNivel1.Text = dv[0].Row["Nivel1"].ToString();

        //            DataTable dt = dv.ToTable();
        //            int i = -1;
        //            if (dt.Rows[0]["Nivel3"].ToString() != "0")
        //            {
        //                i = Convert.ToInt32(dt.Rows[0]["Nivel3"]);
        //                i++;
        //                this.txtNivel3.Text = i.ToString();
        //                this.txtNivel2.Text = dt.Rows[0]["Nivel2"].ToString();


        //            }
        //            else if (dt.Rows[0]["Nivel2"].ToString() != "0")
        //            {
        //                i = Convert.ToInt32(dt.Rows[0]["Nivel2"]);
        //                i++;
        //                this.txtNivel2.Text = i.ToString();
        //                this.txtNivel3.Text = "0";
        //            }


        //        }

        //    }
        //    catch (Exception ex)
        //    {
        //        MessageBox.Show(ex.Message);
        //    }

        //}

        private void slkupCentroAcumulador_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (!isEdition)
                {
                    return;
                }
                if (this.slkupCentroAcumulador.EditValue != null && this.slkupCentroAcumulador.EditValue.ToString() != "")
                {
                    DataView dv = new DataView()
                    {
                        Table = _dtCentro, RowFilter = string.Format("IDCentro='{0}' ", this.slkupCentroAcumulador.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 = CentroCostoDAC.GetNextConsecutivo(Convert.ToInt32(dt.Rows[0]["Nivel1"]), Convert.ToInt32(dt.Rows[0]["Nivel2"]), -1);

                        //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 = CentroCostoDAC.GetNextConsecutivo(Convert.ToInt32(dt.Rows[0]["Nivel1"]), -1, 0);
                        //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.txtDescripcion.Text = "";
                    this.txtDescripcion.Focus();
                }
            } catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #5
0
        private void PopulateGrid()
        {
            _dsCentro = CentroCostoDAC.GetData(-1, "*", "*", "*", "*", -1);

            _dtCentro           = _dsCentro.Tables[0];
            this.dtg.DataSource = null;
            this.dtg.DataSource = _dtCentro;

            PopulateData();
        }
Exemple #6
0
        void frmPopPupCentroCosto_Load(object sender, EventArgs e)
        {
            _dtCentros = CentroCostoDAC.GetData(-1, "*", "*", "*", "*", -1).Tables[0];
            // _dtCuentasConstante = _dtCuentas.Clone();

            this.gridCentroCosto.DataSource = _dtCentros;
            if (sCostosSelected != "")
            {
                CheckElements();
            }
        }
Exemple #7
0
        private void FrmReporteDelMayor_Load(object sender, EventArgs e)
        {
            try
            {
                this.FormBorderStyle = FormBorderStyle.FixedSingle;
                this.MaximizeBox     = false;
                this.StartPosition   = FormStartPosition.CenterScreen;

                //Obtener los datos
                _dtCentroCosto    = CentroCostoDAC.GetData(-1, "*", "*", "*", "*", 0).Tables[0]; //No estamos tomando los acumuladores
                _dtCuentaContable = CuentaContableDAC.GetData(-1, -1, -1, "*", "*", "*", "*", "*", "*", "*", -1, -1, -1, 1, -1, -1).Tables[0];

                Util.Util.ConfigLookupEdit(this.slkupCentoCostoDesde, _dtCentroCosto, "Descr", "IDCentro");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCentoCostoDesde, "[{'ColumnCaption':'Centro','ColumnField':'Centro','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");

                Util.Util.ConfigLookupEdit(this.slkupCentroCostoHasta, _dtCentroCosto, "Descr", "IDCentro");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCentroCostoHasta, "[{'ColumnCaption':'Centro','ColumnField':'Centro','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");


                Util.Util.ConfigLookupEdit(this.slkupCuentaContableDesde, _dtCuentaContable, "Descr", "IDCuenta");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCuentaContableDesde, "[{'ColumnCaption':'Cuenta','ColumnField':'Cuenta','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");

                Util.Util.ConfigLookupEdit(this.slkupCuentaContableHasta, _dtCuentaContable, "Descr", "IDCuenta");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCuentaContableHasta, "[{'ColumnCaption':'Cuenta','ColumnField':'Cuenta','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");


                this.rbTotalesDiarios.Checked              = true;
                this.rgImprimirCuentas.SelectedIndex       = 0;
                this.rgCuentasSinMovimientos.SelectedIndex = 0;
                this.chkActivo.Checked     = true;
                this.chkPasivo.Checked     = true;
                this.chkGasto.Checked      = true;
                this.chkIngreso.Checked    = true;
                this.chkOrden.Checked      = true;
                this.chkPatrimonio.Checked = true;

                DateTime fechatemp = DateTime.Today;
                this.dtpFechaDesde.EditValue = new DateTime(fechatemp.Year, fechatemp.Month, 1);
                if (fechatemp.Month + 1 < 13)
                {
                    this.dtpFechaHasta.EditValue = new DateTime(fechatemp.Year, fechatemp.Month + 1, 1).AddDays(-1);
                }
                else
                {
                    this.dtpFechaHasta.EditValue = new DateTime(fechatemp.Year + 1, 1, 1).AddDays(-1);
                }

                this.rgCuentasSinMovimientos.SelectedIndex = 1;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #8
0
        private void FrmReporteMayorporAsiento_Load(object sender, EventArgs e)
        {
            try
            {
                this.FormBorderStyle = FormBorderStyle.FixedSingle;
                this.MaximizeBox     = false;
                this.StartPosition   = FormStartPosition.CenterScreen;

                //Obtener los datos
                _dtCentro      = CentroCostoDAC.GetData(-1, "*", "*", "*", "*", 0).Tables[0]; //No estamos tomando los acumuladores
                _dtCuenta      = CuentaContableDAC.GetData(-1, -1, -1, "*", "*", "*", "*", "*", "*", "*", -1, -1, -1, 1, -1, -1).Tables[0];
                _dtTipoAsiento = TipoAsientoDAC.GetData().Tables[0];

                Util.Util.ConfigLookupEdit(this.slkupCentroDesde, _dtCentro, "Descr", "IDCentro");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCentroDesde, "[{'ColumnCaption':'Centro','ColumnField':'Centro','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");

                Util.Util.ConfigLookupEdit(this.slkupCentroHasta, _dtCentro, "Descr", "IDCentro");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCentroHasta, "[{'ColumnCaption':'Centro','ColumnField':'Centro','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");


                Util.Util.ConfigLookupEdit(this.slkupCuentaDesde, _dtCuenta, "Descr", "IDCuenta");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCuentaDesde, "[{'ColumnCaption':'Cuenta','ColumnField':'Cuenta','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");

                Util.Util.ConfigLookupEdit(this.slkupCuentaHasta, _dtCuenta, "Descr", "IDCuenta");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCuentaHasta, "[{'ColumnCaption':'Cuenta','ColumnField':'Cuenta','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");

                Util.Util.ConfigLookupEdit(this.slkupTipoAsiento, _dtTipoAsiento, "Descr", "Tipo");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupTipoAsiento, "[{'ColumnCaption':'Tipo','ColumnField':'Tipo','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");


                DateTime fechatemp = DateTime.Today;
                this.dtpFechaDesde.EditValue = new DateTime(fechatemp.Year, fechatemp.Month, 1);
                if (fechatemp.Month + 1 < 13)
                {
                    this.dtpFechaHasta.EditValue = new DateTime(fechatemp.Year, fechatemp.Month + 1, 1).AddDays(-1);
                }
                else
                {
                    this.dtpFechaHasta.EditValue = new DateTime(fechatemp.Year + 1, 1, 1).AddDays(-1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #9
0
        private void btnAgregar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            isEdition = true;
            HabilitarControles(true);
            ClearControls();
            currentRow = null;

            //Agregar  los consecutivos

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

            //iProximoConsecutivo++;

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

            this.txtDescripcion.Focus();
        }
Exemple #10
0
 private void PopulateData()
 {
     _lstCentroAcumuladores = CentroCostoDAC.GetData(-1, "*", "*", "*", "*", 1).Tables["Data"];
     Util.Util.ConfigLookupEdit(this.slkupCentroAcumulador, _lstCentroAcumuladores, "Descr", "IDCentro");
     Util.Util.ConfigLookupEditSetViewColumns(this.slkupCentroAcumulador, "[{'ColumnCaption':'Centro','ColumnField':'Centro','width':30},{'ColumnCaption':'Descripción','ColumnField':'Descr','width':70}]");
 }