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)
                {
                    ExpedienteList listA = ExpedienteList.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)
                {
                    ExpedienteList listD = ExpedienteList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
Ejemplo n.º 2
0
 public static string SELECT(Expedient item)
 {
     Library.Store.QueryConditions conditions = new Library.Store.QueryConditions {
         Expedient = item.GetInfo(false)
     };
     return(SELECT(conditions, false));
 }
Ejemplo n.º 3
0
        public static string SELECT(Expedient item)
        {
            string query =
                SELECT(new QueryConditions {
                Expedient = item.GetInfo()
            }) + @"
            ORDER BY ST.""OID_BATCH"", ST.""FECHA"" ASC, ST.""OID""";

            return(query);
        }
Ejemplo n.º 4
0
        public static string SELECT_FROM_LIST_BY_PARTIDA(Expedient item, string list)
        {
            QueryConditions conditions = new QueryConditions {
                Expedient = item.GetInfo(false)
            };

            string query = Stock.SELECT(conditions, false) +
                           " AND ST.\"OID_BATCH\" IN (" + list + ")";

            return(query);
        }
Ejemplo n.º 5
0
        protected override void SaveAction()
        {
            _action_result = SaveObject() ? DialogResult.OK : DialogResult.Ignore;

            if (_action_result == DialogResult.OK)
            {
                //Actualizamos la cache
                ExpedienteList cache = Cache.Instance.Get(typeof(ExpedienteList)) as ExpedienteList;
                if (cache != null)
                {
                    cache.Change(_entity.Oid, _entity.GetInfo(false), true);
                }
            }
        }
Ejemplo n.º 6
0
        public static Stocks GetChildListByPartida(Expedient parent, long oidPartida, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                Expedient = parent.GetInfo(false),
                Partida   = Batch.NewChild().GetInfo(false)
            };

            conditions.Partida.Oid = oidPartida;
            criteria.Query         = Stocks.SELECT(conditions);

            return(DataPortal.Fetch <Stocks>(criteria));
        }
Ejemplo n.º 7
0
        public static StockList GetListByExpediente(long oid, bool throwStockException)
        {
            CriteriaEx criteria = Stock.GetCriteria(Stock.OpenSession());

            criteria.Childs = true;

            Expedient item = Expedient.New();

            item.Oid       = oid;
            criteria.Query = StockList.SELECT(item.GetInfo(false));

            StockList list = DataPortal.Fetch <StockList>(criteria);

            list.UpdateStocksByBatch(throwStockException);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Ejemplo n.º 8
0
 public static string SELECT(Expedient parent)
 {
     return(SELECT(new QueryConditions {
         Expedient = parent.GetInfo(false)
     }));
 }
Ejemplo n.º 9
0
 public static string SELECT(Expedient source)
 {
     return(Cabeza.SELECT(new QueryConditions {
         Expedient = source.GetInfo()
     }, true));
 }
Ejemplo n.º 10
0
 public static string SELECT(Expedient source)
 {
     return(Expense.SELECT(new QueryConditions {
         Expedient = source.GetInfo(false), CategoriaGasto = ECategoriaGasto.Expediente
     }, true));
 }
Ejemplo n.º 11
0
 public static string SELECT(Expedient parent)
 {
     return(LineaFomento.SELECT(new QueryConditions {
         Expedient = parent.GetInfo(false)
     }, true));
 }
 public static string SELECT(Expedient item)
 {
     return(SELECT(new Library.Invoice.QueryConditions {
         Expediente = item.GetInfo(false)
     }));
 }
Ejemplo n.º 13
0
 public static string SELECT(Expedient source)
 {
     return(Payroll.SELECT(new QueryConditions {
         Expedient = source.GetInfo(false)
     }, true));
 }