Ejemplo n.º 1
0
        public async Task <long> CreateOrUpdateReveice(ReceiveEditDto input)
        {
            BD_Receive item = input.MapTo <BD_Receive>();

            //BD_Receive src = _receiveRepository.Get(input.Id.Value).Attach();

            //context.Entry(model).State = System.Data.Entity.EntityState.Modified;
            return(await _receiveRepository.InsertOrUpdateAndGetIdAsync(item));
        }
Ejemplo n.º 2
0
        public List <BD_Instrument> GetRegistedInstruments(BD_Receive receive)
        {
            var query = from rein in _receiveInstrumentRepository.GetAll()
                        join instrument in _instrumentRepository.GetAll() on rein.Instrument_ID equals instrument.Id
                        where rein.Receive_ID == receive.Id
                        select instrument;

            return(query.ToList());
        }
Ejemplo n.º 3
0
        public async Task AddToReceiveAsync(BD_Instrument instrument, BD_Receive receive)
        {
            var currentReceives = await GetReceivesAsync(instrument);

            if (currentReceives.Any(cre => cre.Id == receive.Id))
            {
                return;
            }

            await _receiveInstrumentRepository.InsertAsync(new BD_ReceiveInstrument(instrument.Id, receive.Id));
        }
Ejemplo n.º 4
0
 public async Task RemoveFromReceiveAsync(BD_Instrument instrument, BD_Receive receive)
 {
     await _receiveInstrumentRepository.DeleteAsync(rein => rein.Instrument_ID == instrument.Id && rein.Receive_ID == receive.Id);
 }