Exemple #1
0
        private void BtnGenerar_Click(object sender, EventArgs e)
        {
            DateTime FechaInicio;
            int      MesInicioOperaciones = 0;
            bool     InicioOperaciones    = false;

            try
            {
                //Validar Datos
                if (ValidarDatos())
                {
                    if (Convert.ToBoolean(this.ckEsInicioOperaciones.EditValue) == true)
                    {
                        MesInicioOperaciones = Convert.ToDateTime(this.dtMesInicio.EditValue).Month;
                        InicioOperaciones    = true;
                    }
                    FechaInicio = Convert.ToDateTime(this.dtFechaInicio.EditValue);
                    EjercicioDAC.CreaEjercicio(FechaInicio, InicioOperaciones, MesInicioOperaciones);
                    MessageBox.Show("Se ha creado el ejercicio...");
                }
            } catch (Exception ex)
            {
                MessageBox.Show("Han ocurrido los siguientes errores, " + ex.Message);
            }
        }
Exemple #2
0
        private void frmCreaEjercicio_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.StartPosition   = FormStartPosition.CenterScreen;

            //Validar si ya existen periodos

            int IDEjercicio = EjercicioDAC.GetNextConsecutivo();

            if (IDEjercicio == -1)
            {
                //Primera vez que se ejecuta el procedimiento
                this.dtFechaInicio.EditValue         = DateTime.Now;
                this.dtMesInicio.EditValue           = DateTime.Now;
                this.ckEsInicioOperaciones.EditValue = true;
            }
            else
            {
                this.dtFechaInicio.EditValue         = Convert.ToDateTime(DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month + "/" + ++IDEjercicio);
                this.ckEsInicioOperaciones.Enabled   = false;
                this.ckEsInicioOperaciones.EditValue = false;
                this.dtMesInicio.Enabled             = false;
                this.dtMesInicio.EditValue           = null;
            }
        }
Exemple #3
0
        private void frmListadoPeriodos_Load(object sender, EventArgs e)
        {
            try
            {
                //HabilitarControles(false);
                _dtEjericio = EjercicioDAC.GetData(-1).Tables[0];
                this.gridView.FocusedRowChanged += GridView_FocusedRowChanged;
                Util.Util.ConfigLookupEdit(this.slkupEjercicio, _dtEjericio, "Descr", "IDEjercicio");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupEjercicio, "[{'ColumnCaption':'ID','ColumnField':'IDEjercicio','width':30},{'ColumnCaption':'Descripción','ColumnField':'Descr','width':70}]");

                if (_dtEjericio.Rows.Count > 0)
                {
                    this.slkupEjercicio.EditValue = _dtEjericio.Rows[_dtEjericio.Rows.Count - 1]["IDEjercicio"];
                }

                EnlazarEventos();
                Util.Util.SetDefaultBehaviorControls(this.gridView, true, this.grid, _tituloVentana, this);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }