internal IList <InventoryAdjustmentLine> FindCollectionByInventoryAdjustment(InventoryAdjustment ia)
 {
     if (UseMemoryStore)
     {
         IList <InventoryAdjustmentLine> store = DataStore;
         var result = from s in store
                      where s.InventoryAdjustmentID == ia.InventoryAdjustmentID
                      select s;
         return(result.ToList());
     }
     return(_FindCollectionByInventoryAdjustment(ia));
 }
Example #2
0
        public override void AssignFrom(Accounting.Core.Entity rhs)
        {
            base.AssignFrom(rhs);

            InventoryAdjustment _obj = rhs as InventoryAdjustment;

            mLines = new BindingList <InventoryAdjustmentLine>();

            foreach (InventoryAdjustmentLine _line in _obj.Lines)
            {
                InventoryAdjustmentLine new_line = _line.Clone() as InventoryAdjustmentLine;
                new_line.InventoryAdjustment = this;
                mLines.Add(new_line);
            }
        }
        protected IList <InventoryAdjustmentLine> _FindCollectionByInventoryAdjustment(InventoryAdjustment ia)
        {
            List <InventoryAdjustmentLine> _grp = new List <InventoryAdjustmentLine>();

            DbSelectStatement clause = DbMgr.CreateSelectClause();

            clause.SelectAll().From("InventoryAdjustmentLines").Criteria.IsEqual("InventoryAdjustmentLines", "InventoryAdjustmentID", ia.InventoryAdjustmentID);

            DbCommand    _cmd    = CreateDbCommand(clause);
            DbDataReader _reader = _cmd.ExecuteReader();

            while (_reader.Read())
            {
                InventoryAdjustmentLine _obj = CreateDbEntity();
                LoadFromReader(_obj, _reader);
                _grp.Add(_obj);
            }

            _reader.Close();
            _cmd.Dispose();

            return(_grp);
        }