示例#1
0
        public override IEnumerable <IBarCode> GetAllBarCodes()
        {
            _table.InitializeDatabase();
            var barCodes = _table.SelectAll().ToArray();

            return(barCodes.Select(objects => ObjectToIBarCodeConvertor.Convert(objects, BarCodeFactory, _transactionStorage)).ToList());
        }
示例#2
0
        public override IBarCode CreateBarCode(IBarCode barCode)
        {
            _table.InitializeDatabase();
            if (barCode.Id == 0)
            {
                barCode.Id = _table.AddData(ObjectToIBarCodeConvertor.ConvertToKeyValuePair(barCode));
            }
            else
            {
                _table.AddData(ObjectToIBarCodeConvertor.ConvertToKeyValuePairWithId(barCode));
            }

            return(barCode);
        }
示例#3
0
 public override void UpdateBarCode(IBarCode barCode)
 {
     _table.InitializeDatabase();
     _table.UpdateData(ObjectToIBarCodeConvertor.ConvertToKeyValuePair(barCode), barCode.Id);
 }