コード例 #1
0
        private void PopulateGrid()
        {
            _dsCuenta = CuentaBancariaDAC.GetData(-1, -1);

            _dtCuenta = _dsCuenta.Tables[0];
            this.gridCuenta.DataSource = null;
            this.gridCuenta.DataSource = _dtCuenta;
        }
コード例 #2
0
 private void slkupCuentaBancaria_EditValueChanged(object sender, EventArgs e)
 {
     if (this.slkupCuentaBancaria.EditValue.ToString() != "" || this.slkupCuentaBancaria.EditValue != null)
     {
         this.tabDocumento.TabPages[0].PageEnabled = true;
         this.tabDocumento.TabPages[1].PageEnabled = true;
         this.txtNumero.EditValue = CuentaBancariaDAC.NextConsecutivoCheque(Convert.ToInt32(this.slkupCuentaBancaria.EditValue));
     }
     else
     {
         this.tabDocumento.TabPages[0].PageEnabled = false;
         this.tabDocumento.TabPages[1].PageEnabled = false;
     }
 }
コード例 #3
0
        private void frmDocumento_Load(object sender, EventArgs e)
        {
            try
            {
                HabilitarControles(false, false);

                CargarPrivilegios();
                EnlazarEventos();


                Util.Util.ConfigLookupEdit(this.slkupRuc, RucDAC.GetData(-1).Tables["Data"], "Nombre", "IDRuc");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupRuc, "[{'ColumnCaption':'Ruc','ColumnField':'RUC','width':30},{'ColumnCaption':'Nombre','ColumnField':'Nombre','width':30},{'ColumnCaption':'Alias','ColumnField':'Alias','width':70}]");


                Util.Util.ConfigLookupEdit(this.slkupTipo, TipoDocumentoDAC.GetData(-1).Tables["Data"], "Descr", "IDTipo");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupTipo, "[{'ColumnCaption':'Tipo','ColumnField':'Tipo','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");

                Util.Util.ConfigLookupEdit(this.slkupCuentaBancaria, CuentaBancariaDAC.GetData(-1, -1).Tables["Data"], "Descr", "IDCuentaBanco");
                Util.Util.ConfigLookupEditSetViewColumns(this.slkupCuentaBancaria, "[{'ColumnCaption':'Codigo','ColumnField':'Codigo','width':30},{'ColumnCaption':'Descripcion','ColumnField':'Descr','width':70}]");


                UpdateControlsFromDataRow(_currentRow);

                this.txtNumero.EditValue = CuentaBancariaDAC.NextConsecutivoCheque(Convert.ToInt32(this.slkupCuentaBancaria.EditValue));

                if (Accion == "New")
                {
                    HabilitarControles(true, false);
                    ClearControls();
                    this.tabDocumento.Visible = false;
                    this.ValidateChildren();
                    this.slkupTipo.Enabled   = false;
                    this.btnAprobar.Enabled  = false;
                    this.btnImprimir.Enabled = false;
                    this.btnAnular.Enabled   = false;
                }
                else
                {
                    Accion = "Edit";

                    if (_currentRow["Asiento"].ToString() != "")
                    {
                        this.btnImprimir.Enabled = true;
                        this.btnAprobar.Enabled  = false;
                        this.btnAnular.Enabled   = true;
                    }
                    else
                    {
                        this.btnImprimir.Enabled = false;
                        this.btnAprobar.Enabled  = true;
                        this.btnAnular.Enabled   = false;
                    }
                    HabilitarControles(true, false);
                    this.slkupCuentaBancaria.ReadOnly = true;
                    this.txtNumero.ReadOnly           = true;
                }
                AplicarPrivilegios();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }