public virtual void Init(ContabilidadConfig config)
        {
            _config = config;
            SetConditions(config.Conditions);

            _accounting_entry = Convert.ToInt64(_config.AsientoInicial);

            if (!_config.RutaSalida.EndsWith("\\"))
            {
                _config.RutaSalida += "\\";
            }

            if (!Directory.Exists(_config.RutaSalida))
            {
                Directory.CreateDirectory(_config.RutaSalida);
            }

            _ayudas        = AyudaList.GetList(false);
            _taxes         = ImpuestoList.GetList(false);
            _families      = FamiliaList.GetList(false, true);
            _bank_accounts = BankAccountList.GetList(false);
            _expense_types = TipoGastoList.GetList(false);

            _registry                  = Registro.New(ETipoRegistro.Contabilidad);
            _registry.Nombre           = Resources.Labels.REGISTRO_CONTABILIDAD;
            _registry.ETipoExportacion = config.TipoExportacion;
            _registry.Observaciones    = GetConditions();
        }
示例#2
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
            case molAction.Copy:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    AyudaList listA = AyudaList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:
                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    AyudaList listD = AyudaList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
示例#3
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Ayuda");

            long oid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                List = AyudaList.GetList(false);
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Ayudas");
        }